/*============================================================================= iiiWindowAnim.js ---------------------------------------------------------------------------- This software is released under the MIT License. http://opensource.org/licenses/mit-license.php =============================================================================*/ /*: * @plugindesc ウインドウ表示アニメ変更 * @target MZ * @base PluginCommonBase * @dependancies TorigoyaMZ_FrameTween * @dependancies AltMenuScreenKANI * @dependancies CharacterPictureManager * @author iii */ (() => { "use strict"; const script = document.currentScript; const pluginParam = PluginManagerEx.createParameter(script); const _tw = Torigoya.FrameTween; const _twe = Torigoya.FrameTween.Easing; /******************************************************* * Scene_Base */ //シーン切り替えのタイミングで呼ばれる const Scene_Base_prototype_stop = Scene_Base.prototype.stop; Scene_Base.prototype.stop = function () { Scene_Base_prototype_stop.call(this); this.clearTweens(); }; Scene_Base.prototype.clearTweens = function () { // Tweenが残ったままだとエラーになるのでクリア if (Torigoya && Torigoya.FrameTween && Torigoya.FrameTween.group) { Torigoya.FrameTween.group.clear(); } }; /******************************************************* * Scene_Menu */ const Scene_Menu_prototype_start = Scene_Menu.prototype.start; Scene_Menu.prototype.start = function () { Scene_Menu_prototype_start.call(this); this.startWindowAnim(); }; // シーン開始時のウインドウアニメ再生 Scene_Menu.prototype.startWindowAnim = function () { // アニメ終了までのフレーム数 const durationFrame = 30; // Easingの種類。 // https://easings.net/ja が参考になるが、定義されていない可能性もあるので注意 const easing = _twe.easeOutSine; if (this._commandWindow) { const targetWin = this._commandWindow; const to = { x: targetWin.x, y: targetWin.y }; const from = { x: Graphics.boxWidth + targetWin.width, y: to.y }; _tw.create(targetWin, from).to(to, durationFrame, easing).start(); } if (this._goldWindow) { const targetWin = this._goldWindow; const to = { x: targetWin.x, y: targetWin.y }; const from = { x: Graphics.boxWidth + targetWin.width, y: to.y }; _tw.create(targetWin, from).to(to, durationFrame, easing).start(); } if (this._statusWindow) { const targetWin = this._statusWindow; const to = { x: targetWin.x, y: targetWin.y }; const from = { x: 0 - targetWin.width, y: to.y }; _tw.create(targetWin, from).to(to, durationFrame, easing).start(); } //以下はAltMenuScreenKANIで追加されたウインドウ //現在目的ウインドウ if (this._mainPurposeWindow) { const targetWin = this._mainPurposeWindow; const to = { x: targetWin.x, y: targetWin.y, opacity: 0 }; const from = { x: to.x - 10, y: targetWin.y, opacity: 0 }; _tw.create(targetWin, from).to(to, durationFrame, easing).start(); } //基本情報ウインドウ if (this._basicStatusWindow) { const targetWin = this._basicStatusWindow; const to = { x: targetWin.x, y: targetWin.y, opacity: 0 }; const from = { x: to.x - 10, y: targetWin.y, opacity: 0 }; _tw.create(targetWin, from).to(to, durationFrame, easing).start(); } //詳細情報(ステータス)ウインドウ if (this._detailEquipWindow) { const targetWin = this._detailEquipWindow; const to = { x: targetWin.x, y: targetWin.y, opacity: 0 }; const from = { x: to.x - 10, y: targetWin.y, opacity: 0 }; _tw.create(targetWin, from).to(to, durationFrame, easing).start(); } //詳細情報(装備)ウインドウ if (this._detailStatusWindow) { const targetWin = this._detailStatusWindow; const to = { x: targetWin.x, y: targetWin.y, opacity: 0 }; const from = { x: to.x - 10, y: targetWin.y, opacity: 0 }; _tw.create(targetWin, from).to(to, durationFrame, easing).start(); } //Hst情報ウインドウ if (this._adultStatusWindow) { const targetWin = this._adultStatusWindow; const to = { x: targetWin.x, y: targetWin.y, opacity: 0 }; const from = { x: to.x - 10, y: targetWin.y, opacity: 0 }; _tw.create(targetWin, from).to(to, durationFrame, easing).start(); } //以下は立ち絵管理プラグイン用。立ち絵管理プラグイン側にフェード機能もあるのでそちら利用するのが良いかも? if (!this._standSpriteScene || !this._standSprites) { return; //立ち絵管理プラグインの対象シーンじゃない or 立ち絵スプライトが存在しない } this._standSprites.forEach((sprite, key) => { const to = { x: sprite.x, y: sprite.y }; const from = { x: 0 - sprite.width, y: sprite.y }; _tw.create(sprite, from).to(to, durationFrame, easing).start(); }); }; })();