Double_X

DoubleX RMMV Dynamic Settings Compatibility v100a

Aug 20th, 2016
195
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /*============================================================================
  2.  *    ## Plugin Info                                                          
  3.  *----------------------------------------------------------------------------
  4.  *    # Plugin Name                                                          
  5.  *      DoubleX RMMV Dynamic Settings Compatibility                          
  6.  *----------------------------------------------------------------------------
  7.  *    # Terms Of Use                                                          
  8.  *      1. Commercial use's always allowed and crediting me's always optional.
  9.  *      2. You shall keep this plugin's Plugin Info part's contents intact.  
  10.  *      3. You shalln't claim that this plugin's written by anyone other than
  11.  *         DoubleX or my aliases. I always reserve the right to deny you from
  12.  *         using any of my plugins anymore if you've violated this.          
  13.  *      4. CC BY 4.0, except those conflicting with any of the above, applies
  14.  *         to this plugin, unless you've my permissions not needing follow so.
  15.  *      5. I always reserve the right to deny you from using this plugin      
  16.  *         anymore if you've violated any of the above.                      
  17.  *----------------------------------------------------------------------------
  18.  *    # Prerequisites                                                        
  19.  *      Nothing special                                                      
  20.  *----------------------------------------------------------------------------
  21.  *    # Links                                                                
  22.  *      This plugin:                                                          
  23.  *      1.                                        
  24.  *----------------------------------------------------------------------------
  25.  *    # Author                                                                
  26.  *      DoubleX                                                              
  27.  *----------------------------------------------------------------------------
  28.  *    # Changelog                                                            
  29.  *      v1.00a(GMT 0400 21-8-2016):                                          
  30.  *      1. 1st version of this plugin finished                                
  31.  *============================================================================*/
  32. /*:
  33.  * @plugindesc Fixes DoubleX RMMV Dynamic Settings compatibility issues
  34.  * @author DoubleX
  35.  *
  36.  * @help
  37.  *============================================================================
  38.  *    ## Addressed Plugins                                                    
  39.  *----------------------------------------------------------------------------
  40.  *    # DoubleX RMMV Popularized ATB Core:                                    
  41.  *      1. Actor ATB bars aren't drawn properly on the status window when the
  42.  *         value of optDisplayTp's different from that in the system setting  
  43.  *         - Reference tag: PATB optDisplayTp                                
  44.  *         - Rewritten Window_BattleStatus.prototype.patb_gauge_area_width and
  45.  *           Window_BattleStatus.prototype.refresh_patb_bars                  
  46.  *============================================================================
  47.  */
  48.  
  49. var DoubleX_RMMV = DoubleX_RMMV || {};
  50. DoubleX_RMMV['Dynamic Settings Compatibility'] = 'v1.00a';
  51.  
  52. /*============================================================================
  53.  *    ## Plugin Implementations                                              
  54.  *       You need not edit this part as it's about how this plugin works      
  55.  *----------------------------------------------------------------------------
  56.  *    # Plugin Support Info:                                                  
  57.  *      1. Prerequisites                                                      
  58.  *         - Bsci knowledge on how the addresses plugins work                
  59.  *         - Some RMMV plugin development proficiency to fully comprehend this
  60.  *           plugin                                                          
  61.  *----------------------------------------------------------------------------*/
  62.  
  63. if (DoubleX_RMMV['Dynamic Settings']) {
  64.  
  65. DoubleX_RMMV.Dynamic_Settings_Compatibility = {};
  66.  
  67. /*----------------------------------------------------------------------------*/
  68.  
  69. if (DoubleX_RMMV["PATB Core"]) {
  70.  
  71. (function(DSCPATB) {
  72.  
  73.     'use strict';
  74.  
  75.     DSCPATB.Window_BattleStatus = {};
  76.     var WBS = DSCPATB.Window_BattleStatus;
  77.  
  78.     WBS.patb_gauge_area_width =
  79.     Window_BattleStatus.prototype.patb_gauge_area_width;
  80.     Window_BattleStatus.prototype.patb_gauge_area_width = function() {
  81.     // Rewrite; Hotspot
  82.         var p = $gameSystem.patb, w = p.hp_bar_w + p.mp_bar_ox + p.mp_bar_w;
  83.         // Rewritten
  84.         if ($gameSystem.dynamicSettings.optDisplayTp) {
  85.             w += p.tp_bar_ox + p.tp_bar_w;
  86.         }
  87.         // PATB optDisplayTp
  88.         return w + p.atb_bar_ox + p.atb_bar_w;
  89.     }; // Window_BattleStatus.prototype.patb_gauge_area_width
  90.  
  91.     WBS.refresh_patb_bars = Window_BattleStatus.prototype.refresh_patb_bars;
  92.     Window_BattleStatus.prototype.refresh_patb_bars = function() {
  93.     // Rewrite; Hotspot
  94.         var patb = $gameSystem.patb, actor, rect, type;
  95.         // Rewritten
  96.         var ox = patb.hp_bar_w + patb.mp_bar_ox + patb.mp_bar_w;
  97.         ox += patb.atb_bar_ox;
  98.         if ($gameSystem.dynamicSettings.optDisplayTp) {
  99.             ox += patb.tp_bar_ox + patb.tp_bar_w;
  100.         }
  101.         // PATB optDisplayTp
  102.         for (var index = 0, max = this.maxItems(); index < max; index++) {
  103.             actor = $gameParty.battleMembers()[index];
  104.             if (!actor) { continue; }
  105.             type = actor.patb_type();
  106.             if (!actor.patb_val_change[type]) { continue; }
  107.             rect = this.gaugeAreaRect(index);
  108.             this.draw_actor_patb(actor, rect.x + ox, rect.y, type);
  109.             actor.patb_val_change[type] = false;
  110.         }
  111.     }; // Window_BattleStatus.prototype.refresh_patb_bars
  112.  
  113. })(DoubleX_RMMV.Dynamic_Settings_Compatibility['PATB Core'] = {});
  114.  
  115. }
  116.  
  117. /*----------------------------------------------------------------------------*/
  118.  
  119. } else {
  120.     alert('Place Dynamic Settings Compatibility below Dynamic Settings.');
  121. } // if (DoubleX_RMMV['Dynamic Settings'])
  122.  
  123. /*============================================================================*/
RAW Paste Data

Adblocker detected! Please consider disabling it...

We've detected AdBlock Plus or some other adblocking software preventing Pastebin.com from fully loading.

We don't have any obnoxious sound, or popup ads, we actively block these annoying types of ads!

Please add Pastebin.com to your ad blocker whitelist or disable your adblocking software.

×