DoubleX RMMV Status Bars

Purpose
Lets you use bars to show battler statuses on their sprites

Games using this plugin
None so far

Parameters
  1. * @param isEnabled
  2.  * @desc Sets whether this plugin will be enabled
  3.  *       It'll be stored as a boolean, and will be regarded as true if and only
  4.  *       if it's true
  5.  *       Don't change this during the same battle unless you really know what
  6.  *       you're truly foing
  7.  *       E.g.: Setting isEnabled as false will disable this plugin
  8.  * @default true
Expand to see the code.


Notetags
  1. *    # Actor/Class/Weapon/Armor/Enemy/State Notetags:                        
  2.  *      State notetags take the highest priority, followed by enemy, weapon,  
  3.  *      armor, class and actor                                                
  4.  *      1. <status status bar: SBX>                                            
  5.  *         - Sets the battler to setup a status bar of status using          
  6.  *           configurations set in function name SBX, which can only be edited
  7.  *           in this plugin js file directly                                  
  8.  *         - status must be included in STATUSES, which can only be edited in
  9.  *           this plugin js file directly                                    
  10.  *         - E.g.:                                                            
  11.  *           <hp status bar: HP> will set the battler to setup a hp status bar
  12.  *           using configurations set in HP, which can only be edited in this
  13.  *           plugin js file directly                                          
  14.  *         - Only the 1st effective notetag among all having the same status  
  15.  *           will be used(Reference tag: NOTETAG_MONO)                        
Expand to see the code.


Plugin Calls
  1. *    # Configuration manipulations                                          
  2.  *      1. $gameSystem.statusBars.param                                      
  3.  *         - Returns the stored value of param listed in the plugin manager  
  4.  *         - E.g.:                                                            
  5.  *           $gameSystem.statusBars.isEnabled will return a Boolean indicating
  6.  *           whether this plugin's enabled                                    
  7.  *      2. $gameSystem.statusBars.param = val                                
  8.  *         - Sets the stored value of param listed in plugin manager as val  
  9.  *         - E.g.:                                                            
  10.  *           $gameSystem.statusBars.isEnabled = false will set the stored    
  11.  *           value of parameter isEnabled shown on the plugin manager as false
  12.  *         - All $gameSystem.statusBars.param changes will be saved          
  13.  *    # Actor/Class/Weapon/Armor/Enemy/State notetag manipulations            
  14.  *      1. meta.statusBars[status]                                            
  15.  *         - Returns the function name SBX for String status specified in    
  16.  *           <status status bar: SBX> if there's any                          
  17.  *         - E.g.:                                                            
  18.  *           $dataStates[1].meta.statusBars[hp] will return the function SBX  
  19.  *           specified in <hp status bar: SBX> notetag of state with id 1    
  20.  *      2. meta.statusBars[status] = SBX                                      
  21.  *         - Sets the String status in <status status bar: SBX> notetag to use
  22.  *           the function with name SBX which is a String                    
  23.  *         - E.g.:                                                            
  24.  *           $dataEnemies[2].meta.statusBars['mp'] = 'MP' will set the SBX    
  25.  *           specified in <mp status bar: SBX> notetag of enemy with id 2 as  
  26.  *           MP                                                              
  27.  *         - All meta.statusBars changes can be saved if                      
  28.  *           DoubleX RMMV Dynamic Data is used                                
  29.  *    # Battler manipulations                                                
  30.  *      1. isStatusBarChanged[status] = true                                  
  31.  *         - Notifys the status status bar of the battler to use a new        
  32.  *           configuration object                                            
  33.  *         - It'll be reset as false once a new configuration object's used  
  34.  *         - E.g.:                                                            
  35.  *           $gameParty.aliveMembers()[0].isStatusBarChanged['tp'] = true will
  36.  *           notify the tp status bar of the battler to use a new            
  37.  *           configuration object                                            
  38.  *    # Status bar manipulations                                              
  39.  *      1. new Window_Status_Bar(battler, status)                            
  40.  *         - Creates a new status bar showing the status status of battler    
  41.  *           battler                                                          
  42.  *         - E.g.:                                                            
  43.  *           new Window_Status_Bar($gameTroop.aliveMembers()[0], 'hp') will  
  44.  *           create a new status bar showing the hp status of the 1st troop  
  45.  *           member                                                          
Expand to see the code.


Configurations
  1.    /* Setups the list of statuses that can have their status bars drawn
  2.      * Each status must be represented by the name of its battler getter
  3.      */
  4.     STATUSES: [
  5.         'hp',
  6.         'mp',
  7.         'tp'
  8.     ],
  9.  
  10.     /*------------------------------------------------------------------------
  11.      *    Status Bar Functions                                                
  12.      *    - Setups SBX used by <status bar: SBX>                              
  13.      *------------------------------------------------------------------------*/
  14.     /* SBX are used by Window_Status_Bar at this._cfg = SB[this._cfgName](); in
  15.      * _updateCfg
  16.      * SBX are Javascript functions which must return an Object having at least
  17.      * the following:
  18.      * {
  19.      *     visible: function(battler), // Hotspot
  20.      *     opacity: function(battler), // Hotspot
  21.      *     backColor: function(battler), // Hotspot
  22.      *     color1: function(battler), // Hotspot
  23.      *     color2: function(battler), // Hotspot
  24.      *     x: function(battler), // Hotspot
  25.      *     y: function(battler), // Hotspot
  26.      *     w: function(battler), // Hotspot
  27.      *     h, function(battler), // Hotspot
  28.      *     text, function(battler), // Hotspot
  29.      *     textX: function(battler), // Hotspot
  30.      *     textY: function(battler), // Hotspot
  31.      *     textSize: function(battler), // Hotspot
  32.      *     textColor: function(battler), // Hotspot
  33.      *     min: function(battler), // Hotspot
  34.      *     max: function(battler), // Hotspot
  35.      *     (v1.01a+)showProc: function(battler), // Hotspot
  36.      *     (v1.01a+)procUpdateRate: function(battler) // Hotspot
  37.      * }
  38.      * All functions will be bound to the Window_Status_Bar upon its creation
  39.      * and must take the battler and database item using the SBX as their
  40.      * arguments
  41.      *
  42.      * Status bar configuration functions:
  43.      * The function result of visible, which is the status bar visibility, will
  44.      * be interpreted as truthy or falsy only
  45.      * The function of opacity, which is the status bar opacity, must return a
  46.      * Number between 0 and 255
  47.      * The functions of backColor, color1 and color2, which are the status bar
  48.      * back, 1st and 2nd colors respectively, must return a Number between
  49.      * #00000000 and #FFFFFFFF
  50.      * The functions of x and y, which are the status bar x and y offsets from
  51.      * the battler sprites respectively, must return a Number
  52.      * The functions of w and h, which are the status bar width and height
  53.      * respectively, must return a positive Number
  54.      * The function of text, which is the status bar description text, must
  55.      * return a String
  56.      * The functions of textX, textY and textSize, which are the status bar
  57.      * description text x and y offset from the status bar, and size
  58.      * respectively, must return a positive Number
  59.      * The functions of min and max, which are the minimum and maximum value of
  60.      * the status respiectively, must return a Number that must be not greater
  61.      * than and not less than all the possible values of the current value
  62.      * respectively
  63.      * (v1.01a+)The functions of showProc, which is whether the stat change
  64.      * processes will be shown on the status bars, will be interpreted as truthy
  65.      * or falsy only
  66.      * (v1.01a+)The functions of procUpdateRate, which is the rate relative to
  67.      * the max length of the stat bar per second, must return a Number between 0
  68.      * and 1
  69.      * (v1.01a+)The functions of procColor1 and procColor2, which are the status
  70.      * bar 1st and 2nd stat change colors respectively, must return a Number
  71.      * between #00000000 and #FFFFFFFF
  72.      *
  73.      * SBX names can only use alphanumeric characters
  74.      * The below SBX are examples added to help you set your SBX
  75.      * You can freely use, rewrite and/or delete these examples
  76.      *
  77.      * Advanced:
  78.      * The status bar prototype's inherited from Window_Base.prototype
  79.      * All status bar configuration functions are used by Window_Status_Bar
  80.      * visible and opacity are used in _updateBarVisibility
  81.      * backColor, color1, color2, textColor, text, textX and textY are used in
  82.      * _updateSetting
  83.      * x, y, w and h are used in initialize
  84.      * x is also used in _updateX
  85.      * y is also used in _updateY
  86.      * w is also used in _updateW
  87.      * h is also used in _updateH
  88.      * min and max are used in _updateFillW
  89.      * (v1.01a+)showProc
  90.      */
  91.  
  92.     // Sets the status bar to display the battler's hp statuses
  93.     HP: function() { // v1.00a - v1.01a; Potential Hotspot
  94.         return {
  95.             // Sets the hp bar to be always visible only for alive battlers
  96.             visible: function(battler) { return battler.isAlive(); }, // Hotspot
  97.             // Sets the hp bar opacity to be always 255
  98.             opacity: function(battler) { return 255; }, // Hotspot
  99.             // Sets the hp bar color 1 to be always text color 15
  100.             backColor: function(battler) { // Hotspot
  101.                 return this.textColor(15);
  102.             },
  103.             // Sets the hp bar color 1 to be always text color 20
  104.             color1: function(battler) { return this.textColor(20); }, // Hotspot
  105.             // Sets the hp bar color 2 to be always text color 21
  106.             color2: function(battler) { return this.textColor(21); }, // Hotspot
  107.             // Sets the hp bar x offset from battler sprite to be always 0
  108.             x: function(battler) { return 0; }, // Hotspot
  109.             // Sets the hp bar y offset from battler sprite to be always 16
  110.             y: function(battler) { return 16; }, // Hotspot
  111.             // Sets the hp bar width to be always 87
  112.             w: function(battler) { return 87; }, // Hotspot
  113.             // Sets the hp bar height to be always 16
  114.             h: function(battler) { return 16; }, // Hotspot
  115.             // Sets the hp bar description text to be always hp/mhp
  116.             text: function(battler) { // Hotspot
  117.                 return battler.hp.toString() + '/' + battler.mhp.toString();
  118.             },
  119.             // Sets the hp bar description text size to be always 0
  120.             textX: function(battler) { return 0; }, // Hotspot
  121.             // Sets the hp bar description text size to be always 0
  122.             textY: function(battler) { return 0; }, // Hotspot
  123.             // Sets the hp bar description text size to be always 13
  124.             textSize: function(battler) { return 13; }, // Hotspot
  125.             // Sets hp bar description text color to be always text color 0
  126.             textColor: function(battler) { // Hotspot
  127.                 return this.textColor(0);
  128.             },
  129.             // Sets the minimum hp to be shown on the hp bar to be always 0
  130.             min: function(battler) { return 0; }, // Hotspot
  131.             // Sets the maximum hp to be shown on the hp bar to be always mhp
  132.             max: function(battler) { return battler.mhp; }, // Hotspot
  133.             // (v1.01a+)Sets the hp change processes to be always shown
  134.             showProc: function(battler) { return true; }, // Hotspot
  135.             // (v1.01a+)Sets the hp change processes rate to be 100% of the
  136.             // max length of the hp bar per second
  137.             procUpdateRate: function(battler) { return 0.2; }, // Hotspot
  138.             // Sets the hp change process color 1 to be always text color 6
  139.             procColor1: function(battler) { return this.textColor(6); },
  140.             // Hotspot
  141.             // Sets the hp change process color 2 to be always text color 17
  142.             procColor2: function(battler) { return this.textColor(17); }
  143.             // Hotspot
  144.         };
  145.     },
  146.  
  147.     // Sets the status bar to display the battler's mp statuses
  148.     MP: function() { // v1.00a - v1.01a; Potential Hotspot
  149.         return {
  150.             // Sets the mp bar to be always visible only for alive battlers
  151.             visible: function(battler) { return battler.isAlive(); }, // Hotspot
  152.             // Sets the mp bar opacity to be always 255
  153.             opacity: function(battler) { return 255; }, // Hotspot
  154.             // Sets the mp bar color 1 to be always text color 15
  155.             backColor: function(battler) { // Hotspot
  156.                 return this.textColor(15);
  157.             },
  158.             // Sets the mp bar color 1 to be always text color 22
  159.             color1: function(battler) { return this.textColor(22); }, // Hotspot
  160.             // Sets the mp bar color 2 to be always text color 23
  161.             color2: function(battler) { return this.textColor(23); }, // Hotspot
  162.             // Sets the mp bar x offset from battler sprite to be always 0
  163.             x: function(battler) { return 0; }, // Hotspot
  164.             // Sets the mp bar y offset from battler sprite to be always 32
  165.             y: function(battler) { return 32; }, // Hotspot
  166.             // Sets the mp bar width to be always 87
  167.             w: function(battler) { return 87; }, // Hotspot
  168.             // Sets the mp bar height to be always 16
  169.             h: function(battler) { return 16; }, // Hotspot
  170.             // Sets the mp bar description text to be always mp/mmp
  171.             text: function(battler) { // Hotspot
  172.                 return battler.mp.toString() + '/' + battler.mmp.toString();
  173.             },
  174.             // Sets the mp bar description text size to be always 0
  175.             textX: function(battler) { return 0; }, // Hotspot
  176.             // Sets the mp bar description text size to be always 0
  177.             textY: function(battler) { return 0; }, // Hotspot
  178.             // Sets the mp bar description text size to be always 13
  179.             textSize: function(battler) { return 13; }, // Hotspot
  180.             // Sets mp bar description text color to be always text color 0
  181.             textColor: function(battler) { // Hotspot
  182.                 return this.textColor(0);
  183.             },
  184.             // Sets the minimum mp to be shown on the hp bar to be always 0
  185.             min: function(battler) { return 0; }, // Hotspot
  186.             // Sets the maximum mp to be shown on the hp bar to be always mmp
  187.             max: function(battler) { return battler.mmp; }, // Hotspot
  188.             // (v1.01a+)Sets the mp change processes to be always shown
  189.             showProc: function(battler) { return true; }, // Hotspot
  190.             // (v1.01a+)Sets the mp change processes rate to be 100% of the
  191.             // max length of the mp bar per second
  192.             procUpdateRate: function(battler) { return 0.2; }, // Hotspot
  193.             // Sets the mp change process color 1 to be always text color 1
  194.             procColor1: function(battler) { return this.textColor(1); },
  195.             // Hotspot
  196.             // Sets the mp change process color 2 to be always text color 4
  197.             procColor2: function(battler) { return this.textColor(4); }
  198.             // Hotspot
  199.         };
  200.     },
  201.  
  202.     // Sets the status bar to display the battler's tp statuses
  203.     TP: function() { // v1.00a - v1.01a; Potential Hotspot
  204.         return {
  205.             // Sets the tp bar to be always visible
  206.             visible: function(battler) { return battler.isAlive(); }, // Hotspot
  207.             // Sets the tp bar opacity to be always 255
  208.             opacity: function(battler) { return 255; }, // Hotspot
  209.             // Sets the tp bar color 1 to be always text color 15
  210.             backColor: function(battler) { // Hotspot
  211.                 return this.textColor(15);
  212.             },
  213.             // Sets the tp bar color 1 to be always text color 28
  214.             color1: function(battler) { return this.textColor(28); }, // Hotspot
  215.             // Sets the tp bar color 2 to be always text color 29
  216.             color2: function(battler) { return this.textColor(29); }, // Hotspot
  217.             // Sets the tp bar x offset from battler sprite to be always 0
  218.             x: function(battler) { return 0; }, // Hotspot
  219.             // Sets the tp bar y offset from battler sprite to be always 48
  220.             y: function(battler) { return 48; }, // Hotspot
  221.             // Sets the tp bar width to be always 87
  222.             w: function(battler) { return 87; }, // Hotspot
  223.             // Sets the tp bar height to be always 16
  224.             h: function(battler) { return 16; }, // Hotspot
  225.             // Sets the tp bar description text to be always tp/maxTp()
  226.             text: function(battler) { // Hotspot
  227.                 return battler.tp.toString() + '/' + battler.maxTp().toString();
  228.             },
  229.             // Sets the tp bar description text size to be always 0
  230.             textX: function(battler) { return 0; }, // Hotspot
  231.             // Sets the tp bar description text size to be always 0
  232.             textY: function(battler) { return 0; }, // Hotspot
  233.             // Sets the tp bar description text size to be always 13
  234.             textSize: function(battler) { return 13; }, // Hotspot
  235.             // Sets tp bar description text color to be always text color 0
  236.             textColor: function(battler) { // Hotspot
  237.                 return this.textColor(0);
  238.             },
  239.             // Sets the minimum tp to be shown on the hp bar to be always 0
  240.             min: function(battler) { return 0; }, // Hotspot
  241.             // Sets maximum tp to be shown on the hp bar to be always maxTp()
  242.             max: function(battler) { return battler.maxTp(); }, // Hotspot
  243.             // (v1.01a+)Sets the tp change processes to be always shown
  244.             showProc: function(battler) { return true; }, // Hotspot
  245.             // (v1.01a+)Sets the mp change processes rate to be 100% of the
  246.             // max length of the mp bar per second
  247.             procUpdateRate: function(battler) { return 0.2; }, // Hotspot
  248.             // Sets the tp change process color 1 to be always text color 3
  249.             procColor1: function(battler) { return this.textColor(3); },
  250.             // Hotspot
  251.             // Sets the tp change process color 2 to be always text color 24
  252.             procColor2: function(battler) { return this.textColor(24); }
  253.             // Hotspot
  254.         };
  255.     },
  256.  
  257.     // Adds new SBX here
  258.    
Expand to see the code.


Video
v1.00a

v1.01a+


Prerequisites
Abilities:
1. Nothing special for most rudimetary use cases
2. Little RMMV plugin development proficiency for most ordinary uses
3. Some RMMV plugin development proficiency to fully utilize this

Instructions
  1. * You're supposed to open this plugin js file to edit its configurations
  2.  * The default plugin file name is DoubleX RMMV Status Bars v101a
  3.  * If you want to change that, you must edit the value of
  4.  * DoubleX_RMMV.Status_Bars_File, which must be done via opening this plugin
  5.  * js file directly
Expand to see the code.


Terms Of Use
  1. *      1. Commercial use's always allowed and crediting me's always optional.
  2.  *      2. You shall keep this plugin's Plugin Info part's contents intact.  
  3.  *      3. You shalln't claim that this plugin's written by anyone other than
  4.  *         DoubleX or my aliases. I always reserve the right to deny you from
  5.  *         using any of my plugins anymore if you've violated this.          
  6.  *      4. CC BY 4.0, except those conflicting with any of the above, applies
  7.  *         to this plugin, unless you've my permissions not needing follow so.
  8.  *      5. I always reserve the right to deny you from using this plugin      
  9.  *         anymore if you've violated any of the above.                      
Expand to see the code.


