sakura-gozen/js/plugins/iii/iiiFadeSpeedChanger.js
2025-02-19 10:16:07 -06:00

130 lines
4.1 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/*=============================================================================
iiiFadeSpeedChanger.js
----------------------------------------------------------------------------
This software is released under the MIT License.
http://opensource.org/licenses/mit-license.php
----------------------------------------------------------------------------
Version
0.0.1
=============================================================================*/
/*:
* @plugindesc 場所移動時などツール指定のフェード時間の変更
* @target MZ
* @author ズワイKANI
*
* @command FadeOutTask
* @text フェードアウト(暗くする)処理
* @desc フェード処理を統一し、漏れを無くします。
* @arg FadeTime
* @text フェード時間
* @desc フェードの速さを指定します。
* @default 120
* @type select
* @option normal(120)
* @value 120
* @option short(60)
* @value 60
* @option long(180)
* @value 180
* @option flash
* @value 1
* @option verylong(240)
* @value 240
* @option veryshort(30)
* @value 30
* @command FadeInTask
* @text フェードイン(明るくする)処理
* @desc フェード処理を統一し、漏れを無くします。
* @arg FadeTime
* @text フェード時間
* @desc フェードの速さを指定します。
* @default 120
* @type select
* @option normal(120)
* @value 120
* @option short(60)
* @value 60
* @option long(180)
* @value 180
* @option flash
* @value 1
* @option verylong(240)
* @value 240
* @option veryshort(30)
* @value 30
*
* @help フェードの処理を設定
* すべての画面遷移においてのフェード時間変更を適用している。
* プラグインコマンドで演出用のフェードの長さを適時統一。
* ※プラグインコマンドのフェード処理はLL_CustomFade.jsルルの協会 様のプラグイン)の処理を改変し
* 統合して実装させて頂いています。
*
* ---
* 利用規約:
* 作者に無断で改変、再配布が可能で、利用形態商用、18禁利用等
* についても制限はありません。
* このプラグインはもうあなたのものです。
*/
(() => {
"use strict";
/**
* PluginCommand
*/
const script = document.currentScript;
PluginManagerEx.registerCommand(script, "FadeOutTask", function (args) {
let fadetime = Number(args.FadeTime);
if (!$gameMessage.isBusy()) {
$gameScreen.startFadeOut(fadetime);
this.wait(fadetime);
}
});
PluginManagerEx.registerCommand(script, "FadeInTask", function (args) {
let fadetime = Number(args.FadeTime);
if (!$gameMessage.isBusy()) {
$gameScreen.startFadeIn(fadetime);
this.wait(fadetime);
}
});
/**
* フェードの全体時間を調整
*/
// 場所移動など諸々フェードにかかる時間
const _fadeSpeed = 12; // デフォルトは24
// イベントの待ち時間
Game_Interpreter.prototype.fadeSpeed = function () {
return _fadeSpeed;
};
Scene_Base.prototype.fadeSpeed = function () {
return _fadeSpeed;
};
const _Scene_Base_prototype_startFadeIn = Scene_Base.prototype.startFadeIn;
Scene_Base.prototype.startFadeIn = function (duration, white) {
//_Scene_Base_prototype_startFadeIn.call(this, duration, white);
this._fadeSign = 1;
this._fadeDuration = duration;
this._fadeWhite = white;
if (this._fadeDuration > 0) {
this._fadeOpacity = 255;
this.updateColorFilter();
}
};
const _Scene_Base_prototype_startFadeOut = Scene_Base.prototype.startFadeOut;
Scene_Base.prototype.startFadeOut = function (duration, white) {
//_Scene_Base_prototype_startFadeOut.call(this, duration, white);
this._fadeSign = -1;
this._fadeDuration = duration;
this._fadeWhite = white;
if (this._fadeDuration > 0) {
this._fadeOpacity = 0;
this.updateColorFilter();
}
};
})();