Advertisement
Double_X

DoubleX RMMV Status Bars v101b

Sep 16th, 2016 (edited)
1,679
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 Status Bars
  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.  *      Abilities:
  20.  *      1. Nothing special for most rudimetary use cases
  21.  *      2. Little RMMV plugin development proficiency for most ordinary uses
  22.  *      3. Some RMMV plugin development proficiency to fully utilize this
  23.  *----------------------------------------------------------------------------
  24.  *    # Links
  25.  *      This plugin:
  26.  *      1. http://pastebin.com/5BMvWPbu
  27.  *      Video:
  28.  *      1. https://www.youtube.com/watch?v=kaGhzueQwUs
  29.  *      Mentioned Patreon Supporters:
  30.  *      https://www.patreon.com/posts/71738797
  31.  *----------------------------------------------------------------------------
  32.  *    # Author
  33.  *      DoubleX
  34.  *----------------------------------------------------------------------------
  35.  *    # Changelog
  36.  *      v1.01b(GMT 1200 7-7-2019):
  37.  *      1. Fixed the invisible status bars not being able to be visible again
  38.  *      2. Fixed the equips, classes and actors status bar data not being used
  39.  *      v1.01a(GMT 1400 12-8-2017):
  40.  *      1. Lets you set the status bars to show the stat change processes via
  41.  *         showProc, procUpdateRate, procColor1 and procColor2 in SBX
  42.  *      2. Fixed crashes for status bars having the same minimum and maximum
  43.  *      v1.00a(GMT 1700 16-9-2016):
  44.  *      1. 1st version of this plugin finished
  45.  *============================================================================*/
  46. /*:
  47.  * @plugindesc Lets you use bars to show battler statuses on their sprites
  48.  * @author DoubleX
  49.  *
  50.  * @param isEnabled
  51.  * @desc Sets whether this plugin will be enabled
  52.  *       It'll be stored as a boolean, and will be regarded as true if and only
  53.  *       if it's true
  54.  *       Don't change this during the same battle unless you really know what
  55.  *       you're truly foing
  56.  *       E.g.: Setting isEnabled as false will disable this plugin
  57.  * @default true
  58.  *
  59.  * @help
  60.  * You're supposed to open this plugin js file to edit its configurations
  61.  * The default plugin file name is DoubleX RMMV Status Bars v101b
  62.  * If you want to change that, you must edit the value of
  63.  * DoubleX_RMMV.Status_Bars_File, which must be done via opening this plugin
  64.  * js file directly
  65.  *============================================================================
  66.  *    ## Notetag Info
  67.  *----------------------------------------------------------------------------
  68.  *    # Actor/Class/Weapon/Armor/Enemy/State Notetags:
  69.  *      State notetags take the highest priority, followed by enemy, weapon,
  70.  *      armor, class and actor
  71.  *      1. <status status bar: SBX>
  72.  *         - Sets the battler to setup a status bar of status using
  73.  *           configurations set in function name SBX, which can only be edited
  74.  *           in this plugin js file directly
  75.  *         - status must be included in STATUSES, which can only be edited in
  76.  *           this plugin js file directly
  77.  *         - E.g.:
  78.  *           <hp status bar: HP> will set the battler to setup a hp status bar
  79.  *           using configurations set in HP, which can only be edited in this
  80.  *           plugin js file directly
  81.  *         - Only the 1st effective notetag among all having the same status
  82.  *           will be used(Reference tag: NOTETAG_MONO)
  83.  *============================================================================
  84.  *    ## Plugin Call Info
  85.  *----------------------------------------------------------------------------
  86.  *    # Configuration manipulations
  87.  *      1. $gameSystem.statusBars.param
  88.  *         - Returns the stored value of param listed in the plugin manager
  89.  *         - E.g.:
  90.  *           $gameSystem.statusBars.isEnabled will return a Boolean indicating
  91.  *           whether this plugin's enabled
  92.  *      2. $gameSystem.statusBars.param = val
  93.  *         - Sets the stored value of param listed in plugin manager as val
  94.  *         - E.g.:
  95.  *           $gameSystem.statusBars.isEnabled = false will set the stored
  96.  *           value of parameter isEnabled shown on the plugin manager as false
  97.  *         - All $gameSystem.statusBars.param changes will be saved
  98.  *    # Actor/Class/Weapon/Armor/Enemy/State notetag manipulations
  99.  *      1. meta.statusBars[status]
  100.  *         - Returns the function name SBX for String status specified in
  101.  *           <status status bar: SBX> if there's any
  102.  *         - E.g.:
  103.  *           $dataStates[1].meta.statusBars[hp] will return the function SBX
  104.  *           specified in <hp status bar: SBX> notetag of state with id 1
  105.  *      2. meta.statusBars[status] = SBX
  106.  *         - Sets the String status in <status status bar: SBX> notetag to use
  107.  *           the function with name SBX which is a String
  108.  *         - E.g.:
  109.  *           $dataEnemies[2].meta.statusBars['mp'] = 'MP' will set the SBX
  110.  *           specified in <mp status bar: SBX> notetag of enemy with id 2 as
  111.  *           MP
  112.  *         - All meta.statusBars changes can be saved if
  113.  *           DoubleX RMMV Dynamic Data is used
  114.  *    # Battler manipulations
  115.  *      1. isStatusBarChanged[status] = true
  116.  *         - Notifys the status status bar of the battler to use a new
  117.  *           configuration object
  118.  *         - It'll be reset as false once a new configuration object's used
  119.  *         - E.g.:
  120.  *           $gameParty.aliveMembers()[0].isStatusBarChanged['tp'] = true will
  121.  *           notify the tp status bar of the battler to use a new
  122.  *           configuration object
  123.  *    # Status bar manipulations
  124.  *      1. new Window_Status_Bar(battler, status)
  125.  *         - Creates a new status bar showing the status status of battler
  126.  *           battler
  127.  *         - E.g.:
  128.  *           new Window_Status_Bar($gameTroop.aliveMembers()[0], 'hp') will
  129.  *           create a new status bar showing the hp status of the 1st troop
  130.  *           member
  131.  *============================================================================
  132.  */
  133.  
  134. var DoubleX_RMMV = DoubleX_RMMV || {};
  135. DoubleX_RMMV['Status Bars'] = 'v1.01b';
  136.  
  137. // The plugin file name must be the same as DoubleX_RMMV.Status_Bars_File
  138. DoubleX_RMMV.Status_Bars_File = 'DoubleX RMMV Status Bars v101b';
  139.  
  140. /*============================================================================
  141.  *    ## Plugin Configurations
  142.  *       You only need to edit this part as it's about what this plugin does
  143.  *----------------------------------------------------------------------------*/
  144.  
  145. DoubleX_RMMV.Status_Bars = {
  146.  
  147.     /* Setups the list of statuses that can have their status bars drawn
  148.      * Each status must be represented by the name of its battler getter
  149.      */
  150.     STATUSES: [
  151.         'hp',
  152.         'mp',
  153.         'tp'
  154.     ],
  155.  
  156.     /*------------------------------------------------------------------------
  157.      *    Status Bar Functions
  158.      *    - Setups SBX used by <status bar: SBX>
  159.      *------------------------------------------------------------------------*/
  160.     /* SBX are used by Window_Status_Bar at this._cfg = SB[this._cfgName](); in
  161.      * _updateCfg
  162.      * SBX are Javascript functions which must return an Object having at least
  163.      * the following:
  164.      * {
  165.      *     visible: function(battler), // Hotspot
  166.      *     opacity: function(battler), // Hotspot
  167.      *     backColor: function(battler), // Hotspot
  168.      *     color1: function(battler), // Hotspot
  169.      *     color2: function(battler), // Hotspot
  170.      *     x: function(battler), // Hotspot
  171.      *     y: function(battler), // Hotspot
  172.      *     w: function(battler), // Hotspot
  173.      *     h, function(battler), // Hotspot
  174.      *     text, function(battler), // Hotspot
  175.      *     textX: function(battler), // Hotspot
  176.      *     textY: function(battler), // Hotspot
  177.      *     textSize: function(battler), // Hotspot
  178.      *     textColor: function(battler), // Hotspot
  179.      *     min: function(battler), // Hotspot
  180.      *     max: function(battler), // Hotspot
  181.      *     (v1.01a+)showProc: function(battler), // Hotspot
  182.      *     (v1.01a+)procUpdateRate: function(battler) // Hotspot
  183.      * }
  184.      * All functions will be bound to the Window_Status_Bar upon its creation
  185.      * and must take the battler and database item using the SBX as their
  186.      * arguments
  187.      *
  188.      * Status bar configuration functions:
  189.      * The function result of visible, which is the status bar visibility, will
  190.      * be interpreted as truthy or falsy only
  191.      * The function of opacity, which is the status bar opacity, must return a
  192.      * Number between 0 and 255
  193.      * The functions of backColor, color1 and color2, which are the status bar
  194.      * back, 1st and 2nd colors respectively, must return a Number between
  195.      * #00000000 and #FFFFFFFF
  196.      * The functions of x and y, which are the status bar x and y offsets from
  197.      * the battler sprites respectively, must return a Number
  198.      * The functions of w and h, which are the status bar width and height
  199.      * respectively, must return a positive Number
  200.      * The function of text, which is the status bar description text, must
  201.      * return a String
  202.      * The functions of textX, textY and textSize, which are the status bar
  203.      * description text x and y offset from the status bar, and size
  204.      * respectively, must return a positive Number
  205.      * The functions of min and max, which are the minimum and maximum value of
  206.      * the status respiectively, must return a Number that must be not greater
  207.      * than and not less than all the possible values of the current value
  208.      * respectively
  209.      * (v1.01a+)The functions of showProc, which is whether the stat change
  210.      * processes will be shown on the status bars, will be interpreted as truthy
  211.      * or falsy only
  212.      * (v1.01a+)The functions of procUpdateRate, which is the rate relative to
  213.      * the max length of the stat bar per second, must return a Number between 0
  214.      * and 1
  215.      * (v1.01a+)The functions of procColor1 and procColor2, which are the status
  216.      * bar 1st and 2nd stat change colors respectively, must return a Number
  217.      * between #00000000 and #FFFFFFFF
  218.      *
  219.      * SBX names can only use alphanumeric characters
  220.      * The below SBX are examples added to help you set your SBX
  221.      * You can freely use, rewrite and/or delete these examples
  222.      *
  223.      * Advanced:
  224.      * The status bar prototype's inherited from Window_Base.prototype
  225.      * All status bar configuration functions are used by Window_Status_Bar
  226.      * visible and opacity are used in _updateBarVisibility
  227.      * backColor, color1, color2, textColor, text, textX and textY are used in
  228.      * _updateSetting
  229.      * x, y, w and h are used in initialize
  230.      * x is also used in _updateX
  231.      * y is also used in _updateY
  232.      * w is also used in _updateW
  233.      * h is also used in _updateH
  234.      * min and max are used in _updateFillW
  235.      * (v1.01a+)showProc
  236.      */
  237.  
  238.     // Sets the status bar to display the battler's hp statuses
  239.     HP: function() { // v1.00a - v1.01a; Potential Hotspot
  240.         return {
  241.             // Sets the hp bar to be always visible only for alive battlers
  242.             visible: function(battler) { return battler.isAlive(); }, // Hotspot
  243.             // Sets the hp bar opacity to be always 255
  244.             opacity: function(battler) { return 255; }, // Hotspot
  245.             // Sets the hp bar color 1 to be always text color 15
  246.             backColor: function(battler) { // Hotspot
  247.                 return this.textColor(15);
  248.             },
  249.             // Sets the hp bar color 1 to be always text color 20
  250.             color1: function(battler) { return this.textColor(20); }, // Hotspot
  251.             // Sets the hp bar color 2 to be always text color 21
  252.             color2: function(battler) { return this.textColor(21); }, // Hotspot
  253.             // Sets the hp bar x offset from battler sprite to be always 0
  254.             x: function(battler) { return 0; }, // Hotspot
  255.             // Sets the hp bar y offset from battler sprite to be always 16
  256.             y: function(battler) { return 16; }, // Hotspot
  257.             // Sets the hp bar width to be always 87
  258.             w: function(battler) { return 87; }, // Hotspot
  259.             // Sets the hp bar height to be always 16
  260.             h: function(battler) { return 16; }, // Hotspot
  261.             // Sets the hp bar description text to be always hp/mhp
  262.             text: function(battler) { // Hotspot
  263.                 return battler.hp.toString() + '/' + battler.mhp.toString();
  264.             },
  265.             // Sets the hp bar description text size to be always 0
  266.             textX: function(battler) { return 0; }, // Hotspot
  267.             // Sets the hp bar description text size to be always 0
  268.             textY: function(battler) { return 0; }, // Hotspot
  269.             // Sets the hp bar description text size to be always 13
  270.             textSize: function(battler) { return 13; }, // Hotspot
  271.             // Sets hp bar description text color to be always text color 0
  272.             textColor: function(battler) { // Hotspot
  273.                 return this.textColor(0);
  274.             },
  275.             // Sets the minimum hp to be shown on the hp bar to be always 0
  276.             min: function(battler) { return 0; }, // Hotspot
  277.             // Sets the maximum hp to be shown on the hp bar to be always mhp
  278.             max: function(battler) { return battler.mhp; }, // Hotspot
  279.             // (v1.01a+)Sets the hp change processes to be always shown
  280.             showProc: function(battler) { return true; }, // Hotspot
  281.             // (v1.01a+)Sets the hp change processes rate to be 100% of the
  282.             // max length of the hp bar per second
  283.             procUpdateRate: function(battler) { return 0.2; }, // Hotspot
  284.             // Sets the hp change process color 1 to be always text color 6
  285.             procColor1: function(battler) { return this.textColor(6); },
  286.             // Hotspot
  287.             // Sets the hp change process color 2 to be always text color 17
  288.             procColor2: function(battler) { return this.textColor(17); }
  289.             // Hotspot
  290.         };
  291.     },
  292.  
  293.     // Sets the status bar to display the battler's mp statuses
  294.     MP: function() { // v1.00a - v1.01a; Potential Hotspot
  295.         return {
  296.             // Sets the mp bar to be always visible only for alive battlers
  297.             visible: function(battler) { return battler.isAlive(); }, // Hotspot
  298.             // Sets the mp bar opacity to be always 255
  299.             opacity: function(battler) { return 255; }, // Hotspot
  300.             // Sets the mp bar color 1 to be always text color 15
  301.             backColor: function(battler) { // Hotspot
  302.                 return this.textColor(15);
  303.             },
  304.             // Sets the mp bar color 1 to be always text color 22
  305.             color1: function(battler) { return this.textColor(22); }, // Hotspot
  306.             // Sets the mp bar color 2 to be always text color 23
  307.             color2: function(battler) { return this.textColor(23); }, // Hotspot
  308.             // Sets the mp bar x offset from battler sprite to be always 0
  309.             x: function(battler) { return 0; }, // Hotspot
  310.             // Sets the mp bar y offset from battler sprite to be always 32
  311.             y: function(battler) { return 32; }, // Hotspot
  312.             // Sets the mp bar width to be always 87
  313.             w: function(battler) { return 87; }, // Hotspot
  314.             // Sets the mp bar height to be always 16
  315.             h: function(battler) { return 16; }, // Hotspot
  316.             // Sets the mp bar description text to be always mp/mmp
  317.             text: function(battler) { // Hotspot
  318.                 return battler.mp.toString() + '/' + battler.mmp.toString();
  319.             },
  320.             // Sets the mp bar description text size to be always 0
  321.             textX: function(battler) { return 0; }, // Hotspot
  322.             // Sets the mp bar description text size to be always 0
  323.             textY: function(battler) { return 0; }, // Hotspot
  324.             // Sets the mp bar description text size to be always 13
  325.             textSize: function(battler) { return 13; }, // Hotspot
  326.             // Sets mp bar description text color to be always text color 0
  327.             textColor: function(battler) { // Hotspot
  328.                 return this.textColor(0);
  329.             },
  330.             // Sets the minimum mp to be shown on the hp bar to be always 0
  331.             min: function(battler) { return 0; }, // Hotspot
  332.             // Sets the maximum mp to be shown on the hp bar to be always mmp
  333.             max: function(battler) { return battler.mmp; }, // Hotspot
  334.             // (v1.01a+)Sets the mp change processes to be always shown
  335.             showProc: function(battler) { return true; }, // Hotspot
  336.             // (v1.01a+)Sets the mp change processes rate to be 100% of the
  337.             // max length of the mp bar per second
  338.             procUpdateRate: function(battler) { return 0.2; }, // Hotspot
  339.             // Sets the mp change process color 1 to be always text color 1
  340.             procColor1: function(battler) { return this.textColor(1); },
  341.             // Hotspot
  342.             // Sets the mp change process color 2 to be always text color 4
  343.             procColor2: function(battler) { return this.textColor(4); }
  344.             // Hotspot
  345.         };
  346.     },
  347.  
  348.     // Sets the status bar to display the battler's tp statuses
  349.     TP: function() { // v1.00a - v1.01a; Potential Hotspot
  350.         return {
  351.             // Sets the tp bar to be always visible
  352.             visible: function(battler) { return battler.isAlive(); }, // Hotspot
  353.             // Sets the tp bar opacity to be always 255
  354.             opacity: function(battler) { return 255; }, // Hotspot
  355.             // Sets the tp bar color 1 to be always text color 15
  356.             backColor: function(battler) { // Hotspot
  357.                 return this.textColor(15);
  358.             },
  359.             // Sets the tp bar color 1 to be always text color 28
  360.             color1: function(battler) { return this.textColor(28); }, // Hotspot
  361.             // Sets the tp bar color 2 to be always text color 29
  362.             color2: function(battler) { return this.textColor(29); }, // Hotspot
  363.             // Sets the tp bar x offset from battler sprite to be always 0
  364.             x: function(battler) { return 0; }, // Hotspot
  365.             // Sets the tp bar y offset from battler sprite to be always 48
  366.             y: function(battler) { return 48; }, // Hotspot
  367.             // Sets the tp bar width to be always 87
  368.             w: function(battler) { return 87; }, // Hotspot
  369.             // Sets the tp bar height to be always 16
  370.             h: function(battler) { return 16; }, // Hotspot
  371.             // Sets the tp bar description text to be always tp/maxTp()
  372.             text: function(battler) { // Hotspot
  373.                 return battler.tp.toString() + '/' + battler.maxTp().toString();
  374.             },
  375.             // Sets the tp bar description text size to be always 0
  376.             textX: function(battler) { return 0; }, // Hotspot
  377.             // Sets the tp bar description text size to be always 0
  378.             textY: function(battler) { return 0; }, // Hotspot
  379.             // Sets the tp bar description text size to be always 13
  380.             textSize: function(battler) { return 13; }, // Hotspot
  381.             // Sets tp bar description text color to be always text color 0
  382.             textColor: function(battler) { // Hotspot
  383.                 return this.textColor(0);
  384.             },
  385.             // Sets the minimum tp to be shown on the hp bar to be always 0
  386.             min: function(battler) { return 0; }, // Hotspot
  387.             // Sets maximum tp to be shown on the hp bar to be always maxTp()
  388.             max: function(battler) { return battler.maxTp(); }, // Hotspot
  389.             // (v1.01a+)Sets the tp change processes to be always shown
  390.             showProc: function(battler) { return true; }, // Hotspot
  391.             // (v1.01a+)Sets the mp change processes rate to be 100% of the
  392.             // max length of the mp bar per second
  393.             procUpdateRate: function(battler) { return 0.2; }, // Hotspot
  394.             // Sets the tp change process color 1 to be always text color 3
  395.             procColor1: function(battler) { return this.textColor(3); },
  396.             // Hotspot
  397.             // Sets the tp change process color 2 to be always text color 24
  398.             procColor2: function(battler) { return this.textColor(24); }
  399.             // Hotspot
  400.         };
  401.     },
  402.  
  403.     // Adds new SBX here
  404.  
  405.  
  406. }; // DoubleX_RMMV.Status_Bars
  407.  
  408. /*============================================================================
  409.  *    ## Plugin Implementations
  410.  *       You need not edit this part as it's about how this plugin works
  411.  *----------------------------------------------------------------------------
  412.  *    # Plugin Support Info:
  413.  *      1. Prerequisites
  414.  *         - Decent RMMV plugin development proficiency to fully comprehend
  415.  *           this
  416.  *----------------------------------------------------------------------------*/
  417.  
  418. DoubleX_RMMV.Is_Status_Bar_Notes_Loaded = false; // v1.00a - v1.00a
  419.  
  420. DoubleX_RMMV.Status_Bars_Params = { // v1.00a - v1.00a
  421.  
  422.     isEnabled: 'Boolean', // Marks that isEnabled is a Boolean
  423.  
  424.     /* Checks whether the passed configuration value's truthy or falsy
  425.      * Functional cohesion/Data coupling/Referentially transperant
  426.      * (String)param: The param to have its boolean value checked
  427.      * Return: The boolean value of the param
  428.      */
  429.     Boolean: function(param) { return param === 'true'; }
  430.  
  431. }; // DoubleX_RMMV.Status_Bars_Params
  432.  
  433. function Window_Status_Bar() { this.initialize.apply(this, arguments); }
  434.  
  435. (function(SB) {
  436.  
  437.     'use strict';
  438.  
  439.     SB.DataManager = {};
  440.     var DM = SB.DataManager;
  441.  
  442.     DM.isDatabaseLoaded = DataManager.isDatabaseLoaded;
  443.     DataManager.isDatabaseLoaded = function() { // v1.00a - v1.00a; Extended
  444.         // Rewritten to read all notetags of this plugin as well
  445.         return DM.isDatabaseLoaded.apply(this, arguments) && DM._loadAllNotes();
  446.         //
  447.     }; // DataManager.isDatabaseLoaded
  448.  
  449.     /* Reads all notetags of this plugin from the database
  450.      * Return: True
  451.      * Functional cohesion/Message coupling/Idempotent
  452.      */
  453.     DM._loadAllNotes = function() { // v1.00a - v1.00a; New
  454.         // Ensures the notetags will only be read exactly once upon game start
  455.         if (DoubleX_RMMV.Is_Status_Bar_Notes_Loaded) return true;
  456.         var types = [$dataActors, $dataClasses, $dataWeapons, $dataArmors];
  457.         types.concat([$dataEnemies, $dataStates]).forEach(function(type) {
  458.             type.forEach(function(data) { if (data) DM._loadNotes(data); });
  459.         });
  460.         DoubleX_RMMV.Is_Status_Bar_Notes_Loaded = true;
  461.         //
  462.         return true;
  463.     }; // DM._loadAllNotes
  464.  
  465.     /* Reads all notetags of this plugin from a dataum of the database
  466.      * (Object)datum: The datum to have its notetags of this plugin read
  467.      * Functional cohesion/Data coupling/Idempotent
  468.      */
  469.     DM._loadNotes = function(datum) { // v1.00a - v1.00a; New
  470.         var statusBars = datum.meta.statusBars = {}; // Plugin call
  471.         var regExp = /< *(\w+) +status +bar *: *(\w+) *>/i, status;
  472.         // Refer to reference tag NOTETAG_MONO
  473.         datum.note.split(/[\r\n]+/).forEach(function(line) {
  474.             if (!line.match(regExp)) return;
  475.             status = RegExp.$1;
  476.             statusBars[status] = statusBars[status] || RegExp.$2;
  477.         });
  478.         //
  479.     }; // DM._loadNotes
  480.  
  481.     SB.Game_System = {};
  482.     var GS = SB.Game_System;
  483.  
  484.     /*------------------------------------------------------------------------
  485.      *    New public instance variable
  486.      *------------------------------------------------------------------------*/
  487.     // (Plugin call)The container of all parameters shown on the plugin manger
  488.     Object.defineProperty(Game_System.prototype, "statusBars", {
  489.         get: function() { /* Hotspot */ return this._statusBars; },
  490.         configurable: true
  491.     });
  492.  
  493.     GS.initialize = Game_System.prototype.initialize;
  494.     Game_System.prototype.initialize = function() { // v1.00a - v1.00a; Extended
  495.         GS.initialize.apply(this, arguments);
  496.         GS._initializeStatusBars.call(this); // Added to setup configurations
  497.     }; // Game_System.prototype.initialize
  498.  
  499.     /* Initializes all parameters of this plugin shown on the plugin manager
  500.      * Functional cohesion/Message coupling/Idempotent
  501.      */
  502.     GS._initializeStatusBars = function() { // v1.00a - v1.00a; New
  503.         this._statusBars = {};
  504.         var params = PluginManager.parameters(DoubleX_RMMV.Status_Bars_File);
  505.         var SBP = DoubleX_RMMV.Status_Bars_Params;
  506.         // Lets parameters to use their strategies to have their desired formats
  507.         Object.keys(params).forEach(function(param) {
  508.             this._statusBars[param] = SBP[SBP[param]](params[param]);
  509.         }, this);
  510.         //
  511.     }; // GS._initializeStatusBars
  512.  
  513.     SB.Game_BattlerBase = {};
  514.     var GBB = SB.Game_BattlerBase;
  515.  
  516.     /*------------------------------------------------------------------------
  517.      *    New public instance variable
  518.      *------------------------------------------------------------------------*/
  519.     // (Plugin call only)Container of all status bar change notification flags
  520.     Object.defineProperty(Game_BattlerBase.prototype, "isStatusBarChanged", {
  521.         get: function() { /* Hotspot */ return this._isStatusBarChanged; },
  522.         configurable: true
  523.     });
  524.  
  525.     /*------------------------------------------------------------------------
  526.      *    New private instance variable
  527.      *------------------------------------------------------------------------*/
  528.     // _statusBars: The container of all status bar configurations
  529.  
  530.     GBB.initMembers = Game_BattlerBase.prototype.initMembers;
  531.     Game_BattlerBase.prototype.initMembers = function() {
  532.     // v1.00a - v1.00a; Extended
  533.         GBB._initStatusBarChanges.call(this); // Added
  534.         GBB.initMembers.apply(this, arguments);
  535.     }; // Game_BattlerBase.prototype.initMembers
  536.  
  537.     GBB.refresh = Game_BattlerBase.prototype.refresh;
  538.     Game_BattlerBase.prototype.refresh = function() {
  539.     // v1.00a - v1.00a; Extended
  540.         GBB.refresh.apply(this, arguments);
  541.         // Added to notify that the status bar configurations might be changed
  542.         if (!$gameSystem.statusBars.isEnabled) return;
  543.         GBB._notifyStatusBarChanges.call(this);
  544.         //
  545.     }; // Game_BattlerBase.prototype.refresh
  546.  
  547.     /* Setups the change notification flags of all statuses for this battler
  548.      * Functional cohesion/Message coupling/Idempotent
  549.      */
  550.     GBB._initStatusBarChanges = function() { // v1.00a - v1.00a; New
  551.         this._statusBars = {};
  552.         this._isStatusBarChanged = {};
  553.         SB.STATUSES.forEach(function(status) {
  554.             this._isStatusBarChanged[status] = true;
  555.         }, this);
  556.     }; // GBB._initStatusBarChanges
  557.  
  558.     /* Marks that a new status bar configuration might need to be used
  559.      * Functional cohesion/Message coupling/Idempotent
  560.      */
  561.     GBB._notifyStatusBarChanges = function() { // v1.00a - v1.00a; New
  562.         // Raises the change notification flags of all statuses for this battler
  563.         Object.keys(this._isStatusBarChanged).forEach(function(status) {
  564.             this._isStatusBarChanged[status] = true;
  565.         }, this);
  566.         //
  567.     }; // GBB._notifyStatusBarChanges
  568.  
  569.     /* Returns the latest status bar configuration object for the given status
  570.      * Sequential cohesion/Data coupling/Idempotent
  571.      * (String)status: The battler status shown by the status bar
  572.      * Return(Object): The status bar configuration object for the given status
  573.      */
  574.     GBB.statusBarCfg = function(status) { // v1.00a - v1.00a; New; Hotspot
  575.         // Setups a new status bar configuration only when it might be needed
  576.         if (!this._statusBars[status] || this._isStatusBarChanged[status]) {
  577.             this._isStatusBarChanged[status] = false;
  578.             this._statusBars[status] = GBB._newStatusBarCfg.call(this, status);
  579.         }
  580.         //
  581.         return this._statusBars[status];
  582.     }; // GBB.statusBarCfg
  583.  
  584.     /* Returns a new status bar configuration object for the given status
  585.      * Functional cohesion/Data coupling/Referentially transperant
  586.      * (String)status: The battler status shown by the status bar
  587.      * Return(Object): A new status bar configuration object for the status
  588.      */
  589.     GBB._newStatusBarCfg = function(status) {
  590.     // v1.00a - v1.00a; New; Potential Hotspot
  591.         // Refer to reference tag NOTETAG_MONO
  592.         var datum = this._statusBarData().filter(function(data) {
  593.             return data.meta.statusBars[status];
  594.         })[0];
  595.         return datum ? datum.meta.statusBars[status] : '';
  596.         //
  597.     }; // GBB._newStatusBarCfg
  598.  
  599.     /* Returns all database items that might have status bar configuration notes
  600.      * Functional cohesion/Message coupling/Referentially transperant
  601.      * Return(Array): An array of database item used by this battler
  602.      */
  603.     GBB._statusBarData = function() { // v1.00a - v1.00a; New; Potential Hotspot
  604.         return this.states(); // Game_BattlerBase is abstract so GBB can be used
  605.     }; // GBB._statusBarData
  606.  
  607.     /* Returns all database items that might have status bar configuration notes
  608.      * Functional cohesion/Message coupling/Referentially transperant
  609.      * Return(Array): An array of database item used by this actor
  610.      */
  611.     Game_Actor.prototype._statusBarData = function() {
  612.     // v1.00a - v1.00a; New; Potential Hotspot
  613.         // Use polymorphism at the cost of not using GA
  614.         var data = GBB._statusBarData.call(this);
  615.         return data.concat(this.equips().filter(function(equip) {
  616.             return equip;
  617.         })).concat([this.currentClass(), this.actor()]);
  618.         //
  619.     }; // Game_Actor.prototype._statusBarData
  620.  
  621.     /* Returns all database items that might have status bar configuration notes
  622.      * Functional cohesion/Message coupling/Referentially transperant
  623.      * Return(Array): An array of database item used by this enemy
  624.      */
  625.     Game_Enemy.prototype._statusBarData = function() {
  626.     // v1.00a - v1.00a; New; Potential Hotspot
  627.         // Use polymorphism at the cost of not using GE
  628.         return GBB._statusBarData.call(this).concat([this.enemy()]);
  629.         //
  630.     }; // Game_Enemy.prototype._statusBarData
  631.  
  632.     SB.Sprite_Battler = {};
  633.     var SBSB = SB.Sprite_Battler;
  634.  
  635.     /*------------------------------------------------------------------------
  636.      *    New private instance variable
  637.      *------------------------------------------------------------------------*/
  638.     // _statusBars: The container of all status bars for the battler
  639.  
  640.     SBSB.setBattler = Sprite_Battler.prototype.setBattler;
  641.     Sprite_Battler.prototype.setBattler = function(battler) {
  642.     // 1.00a - v1.00a; Extended; Hotspot
  643.         // Added to reconfigure the status bars upon battler change
  644.         var change = battler !== this._battler;
  645.         //
  646.         SBSB.setBattler.apply(this, arguments);
  647.         // Added
  648.         if (!$gameSystem.statusBars.isEnabled || !battler || !change) return;
  649.         if (!this._statusBars) return SBSB._initStatusBars.call(this);
  650.         SBSB._setStatusBarBattlers.call(this);
  651.         //
  652.     }; // Sprite_Battler.prototype.setBattler
  653.  
  654.     /* Setups all status bars for this battler
  655.      * Functional cohesion/Message coupling/Idempotent
  656.      */
  657.     SBSB._initStatusBars = function() { // v1.00a - v1.00a; New
  658.         this._statusBars = {};
  659.         SB.STATUSES.forEach(function(status) {
  660.             this._statusBars[status] =
  661.                     new Window_Status_Bar(this._battler, status);
  662.             this.addChild(this._statusBars[status]);
  663.         }, this);
  664.     }; // SBSB._initStatusBars
  665.  
  666.     /* Updates the owner info stored in all status bars
  667.      * Functional cohesion/Message coupling/Idempotent
  668.      */
  669.     SBSB._setStatusBarBattlers = function() { // v1.00a - v1.00a; New
  670.         SB.STATUSES.forEach(function(status) {
  671.             this._statusBars[status].battler = this._battler;
  672.         }, this);
  673.     }; // SBSB._setStatusBarBattlers
  674.  
  675.     /*------------------------------------------------------------------------
  676.      *    # New class: Window_Status_Bar
  677.      *------------------------------------------------------------------------*/
  678.  
  679.     Window_Status_Bar.prototype = Object.create(Window_Base.prototype);
  680.     Window_Status_Bar.prototype.constructor = Window_Status_Bar;
  681.  
  682.     /*------------------------------------------------------------------------
  683.      *    New public instance variable
  684.      *------------------------------------------------------------------------*/
  685.     // battler: The battler owning this status bar
  686.     Object.defineProperty(Window_Status_Bar.prototype, "battler", {
  687.         set: function() { /* Hotspot */ return this._battler; },
  688.         configurable: true
  689.     });
  690.  
  691.     /*------------------------------------------------------------------------
  692.      *    New private instance variables
  693.      *------------------------------------------------------------------------*/
  694.     /* _backColor: The back color of this status bar
  695.      * _cfgName: The name of the configuration object used by this status bar
  696.      * _cfg: The configuration object used by this status bar
  697.      * _color1: The 1st color of this status bar
  698.      * _color2: The 2nd color of this status bar
  699.      * _fillW: The width of the filled portion of the status bar
  700.      * _isRedraw: The flag indicating whether the status bar needs to be redrawn
  701.      * (v1.01a+)_procFillW: The width of the stat change process bar
  702.      * _status: The battler status shown by this status bar
  703.      * _text: The status bar description text
  704.      * _textColor: The color of the status bar description text
  705.      * _textX: The x offset of the status bar description text from this bar
  706.      * _textY: The y offset of the status bar description text from this bar
  707.      */
  708.  
  709.     Window_Status_Bar.prototype.initialize = function(battler, status) {
  710.     // v1.00a - v1.00a
  711.         this._battler = battler;
  712.         this._status = status;
  713.         this._updateCfg(battler, status);
  714.         if (this._cfg) {
  715.             Window_Base.prototype.initialize.call(this, this._cfg.x(battler),
  716.             this._cfg.y(battler), this._cfg.w(battler), this._cfg.h(battler));
  717.         } else {
  718.             Window_Base.prototype.initialize.call(this, 0, 0, 0, 0);
  719.         }
  720.         this.opacity = 0; // Only the status bar needs to be shown
  721.     }; // Window_Status_Bar.prototype.initialize
  722.  
  723.     Window_Status_Bar.prototype.standardFontSize = function() {
  724.     // v1.00a - v1.00a; Hotspot
  725.         if (this._cfg) return this._cfg.textSize(this._battler);
  726.         return Window_Base.prototype.standardFontSize.call(this);
  727.     }; // Window_Status_Bar.prototype.standardFontSize
  728.  
  729.     Window_Status_Bar.prototype.standardPadding = function() {
  730.     // v1.00a - v1.00a; Hotspot
  731.         // The whole window is just the statu bar
  732.         return this._cfg ? 0 : Window_Base.prototype.standardPadding.call(this);
  733.         //
  734.     }; // Window_Status_Bar.prototype.standardPadding
  735.  
  736.     Window_Status_Bar.prototype.resetFontSettings = function() {
  737.     // v1.00a - v1.00a; Hotspot
  738.         if (this.contents.fontSize === this.standardFontSize()) return;
  739.         Window_Base.prototype.resetFontSettings.call(this);
  740.         this._isRedraw = true;
  741.     }; // Window_Status_Bar.prototype.resetFontSettings
  742.  
  743.     Window_Status_Bar.prototype.update = function() {
  744.     // v1.00a - v1.00a; Hotspot
  745.         Window_Base.prototype.update.call(this);
  746.         this._updateBarStatuses(this._battler);
  747.     }; // Window_Status_Bar.prototype.update
  748.  
  749.     /* Updates all statuses of this status bar
  750.      * Sequential cohesion/Data coupling
  751.      * (Game_Battler)battler: The battler owning this bar
  752.      */
  753.     Window_Status_Bar.prototype._updateBarStatuses = function(battler) {
  754.     // v1.00a - v1.00a; Hotspot
  755.         if (!battler) return this.visible = false;
  756.         this._updateCfg(battler, this._status);
  757.         this._updateBarVisibility(battler, this._cfg);
  758.         if (!this.visible || this.contentsOpacity <= 0) return;
  759.         this._updateDimensions(battler, this._cfg, this._status);
  760.         if (!this.visible) return;
  761.         this._updateColorText(battler, this._cfg);
  762.         if (!this.visible || !this._isRedraw) return;
  763.         this._isRedraw = false;
  764.         this._redraw(battler, this._cfg);
  765.     }; // Window_Status_Bar.prototype._updateBarStatuses
  766.  
  767.     /* Updates all configurations used by this status bar
  768.      * Functional cohesion/Data coupling
  769.      * (Game_Battler)battler: The battler owning this bar
  770.      * (String)status: The battler status shown by this status bar
  771.      */
  772.     Window_Status_Bar.prototype._updateCfg = function(battler, status) {
  773.     // v1.00a - v1.00a; Hotspot
  774.         if (!battler) return;
  775.         var lastCfgName = this._cfgName;
  776.         this._cfgName = GBB.statusBarCfg.call(battler, status);
  777.         if (lastCfgName === this._cfgName) return;
  778.         if (this._cfgName.length <= 0) return this._cfg = null;
  779.         this._cfg = SB[this._cfgName]();
  780.         Object.keys(this._cfg).forEach(function(cfg) {
  781.             this._cfg[cfg] = this._cfg[cfg].bind(this);
  782.         }, this);
  783.     }; // Window_Status_Bar.prototype._updateCfg
  784.  
  785.     /* Updates all visibility settings used by this status bar
  786.      * Functional cohesion/Data coupling
  787.      * (Game_Battler)battler: The battler owning this bar
  788.      * (Object)cfg: The configuration object used by this status bar
  789.      */
  790.     Window_Status_Bar.prototype._updateBarVisibility = function(battler, cfg) {
  791.     // v1.00a - v1.01b; Hotspot
  792.         this.visible = battler && cfg && cfg.visible(battler);
  793.         if (this.visible) this.contentsOpacity = cfg.opacity(battler);
  794.     }; // Window_Status_Bar.prototype._updateBarVisibility
  795.  
  796.     /* Updates all dimensional settings of this status bar
  797.      * Sequential cohesion/Data coupling
  798.      * (Game_Battler)battler: The battler owning this bar
  799.      * (Object)cfg: The configuration object used by this status bar
  800.      * (String)status: The battler status shown by this status bar
  801.      */
  802.     Window_Status_Bar.prototype._updateDimensions =
  803.     function(battler, cfg, status) {
  804.     // v1.00a - v1.00a; Hotspot
  805.         this._updateW(battler, cfg);
  806.         this.visible = this.visible && this.width > 0;
  807.         if (!this.visible) return;
  808.         this._updateH(battler, cfg);
  809.         this.visible = this.visible && this.height > 0;
  810.         if (!this.visible) return;
  811.         this._updateX(battler, cfg);
  812.         this._updateY(battler, cfg);
  813.         this._updateFillW(battler, cfg, status);
  814.     }; // Window_Status_Bar.prototype.updateDimensions
  815.  
  816.     /* Updates the width of this status bar and the redraw flag
  817.      * Sequential cohesion/Data coupling
  818.      * (Game_Battler)battler: The battler owning this bar
  819.      * (Object)cfg: The configuration object used by this status bar
  820.      */
  821.     Window_Status_Bar.prototype._updateW = function(battler, cfg) {
  822.     // v1.00a - v1.00a; Hotspot
  823.         var newW = battler && cfg ? cfg.w(battler) : 0;
  824.         if (this.width === newW) return;
  825.         this.width = newW;
  826.         this._isRedraw = true;
  827.     }; // Window_Status_Bar.prototype._updateW
  828.  
  829.     /* Updates the height of this status bar and the redraw flag
  830.      * Sequential cohesion/Data coupling
  831.      * (Game_Battler)battler: The battler owning this bar
  832.      * (Object)cfg: The configuration object used by this status bar
  833.      */
  834.     Window_Status_Bar.prototype._updateH = function(battler, cfg) {
  835.     // v1.00a - v1.00a; Hotspot
  836.         var newH = battler && cfg ? cfg.h(battler) : 0;
  837.         if (this.height === newH) return;
  838.         this.height = newH;
  839.         this._isRedraw = true;
  840.     }; // Window_Status_Bar.prototype._updateH
  841.  
  842.     /* Updates the x offset of this status bar from the battler sprite
  843.      * Functional cohesion/Data coupling
  844.      * (Game_Battler)battler: The battler owning this bar
  845.      * (Object)cfg: The configuration object used by this status bar
  846.      */
  847.     Window_Status_Bar.prototype._updateX = function(battler, cfg) {
  848.     // v1.00a - v1.00a; Hotspot
  849.         if (!battler || !cfg) return;
  850.         var newX = cfg.x(battler);
  851.         if (this.x !== newX) this.x = newX;
  852.     }; // Window_Status_Bar.prototype._updateX
  853.  
  854.     /* Updates the y offset of this status bar from the battler sprite
  855.      * Functional cohesion/Data coupling
  856.      * (Game_Battler)battler: The battler owning this bar
  857.      * (Object)cfg: The configuration object used by this status bar
  858.      */
  859.     Window_Status_Bar.prototype._updateY = function(battler, cfg) {
  860.     // v1.00a - v1.00a; Hotspot
  861.         if (!battler || !cfg) return;
  862.         var newY = cfg.y(battler);
  863.         if (this.y !== newY) this.y = newY;
  864.     }; // Window_Status_Bar.prototype._updateY
  865.  
  866.     /* Updates the fill width of this status bar and the redraw flag
  867.      * Sequential cohesion/Data coupling
  868.      * (Game_Battler)battler: The battler owning this bar
  869.      * (Object)cfg: The configuration object used by this status bar
  870.      * (String)status: The battler status shown by this status bar
  871.      */
  872.     Window_Status_Bar.prototype._updateFillW = function(battler, cfg, status) {
  873.     // v1.00a - v1.01a; Hotspot
  874.         var lastFillW = this._fillW;
  875.         var statusRange = cfg.max(battler) - cfg.min(battler);
  876.         this._fillW = battler && cfg && statusRange > 0 ?
  877.                 this.width * battler[status] / statusRange : 0;
  878.         this._procFillW = this._procFillW || this._fillW;
  879.         this._isRedraw = this._isRedraw || lastFillW !== this._fillW ||
  880.                 this._procFillW !== this._fillW;
  881.     }; // Window_Status_Bar.prototype._updateFillW
  882.  
  883.     /* Updates all color and text settings of this status bar
  884.      * Sequential cohesion/Data coupling
  885.      * (Game_Battler)battler: The battler owning this bar
  886.      * (Object)cfg: The configuration object used by this status bar
  887.      */
  888.     Window_Status_Bar.prototype._updateColorText = function(battler, cfg) {
  889.     // v1.00a - v1.01a; Hotspot
  890.         this._updateSetting(battler, cfg, 'backColor');
  891.         this._updateSetting(battler, cfg, 'color1');
  892.         this._updateSetting(battler, cfg, 'color2');
  893.         this._updateSetting(battler, cfg, 'textColor');
  894.         this._updateSetting(battler, cfg, 'text');
  895.         this.visible = this.visible && !this._isTransperant();
  896.         if (!this.visible) return;
  897.         this._updateSetting(battler, cfg, 'textX');
  898.         this._updateSetting(battler, cfg, 'textY');
  899.         this._updateSetting(battler, cfg, 'procColor1');
  900.         this._updateSetting(battler, cfg, 'procColor2');
  901.     }; // Window_Status_Bar.prototype.updateDimensions
  902.  
  903.     /* Updates specified setting of this status bar that can change redraw flag
  904.      * Sequential cohesion/Data coupling
  905.      * (Game_Battler)battler: The battler owning this bar
  906.      * (Object)cfg: The configuration object used by this status bar
  907.      * (String)name: The setting name
  908.      */
  909.     Window_Status_Bar.prototype._updateSetting = function(battler, cfg, name) {
  910.     // v1.00a - v1.00a; Hotspot
  911.         if (!battler || !cfg) return;
  912.         var _name = '_' + name, last = this[_name];
  913.         this[_name] = cfg[name](battler);
  914.         this._isRedraw = this._isRedraw || last !== this[_name];
  915.     }; // Window_Status_Bar.prototype._updateSetting
  916.  
  917.     /* Checks if the whole status bar's transperant
  918.      * Functional cohesion/Message coupling/Referentially transperant
  919.      * Return(Boolean): Whether the whole status bar's transperant
  920.      */
  921.     Window_Status_Bar.prototype._isTransperant = function() {
  922.     // v1.00a - v1.01a; Hotspot
  923.         var opagueColor = 0x01000000;
  924.         if (this._backColor >= opagueColor) return false;
  925.         if (this._color1 >= opagueColor) return false;
  926.         if (this._color2 >= opagueColor) return false;
  927.         if (this._procColor1 >= opagueColor) return false;
  928.         if (this._procColor2 >= opagueColor) return false;
  929.         return this._textColor < opagueColor || this._text.length <= 0;
  930.     }; // Window_Status_Bar.prototype._isTransperant
  931.  
  932.     /* Redraws the whole status bar
  933.      * Functional cohesion/Message coupling
  934.      */
  935.     Window_Status_Bar.prototype._redraw = function() {
  936.     // v1.00a - v1.01a; Hotspot
  937.         if (this._cfg.showProc(this._battler)) return this._redrawWithProc();
  938.         this._redrawWithoutProc();
  939.     }; // Window_Status_Bar.prototype._redraw
  940.  
  941.     /* (v1.01a+)Redraws the whole status bar with the stat change process shown
  942.      * Functional cohesion/Message coupling
  943.      */
  944.     Window_Status_Bar.prototype._redrawWithProc = function() {
  945.     // v1.01a - v1.01a; Hotspot
  946.         if (this._procFillW < this._fillW) return this._redrawWithProcAbove();
  947.         if (this._procFillW > this._fillW) return this._redrawWithProcBelow();
  948.         this._redrawWithoutProc();
  949.     }; // Window_Status_Bar.prototype._redrawWithProc
  950.  
  951.     /* (v1.01a+)Redraws the whole status bar with the stat change process shown
  952.      * Sequential cohesion/Message coupling
  953.      */
  954.     Window_Status_Bar.prototype._redrawWithProcAbove = function() {
  955.     // v1.01a - v1.01a; Hotspot
  956.         this._redrawBack();
  957.         this.contents.gradientFillRect(0, 0, this._fillW, this.height,
  958.                 this._color1, this._color2);
  959.         this.contents.gradientFillRect(0, 0, this._procFillW, this.height,
  960.                 this._procColor1, this._procColor2);
  961.         this._redrawText();
  962.         this._addProcFillW();
  963.         // Otherwise the stat change process bar would show after it's done
  964.         if (this._procFillW >= this._fillW) this._redrawWithoutProc();
  965.         //
  966.     }; // Window_Status_Bar.prototype._redrawWithProcAbove
  967.  
  968.     /* (v1.01a+)Increases the stat change process fill width in the stat bar
  969.      * Functional cohesion/Message coupling
  970.      */
  971.     Window_Status_Bar.prototype._addProcFillW = function() {
  972.     // v1.01a - v1.01a; Hotspot
  973.         // Fps's assumed to be always 60
  974.         this._procFillW = Math.min(this._procFillW + this._cfg.procUpdateRate(
  975.                 this._battler) * this.width / 60, this._fillW);
  976.         //
  977.     }; // Window_Status_Bar.prototype._addProcFillW
  978.  
  979.     /* (v1.01a+)Redraws the whole status bar with the stat change process shown
  980.      * Sequential cohesion/Message coupling
  981.      */
  982.     Window_Status_Bar.prototype._redrawWithProcBelow = function() {
  983.     // v1.01a - v1.01a; Hotspot
  984.         this._redrawBack();
  985.         this.contents.gradientFillRect(0, 0, this._procFillW, this.height,
  986.                 this._procColor1, this._procColor2);
  987.         this.contents.gradientFillRect(0, 0, this._fillW, this.height,
  988.                 this._color1, this._color2);
  989.         this._redrawText();
  990.         this._minusProcFillW();
  991.         // Otherwise the stat change process bar would show after it's done
  992.         if (this._procFillW <= this._fillW) this._redrawWithoutProc();
  993.         //
  994.     }; // Window_Status_Bar.prototype._redrawWithProcBelow
  995.  
  996.     /* (v1.01a+)Decreases the stat change process fill width in the stat bar
  997.      * Functional cohesion/Message coupling
  998.      */
  999.     Window_Status_Bar.prototype._minusProcFillW = function() {
  1000.     // v1.01a - v1.01a; Hotspot
  1001.         // Fps's assumed to be always 60
  1002.         this._procFillW = Math.max(this._procFillW - this._cfg.procUpdateRate(
  1003.                 this._battler) * this.width / 60, this._fillW);
  1004.         //
  1005.     }; // Window_Status_Bar.prototype._addProcFillW
  1006.  
  1007.     /* Redraws the whole status bar without showing the stat change processes
  1008.      * Functional cohesion/Message coupling/Idempotent
  1009.      */
  1010.     Window_Status_Bar.prototype._redrawWithoutProc = function() {
  1011.     // v1.01a - v1.01a; Potential Hotspot
  1012.         this._redrawBack();
  1013.         this.contents.gradientFillRect(0, 0, this._fillW, this.height,
  1014.                 this._color1, this._color2);
  1015.         this._redrawText();
  1016.     }; // Window_Status_Bar.prototype._redrawWithoutProc
  1017.  
  1018.     /* Redraws the whole status bar without showing the stat change processes
  1019.      * Functional cohesion/Message coupling/Idempotent
  1020.      */
  1021.     Window_Status_Bar.prototype._redrawBack = function() {
  1022.         this.contents.clear();
  1023.         this.contents.fillRect(0, 0, this.width, this.height, this._backColor);
  1024.     }; // Window_Status_Bar.prototype._redrawBack
  1025.  
  1026.     /* Redraws the whole status bar without showing the stat change processes
  1027.      * Functional cohesion/Message coupling/Idempotent
  1028.      */
  1029.     Window_Status_Bar.prototype._redrawText = function() {
  1030.     // v1.01a - v1.01a; Potential Hotspot
  1031.         this.changeTextColor(this._textColor);
  1032.         var text = this._text;
  1033.         this.contents.drawText(text, this._textX, this._textY,
  1034.                 this.textWidth(text), this.height);
  1035.     }; // Window_Status_Bar.prototype._redrawText
  1036.  
  1037. })(DoubleX_RMMV.Status_Bars);
  1038.  
  1039. /*============================================================================*/
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement