Advertisement
Double_X

DoubleX RMMV Dynamic Settings Compatibility v100a

Aug 20th, 2016 (edited)
470
0
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. http://pastebin.com/XdheVbmp
  24.  *      Mentioned Patreon Supporters:
  25.  *      https://www.patreon.com/posts/71738797
  26.  *----------------------------------------------------------------------------
  27.  *    # Author
  28.  *      DoubleX
  29.  *----------------------------------------------------------------------------
  30.  *    # Changelog
  31.  *      v1.00a(GMT 0400 21-8-2016):
  32.  *      1. 1st version of this plugin finished
  33.  *============================================================================*/
  34. /*:
  35.  * @plugindesc Fixes DoubleX RMMV Dynamic Settings compatibility issues
  36.  * @author DoubleX
  37.  *
  38.  * @help
  39.  *============================================================================
  40.  *    ## Addressed Plugins
  41.  *----------------------------------------------------------------------------
  42.  *    # DoubleX RMMV Popularized ATB Core:
  43.  *      1. Actor ATB bars aren't drawn properly on the status window when the
  44.  *         value of optDisplayTp's different from that in the system setting
  45.  *         - Reference tag: PATB optDisplayTp
  46.  *         - Rewritten Window_BattleStatus.prototype.patb_gauge_area_width and
  47.  *           Window_BattleStatus.prototype.refresh_patb_bars
  48.  *============================================================================
  49.  */
  50.  
  51. var DoubleX_RMMV = DoubleX_RMMV || {};
  52. DoubleX_RMMV['Dynamic Settings Compatibility'] = 'v1.00a';
  53.  
  54. /*============================================================================
  55.  *    ## Plugin Implementations
  56.  *       You need not edit this part as it's about how this plugin works
  57.  *----------------------------------------------------------------------------
  58.  *    # Plugin Support Info:
  59.  *      1. Prerequisites
  60.  *         - Bsci knowledge on how the addresses plugins work
  61.  *         - Some RMMV plugin development proficiency to fully comprehend this
  62.  *           plugin
  63.  *----------------------------------------------------------------------------*/
  64.  
  65. if (DoubleX_RMMV['Dynamic Settings']) {
  66.  
  67. DoubleX_RMMV.Dynamic_Settings_Compatibility = {};
  68.  
  69. /*----------------------------------------------------------------------------*/
  70.  
  71. if (DoubleX_RMMV["PATB Core"]) {
  72.  
  73. (function(DSCPATB) {
  74.  
  75.     'use strict';
  76.  
  77.     DSCPATB.Window_BattleStatus = {};
  78.     var WBS = DSCPATB.Window_BattleStatus;
  79.  
  80.     WBS.patb_gauge_area_width =
  81.     Window_BattleStatus.prototype.patb_gauge_area_width;
  82.     Window_BattleStatus.prototype.patb_gauge_area_width = function() {
  83.     // Rewrite; Hotspot
  84.         var p = $gameSystem.patb, w = p.hp_bar_w + p.mp_bar_ox + p.mp_bar_w;
  85.         // Rewritten
  86.         if ($gameSystem.dynamicSettings.optDisplayTp) {
  87.             w += p.tp_bar_ox + p.tp_bar_w;
  88.         }
  89.         // PATB optDisplayTp
  90.         return w + p.atb_bar_ox + p.atb_bar_w;
  91.     }; // Window_BattleStatus.prototype.patb_gauge_area_width
  92.  
  93.     WBS.refresh_patb_bars = Window_BattleStatus.prototype.refresh_patb_bars;
  94.     Window_BattleStatus.prototype.refresh_patb_bars = function() {
  95.     // Rewrite; Hotspot
  96.         var patb = $gameSystem.patb, actor, rect, type;
  97.         // Rewritten
  98.         var ox = patb.hp_bar_w + patb.mp_bar_ox + patb.mp_bar_w;
  99.         ox += patb.atb_bar_ox;
  100.         if ($gameSystem.dynamicSettings.optDisplayTp) {
  101.             ox += patb.tp_bar_ox + patb.tp_bar_w;
  102.         }
  103.         // PATB optDisplayTp
  104.         for (var index = 0, max = this.maxItems(); index < max; index++) {
  105.             actor = $gameParty.battleMembers()[index];
  106.             if (!actor) { continue; }
  107.             type = actor.patb_type();
  108.             if (!actor.patb_val_change[type]) { continue; }
  109.             rect = this.gaugeAreaRect(index);
  110.             this.draw_actor_patb(actor, rect.x + ox, rect.y, type);
  111.             actor.patb_val_change[type] = false;
  112.         }
  113.     }; // Window_BattleStatus.prototype.refresh_patb_bars
  114.  
  115. })(DoubleX_RMMV.Dynamic_Settings_Compatibility['PATB Core'] = {});
  116.  
  117. }
  118.  
  119. /*----------------------------------------------------------------------------*/
  120.  
  121. } else {
  122.     alert('Place Dynamic Settings Compatibility below Dynamic Settings.');
  123. } // if (DoubleX_RMMV['Dynamic Settings'])
  124.  
  125. /*============================================================================*/
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement