brainwashing-school/js/plugins/NUUN_BattleStyleEX_XP_fix.js
2025-05-30 08:36:40 -05:00

39 lines
No EOL
1.2 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.

/*:
* @target MZ
* @plugindesc NUUN_BattleStyleEX 勝利後の立ち絵チラつき防止
* @orderAfter NUUN_BattleStyleEX
*/
(() => {
"use strict";
/** HUD を確実に消してからシーン遷移させる */
const _Scene_Battle_stop = Scene_Battle.prototype.stop;
Scene_Battle.prototype.stop = function() {
clearHud(this._spriteset);
_Scene_Battle_stop.apply(this, arguments);
};
/** 万一 terminate が先に呼ばれる環境も考慮 */
const _Scene_Battle_terminate = Scene_Battle.prototype.terminate;
Scene_Battle.prototype.terminate = function() {
clearHud(this._spriteset);
_Scene_Battle_terminate.apply(this, arguments);
};
/** 共通HUD スプライトを一括で不可視にするだけ */
function clearHud(spriteset) {
if (!spriteset) return;
const list = [
"_battleHudBase",
"_battleHudBack",
"_battleHudFront",
"_battleEffects",
"_battleDamege"
];
for (const k of list) {
const spr = spriteset[k];
if (spr) spr.visible = false;
}
}
})();