magical-girls-runa-and-nanami/js/plugins/HideTimerSprite.js
2026-02-28 12:33:13 -06:00

38 lines
1.6 KiB
JavaScript
Raw Permalink 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 v1.1 タイマー表示を常時非表示最強版・Map/Battle対応
* @author You
* @help
* 画面右上のタイマーを常に非表示にします。タイマーのカウント機能自体はそのまま動作します。
* イベント側では通常通り「タイマーの操作:◯秒(開始)」を使ってください。
*
* 競合対策として Sprite_Timer の update をフックし、毎フレームで可視化を無効にします。
* 他プラグインが表示を復活させても、このプラグインが上書きで非表示に保ちます。
*
* 使い方:
* 1) このファイルを HideTimerSprite.js として js/plugins/ に保存
* 2) プラグイン管理で有効化
* 3) 他のUI改変系プラグインより「下」に置くとより確実です
*/
(() => {
// 生成直後から見えないように(保険)
const _Sprite_Timer_initialize = Sprite_Timer.prototype.initialize;
Sprite_Timer.prototype.initialize = function() {
_Sprite_Timer_initialize.call(this);
this.visible = false;
this.opacity = 0;
};
// 毎フレームで強制的に非表示にする(最強)
const _Sprite_Timer_update = Sprite_Timer.prototype.update;
Sprite_Timer.prototype.update = function() {
_Sprite_Timer_update.call(this);
this.visible = false;
this.opacity = 0;
// 念のため親にぶら下がっていても非表示を維持
if (this.parent && this.parent.visible !== false) {
// ここでは親は消さず、タイマーだけを不可視に固定
}
};
})();