Changelog
  1. *      v1.01b(GMT 1200 7-7-2019):
  2.  *      1. Fixed the invisible status bars not being able to be visible again
  3.  *      2. Fixed the equips, classes and actors status bar data not being used
  4.  *      v1.01a(GMT 1400 12-8-2017):                                          
  5.  *      1. Lets you set the status bars to show the stat change processes via
  6.  *         showProc, procUpdateRate, procColor1 and procColor2 in SBX        
  7.  *      2. Fixed crashes for status bars having the same minimum and maximum  
  8.  *      v1.00a(GMT 1700 16-9-2016):                                          
  9.  *      1. 1st version of this plugin finished                                
Expand to see the code.


Download Link
DoubleX RMMV Status Bars
Updates
  1. *      v1.01a(GMT 1400 12-8-2017):                                          
  2.  *      1. Lets you set the status bars to show the stat change processes via
  3.  *         showProc, procUpdateRate, procColor1 and procColor2 in SBX        
  4.  *      2. Fixed crashes for status bars having the same minimum and maximum  
  5.  
Expand to see the code.

Updates
  1. *      v1.01b(GMT 1200 7-7-2019):
  2.  *      1. Fixed the invisible status bars not being able to be visible again
  3.  *      2. Fixed the equips, classes and actors status bar data not being used
Expand to see the code.

Original thread: https://www.hbgames.org/forums/viewtopic.php?t=79206