Advertisement
Ellye

Disable Escape

Nov 21st, 2015
348
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // Place file inside /js/plugins
  2. // Remember to save after adding plugins or changing parameters.
  3. //=============================================================================
  4. // Disable Escape
  5. //=============================================================================
  6. /*:
  7.  * Version: 2015-11-21-1310
  8.  *
  9.  * CHANGE LOG:
  10.  * 2015-11-21-1310: Released.
  11.  *
  12.  *
  13.  * @plugindesc Ver.2015-11-21-1310. Disable escape menu globally.
  14.  * <Ellye ED>
  15.  * @author https://ellyeblog.wordpress.com/ || http://steamcommunity.com/id/Ellye
  16.  *
  17.  * @param Skip Turn Command
  18.  * @desc Whether to add a Skip Turn command to actors. 0: off, 1: on. Default: 0
  19.  * @default 0
  20.  *
  21.  * @param Skip Turn Text
  22.  * @desc Text do display for Skip Turn Command.
  23.  * @default Skip
  24.  *
  25.  *
  26.  * @help
  27.  * Plug and play, will disable escape for all battles.
  28.  *
  29.  */
  30.  
  31. (function()
  32. {
  33.    
  34.     var parameters = $plugins.filter(function(p) {
  35.         return p.description.contains('<Ellye ED>');
  36.     })[0].parameters; //Thanks to Iavra
  37.  
  38.     var skip_turn_command = Number(parameters['Skip Turn Command'] || 0);
  39.     var skip_turn_text = String(parameters['Skip Turn Text'] || "Skip");
  40.  
  41.     Scene_Battle.prototype.startPartyCommandSelection = function() {
  42.         this.refreshStatus();
  43.         this.commandFight();
  44.     };
  45.  
  46.     if (skip_turn_command === 1)
  47.     {
  48.         _alias_sb_p_cacw = Scene_Battle.prototype.createActorCommandWindow;
  49.         Scene_Battle.prototype.createActorCommandWindow = function() {
  50.             _alias_sb_p_cacw.call(this);
  51.             this._actorCommandWindow.setHandler('skip', this.commandSkip.bind(this));
  52.         };
  53.  
  54.         _alias_wacpmcl = Window_ActorCommand.prototype.makeCommandList;
  55.         Window_ActorCommand.prototype.makeCommandList = function() {
  56.             _alias_wacpmcl.call(this);
  57.             if (this._actor)
  58.             {
  59.                 this.addSkipCommand();
  60.             }
  61.         };
  62.  
  63.         Window_ActorCommand.prototype.addSkipCommand = function() {
  64.             this.addCommand(skip_turn_text, 'skip');
  65.         };
  66.  
  67.         Scene_Battle.prototype.commandSkip = function() {
  68.             this.selectNextCommand();
  69.         };
  70.     }
  71. })();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement