Advertisement
Ellye

Disable Battle Animations Option

Nov 29th, 2015
1,139
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /*:
  2.  * Made by request.
  3.  * @plugindesc Ver.2015-11-29-1930. Gives an option for the player to disable battle animations.
  4.  * <Ellye_DAO>
  5.  * @author https://ellyeblog.wordpress.com/ || http://steamcommunity.com/id/Ellye
  6.  *
  7.  * @param Options Menu Text
  8.  * @desc Text to display on Options Menu
  9.  * @default
  10.  */
  11.  
  12. var Imported = Imported || {};
  13. Imported.Ellye_DAO = true;
  14.  
  15. (function() {
  16.  
  17.     var parameters = $plugins.filter(function(p) {
  18.         return p.description.contains('<Ellye_DAO>');
  19.     })[0].parameters; //Thanks to Iavra
  20.  
  21.     var opt_menu_text = String(parameters['Options Menu Text'] || "Disable Battle VFX");
  22.  
  23.  
  24.     //Add the option in the option screen:
  25.     _window_options_addgeneraloptions_alias = Window_Options.prototype.addGeneralOptions;
  26.     Window_Options.prototype.addGeneralOptions = function()
  27.     {
  28.         _window_options_addgeneraloptions_alias.call(this);
  29.         this.addCommand(opt_menu_text, 'disableAnimations');
  30.     };
  31.  
  32.     //Set the inial configuration value:
  33.     ConfigManager.disableAnimations = false;
  34.  
  35.     //Unfortunatelly, we need to fully overwrite .makeData due to the way it is setup.
  36.     ConfigManager.makeData = function()
  37.     {
  38.         var config = {};
  39.         config.alwaysDash = this.alwaysDash;
  40.         config.commandRemember = this.commandRemember;
  41.         config.disableAnimations = this.disableAnimations;
  42.         config.bgmVolume = this.bgmVolume;
  43.         config.bgsVolume = this.bgsVolume;
  44.         config.meVolume = this.meVolume;
  45.         config.seVolume = this.seVolume;
  46.         return config;
  47.     };
  48.  
  49.     //Apply data can be aliased though, not that it's much easy with the above being overwritten.
  50.     _configmanager_applydata_alias = ConfigManager.applyData;
  51.     ConfigManager.applyData = function(config)
  52.     {
  53.         _configmanager_applydata_alias.call(this, config);
  54.         this.disableAnimations = this.readFlag(config, 'disableAnimations');
  55.     };
  56.  
  57.     //Now to actually disable animations when the option is on:
  58.     _gamebattler_disable_animation_alias = Game_Battler.prototype.startAnimation;
  59.     Game_Battler.prototype.startAnimation = function(animationId, mirror, delay)
  60.     {
  61.         if (ConfigManager.disableAnimations)
  62.         {
  63.             return;
  64.         }
  65.         _gamebattler_disable_animation_alias.call(this, animationId, mirror, delay);
  66.     };
  67.  
  68.     _gamebattler_startweaponanimation_alias = Game_Battler.prototype.startWeaponAnimation;
  69.     Game_Battler.prototype.startWeaponAnimation = function(weaponImageId)
  70.     {
  71.         if (ConfigManager.disableAnimations)
  72.         {
  73.             return;
  74.         }
  75.         _gamebattler_startweaponanimation_alias.call(this, weaponImageId);
  76.     };
  77.  
  78.     _game_characterbase_requestanimation_alias = Game_CharacterBase.prototype.requestAnimation;
  79.     Game_CharacterBase.prototype.requestAnimation = function(animationId)
  80.     {
  81.         if (ConfigManager.disableAnimations)
  82.         {
  83.             return;
  84.         }
  85.         _game_characterbase_requestanimation_alias.call(this, animationId);
  86.     };
  87.  
  88. })();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement