diff --git a/public/images/rextexteditplugin.min.js b/public/images/rextexteditplugin.min.js new file mode 100644 index 000000000000..db620aacdfea --- /dev/null +++ b/public/images/rextexteditplugin.min.js @@ -0,0 +1 @@ +!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t="undefined"!=typeof globalThis?globalThis:t||self).rextexteditplugin=e();}(undefined,(function(){function t(t,n,i){return n=c(n),function(t,e){if(e&&("object"==typeof e||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return l(t)}(t,e()?Reflect.construct(n,i||[],c(t).constructor):n.apply(t,i))}function e(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})));}catch(t){}return (e=function(){return !!t})()}function n(t){var e=function(t,e){if("object"!=typeof t||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,e||"default");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return ("string"===e?String:Number)(t)}(t,"string");return "symbol"==typeof e?e:String(e)}function i(t){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},i(t)}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function r(t,e){for(var i=0;i0&&(e.paddingLeft="".concat(r.left,"px")),r.right>0&&(e.paddingRight="".concat(r.right,"px")),i.backgroundCornerRadius&&(e.borderRadius=F(e,"borderRadius","".concat(i.backgroundCornerRadius,"px")));var s=new S(n,t.x,t.y,F(e,"width",t.width),F(e,"height",t.height),e);s.setScale(t.scaleX,t.scaleY).setOrigin(t.originX,t.originY).setScrollFactor(t.scrollFactorX,t.scrollFactorY);var u=t.parentContainer;return u?u.add(s):n.add.existing(s),s},z=function(t){return t.hasOwnProperty("align")?t.align:t.hasOwnProperty("halign")?t.halign:"left"},G=Phaser.Utils.Objects.GetValue,V=Phaser.Utils.Objects.Merge,A={open:function(t,e){var n,i;void 0===t&&(t={}),t=V(t,this.openConfig),(n=this)!==b&&(void 0!==b&&b.close(),b=n),(i=t)&&"function"==typeof i&&(e=t,t=void 0);var o=G(t,"inputType",void 0);void 0===o&&(o=G(t,"type","text")),void 0===e&&(e=G(t,"onClose",void 0));var r=G(t,"onOpen",void 0),s=G(t,"onTextChanged",void 0);return this.inputText=U(this.parent,t).on("textchange",(function(t){var e=t.text;s?s(this.parent,e):this.parent.text=e;}),this).setFocus(),this.parent.setVisible(!1),this.onClose=e,G(t,"enterClose","textarea"!==o)&&this.scene.input.keyboard.once("keydown-ENTER",this.close,this),this.delayCall=function(t,e,n){return t.time.delayedCall(0,e,[],n)}(this.scene,(function(){this.scene.input.once("pointerdown",this.close,this),r&&r(this.parent),this.emit("open",this.parent);}),this),this},close:function(){return this===b&&(b=void 0),this.parent.setVisible(!0),this.inputText&&(this.inputText.destroy(),this.inputText=void 0),this.delayCall&&(this.delayCall.remove(),this.delayCall=void 0),this.scene.input.keyboard.off("keydown-ENTER",this.close,this),this.scene.input.off("pointerdown",this.close,this),this.onClose&&this.onClose(this.parent),this.emit("close",this.parent),this}},B=Phaser.Utils.Objects.GetValue,M=function(e){function n(e,i){var r;return o(this,n),(r=t(this,n,[e])).inputText=void 0,r.onClose=void 0,r.delayCall=void 0,r.setOpenConfig(i),B(i,"clickEnable",!0)&&e.on("pointerdown",(function(){this.open();}),l(r)).setInteractive(),r}return u(n,e),s(n,[{key:"shutdown",value:function(t){this.isShutdown||(this.close(),h(c(n.prototype),"shutdown",this).call(this,t));}},{key:"setOpenConfig",value:function(t){return void 0===t&&(t={}),this.openConfig=t,this}},{key:"isOpened",get:function(){return void 0!==this.inputText}},{key:"text",get:function(){return this.isOpened?this.inputText.text:this.parent.text}}]),n}(g);Object.assign(M.prototype,A);var N=function(e){function n(e){return o(this,n),t(this,n,[e])}return u(n,Phaser.Plugins.BasePlugin),s(n,[{key:"start",value:function(){this.game.events.on("destroy",this.destroy,this);}},{key:"add",value:function(t,e){return new M(t,e)}}]),n}(),I={edit:function(t,e,n){return t._edit||(t._edit=new M(t,{clickEnable:!1})),t._edit.open(e,n),t._edit}};return Object.assign(N.prototype,I),N})); \ No newline at end of file diff --git a/src/loading-scene.ts b/src/loading-scene.ts index df788643c8e2..a8e41b93cfc8 100644 --- a/src/loading-scene.ts +++ b/src/loading-scene.ts @@ -290,7 +290,9 @@ export class LoadingScene extends SceneBase { this.loadBgm("evolution", "bw/evolution.mp3"); this.loadBgm("evolution_fanfare", "bw/evolution_fanfare.mp3"); - this.load.plugin("rextexteditplugin", "https://raw.githubusercontent.com/rexrainbow/phaser3-rex-notes/master/dist/rextexteditplugin.min.js", true); + // this.load.plugin("rextexteditplugin", "https://raw.githubusercontent.com/rexrainbow/phaser3-rex-notes/master/dist/rextexteditplugin.min.js", true); + // this.load.plugin("rextexteditplugin", "images/rextexteditplugin.min.js", true); + this.load.plugin("rextexteditplugin",this.getCachedUrl("images/rextexteditplugin.min.js"), true); this.loadLoadingScreen();