/*: * @target MZ * @author IvI * @plugindesc [v1.0] ロード直後だけ自動実行を無効化するフラグを追加します * * @help SkipAutorunOnLoad.js * ---------------------------------------- * ■ 使い方 * スキップしたい自動実行イベントのページ条件に *   !$gameSystem.isJustLoaded() * と記述してください。 * ニューゲームや場所移動では実行され、ロード直後だけ実行されません。 * * ■ プラグインコマンド * ありません。 * ---------------------------------------- */ (() => { // ■ DataManager.loadGame をフックして「ロード直後」フラグを立てる const _loadGame = DataManager.loadGame; DataManager.loadGame = async function(savefileId) { const result = await _loadGame.call(this, savefileId); if (result) $gameSystem._justLoaded = true; return result; }; // ■ Game_System に判定用メソッドを追加 Game_System.prototype.isJustLoaded = function() { return !!this._justLoaded; }; // ■ Scene_Map.start でフラグをリセット const _start = Scene_Map.prototype.start; Scene_Map.prototype.start = function() { _start.call(this); if (this.isActive() && $gameSystem._justLoaded) { $gameSystem._justLoaded = false; } }; })();