Advertisement
Guest User

Untitled

a guest
Jun 27th, 2019
130
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function update_eqine(e,o){var t=$(".eqinv-container");if(t.length){let e,o=t.text().trimLeft();if(o.startsWith("Inventario")){console.log("update inventory"),(e=$(t.clone())).find(".eqinv-switch-action").remove(),$global_handler.overlay_inv.html(e.html()),$global_handler.overlay_inv.find("h3").remove();var i=$global_handler.overlay_inv.find(".eqinv-caption");return i.find("div:nth-child(2)").remove(),i.find("div:nth-child(1)").css("min-width","80%"),void $global_handler.overlay_inv.find(".eqinv-item").each(function(){const e=$(this),o=e.next(),t=o.text();e.css("min-width","80%");const i=e.find("span");i.text(i.text()+" x"+t),$(o).remove()})}if(o.startsWith("Equipaggiamento"))return console.log("update equip"),(e=$(t.clone())).find(".eqinv-switch-action").remove(),$global_handler.overlay_eq.html(e.html()),$global_handler.overlay_eq.find(".eqinv-totalweight-label").remove(),void $global_handler.overlay_eq.find("h3").remove()}if((t=$(".skill-list")).length){let e;if(-1!==t.text().trimLeft().indexOf("Abilità"))return console.log("update skill"),e=$(t.clone()),$global_handler.overlay_skill.html(e.html()),void $global_handler.overlay_skill.find(".skill-detail").each(function(){var e=$(this).find("span"),o=e[0].style.width,t='<div fxflex="0 1 100%" style="flex: 0 1 100%; box-sizing: border-box; max-width: 100%;"><span style="width:100%">'+o.replace("%","")+" </span></div>";console.log("skill-level: "+o);var i=e.parent();console.log("would like to delete this: "+i);var l=i.prev();console.log("skill-name: "+l.text()),$(l).after(t),l.css({"min-width":"130px","max-width":"130px"}),i.remove()})}}function _prepare_css(){$("<style type='text/css'> .overlay_custom{position:fixed;top:0;left:0;width:19%;height:30%;background-color:#000;z-index:999; min-width:300px} </style>").appendTo("head"),$("tg-right-sidebar").css("zoom","0.7")}function _add_overlay(){jQuery('<div class="b-ironlight-mini tg-box overlay_custom"> <div id="overlay_custom_content_inv" class="tg-dialog-content-nopadding tg-shadow-inset"> </div><div class="tg-border-box"><div class="tg-border tg-border-top"></div><div class="tg-border tg-border-left"></div><div class="tg-border tg-border-right"></div><div class="tg-border tg-border-bottom"></div></div></div><div class="b-ironlight-mini tg-box overlay_custom"> <div id="overlay_custom_content_eq" class="tg-dialog-content-nopadding tg-shadow-inset"> </div><div class="tg-border-box"><div class="tg-border tg-border-top"></div><div class="tg-border tg-border-left"></div><div class="tg-border tg-border-right"></div><div class="tg-border tg-border-bottom"></div></div></div><div class="b-ironlight-mini tg-box overlay_custom" style="max-width: 200px;min-width: 200px;"> <div id="overlay_custom_content_skill" class="tg-dialog-content-nopadding tg-shadow-inset"> </div><div class="tg-border-box"><div class="tg-border tg-border-top"></div><div class="tg-border tg-border-left"></div><div class="tg-border tg-border-right"></div><div class="tg-border tg-border-bottom"></div></div></div>').appendTo(document.body),$global_handler.overlay_inv=$("#overlay_custom_content_inv"),$global_handler.overlay_eq=$("#overlay_custom_content_eq"),$global_handler.overlay_skill=$("#overlay_custom_content_skill");var e=$global_handler.overlay_inv.parent(),o=$global_handler.overlay_eq.parent(),t=$global_handler.overlay_skill.parent();e.hide(),o.hide(),t.hide(),e.draggable(),o.draggable(),t.draggable()}function _prepare_listeners(){MutationObserver=window.MutationObserver||window.WebKitMutationObserver;const e=new MutationObserver(function(e,o){var t=$(".cdk-overlay-container");t.length&&(this.disconnect(),$global_handler.mutation_inveq=new MutationObserver(update_eqine),t.each(function(){console.log("attacching DOM listeners.."),$global_handler.mutation_inveq.observe(this,{subtree:!0,childList:!0}),console.log("attacching button listeners..");var e,o=$(".tg-main-buttons button");$global_handler.pg_button=o[0],$global_handler.equip_button=o[1],$global_handler.inventory_button=o[2],$global_handler.skill_button=o[3],$global_handler.pref_button=o[5];var t=$(".cdk-overlay-container"),i=function(o,t){o.is(":visible")?e===t&&o.hide():o.show(),e=t};$($global_handler.pg_button).click(function(){var o;console.log("clicked pg"),o=this,t.is(":visible")?e===o&&(t.hide(),t.css("z-index","-1")):(t.show(),t.css("z-index","1000")),e=o}),$($global_handler.equip_button).click(function(){console.log("clicked equip"),i($global_handler.overlay_eq.parent(),this)}),$($global_handler.inventory_button).click(function(){console.log("clicked inventory"),i($global_handler.overlay_inv.parent(),this)}),$($global_handler.skill_button).click(function(){console.log("clicked skill"),i($global_handler.overlay_skill.parent(),this)}),$($global_handler.pref_button).click(function(){console.log("clicked preference"),t.show(),e=this})}),t.hide())});$("body").each(function(){e.observe(this,{subtree:!0,childList:!0})})}function prepare_everything(){$global_handler={},_prepare_css(),_add_overlay(),_prepare_listeners()}!function(){if(void 0===window.global_handler){var e=function(){if(window.jQuery.ui)o();else{var e=document.createElement("script");e.onload=o,e.setAttribute("src","//ajax.googleapis.com/ajax/libs/jqueryui/1.12.1/jquery-ui.min.js"),document.body.appendChild(e)}},o=function(){console.log("creo engine"),prepare_everything()};!function(){if(window.jQuery)e();else{var o=document.createElement("script");o.onload=e,o.setAttribute("src","//ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"),document.body.appendChild(o)}}()}}();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement