G2A Many GEOs
SHARE
TWEET

DoubleX RMMV Status Bars v101b

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