Double_X

DoubleX RMMV Popularized ATB Order v101b

Jun 1st, 2016
466
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 Popularized ATB Order
  6.  *----------------------------------------------------------------------------
  7.  *    # Terms Of Use
  8.  *      You shall keep this plugin's Plugin Info part's contents intact
  9.  *      You shalln't claim that this plugin's written by anyone other than
  10.  *      DoubleX or his aliases
  11.  *      None of the above applies to DoubleX or his aliases
  12.  *----------------------------------------------------------------------------
  13.  *    # Prerequisites
  14.  *      Plugins:
  15.  *      1. DoubleX RMMV Popularized ATB Core
  16.  *      Abilities:
  17.  *      1. Little Javascript coding proficiency to fully utilize this plugin
  18.  *----------------------------------------------------------------------------
  19.  *    # Links
  20.  *      This plugin:
  21.  *      1. http://pastebin.com/xgKkFRev
  22.  *      Video:
  23.  *      1. https://www.youtube.com/watch?v=5xXQeX14FyA
  24.  *----------------------------------------------------------------------------
  25.  *    # Author
  26.  *      DoubleX
  27.  *----------------------------------------------------------------------------
  28.  *    # Changelog
  29.  *      v1.01b(GMT 1400 5-8-2017):
  30.  *      1. Fixed "missing this in forEach" bug causing crashes in battle tests
  31.  *      v1.01a(GMT 0500 16-7-2016):
  32.  *      1. Added <patb order sheet folder: folder>,
  33.  *      <patb order sheet name: name>, <patb order icon hue: hue> and
  34.  *      <patb order icon smooth: smooth>
  35.  *      2. Fixed <patb order icon index: row, column> and
  36.  *         <patb order icon opacity: opacity> notetag value not being number
  37.  *      3. Increased this plugin's effectiveness, efficiency and simplicity
  38.  *      v1.00b(GMT 1400 2-7-2016):
  39.  *      1. Fixed not updating the actor icon after changing actors in battle
  40.  *      2. Fixed below configuration changes not taking place in same battle:
  41.  *         - battler_order_window_x
  42.  *         - battler_order_window_y
  43.  *         - battler_order_window_width
  44.  *         - battler_order_window_height
  45.  *         - battler_order_bar_width
  46.  *         - battler_order_bar_x
  47.  *         - battler_order_bar_y
  48.  *         - battler_order_text_size
  49.  *         - battler_order_text_x
  50.  *         - battler_order_text_y
  51.  *         - battler_order_sprite_size
  52.  *         - battler_order_sheet_folder
  53.  *         - battler_order_sheet_name
  54.  *         - battler_order_sheet_hue
  55.  *         - battler_order_sheet_smooth
  56.  *         - battler_order_sprite_width
  57.  *         - battler_order_sprite_height
  58.  *         - battler_order_sprite_x
  59.  *         - actor_order_sprite_y
  60.  *         - enemy_order_sprite_y
  61.  *      3. Increased this plugin's effectiveness, efficiency and flexibility
  62.  *      v1.00a(GMT 1400 31-5-2016):
  63.  *      1. 1st completed version of this plugin finished
  64.  *============================================================================*/
  65. /*:
  66.  * @plugindesc Lets you set the battle to show all battlers' atb in 1 bar
  67.  * @author DoubleX
  68.  *
  69.  * @param show_battler_order_window
  70.  * @desc Setups a window in battle showing all battler atb statuses if
  71.  *       show_battler_order_window is set as true
  72.  * @default true
  73.  *
  74.  * @param battler_order_window_x
  75.  * @desc Sets the x position of the battler order window as
  76.  *       battler_order_window_x
  77.  * @default 400
  78.  *
  79.  * @param battler_order_window_y
  80.  * @desc Sets the y position of the battler order window as
  81.  *       battler_order_window_y
  82.  * @default 108
  83.  *
  84.  * @param battler_order_window_width
  85.  * @desc Sets the width of the battler order window as
  86.  *       battler_order_window_width
  87.  * @default 416
  88.  * @param battler_order_window_height
  89.  * @desc Sets the height of the battler order window as
  90.  *       battler_order_window_height
  91.  * @default 120
  92.  *
  93.  * @param battler_order_bar_width
  94.  * @desc Sets the width of each atb bar shown in the battler order window as
  95.  *       battler_order_bar_width
  96.  * @default 116
  97.  *
  98.  * @param battler_order_bar_x
  99.  * @desc Sets the x position of the atb bars shown in the battler order window
  100.  *       as battler_order_bar_x
  101.  * @default 16
  102.  *
  103.  * @param battler_order_bar_y
  104.  * @desc Sets the y position of the atb bars shown in the battler order window
  105.  *       as battler_order_bar_y
  106.  * @default 12
  107.  *
  108.  * @param battler_order_text_size
  109.  * @desc Sets the size of the atb bar description texts shown in the battler
  110.  *       order window as battler_order_text_size
  111.  * @default 28
  112.  *
  113.  * @param battler_order_text_x
  114.  * @desc Sets the x position of the atb bar description texts shown in the
  115.  *       battler order window as battler_order_text_x
  116.  * @default 18
  117.  *
  118.  * @param battler_order_text_y
  119.  * @desc Sets the y position of the atb bar description texts shown in the
  120.  *       battler order window as battler_order_text_y
  121.  * @default 24
  122.  *
  123.  * @param battler_order_sprite_size
  124.  * @desc Sets the size of the battler sprites in the battler order window as
  125.  *       battler_order_sprite_size
  126.  * @default 40
  127.  *
  128.  * @param battler_order_sprite_opacity
  129.  * @desc Sets the opacity of the battler sprites in the battler order window
  130.  *       as battler_order_sprite_opacity
  131.  * @default 255
  132.  *
  133.  * @param battler_order_sheet_folder
  134.  * @desc Sets the folder of the sprite sheet used by the battler sprites in the
  135.  *       battler order window as battler_order_sheet_folder
  136.  * @default img/system/
  137.  *
  138.  * @param battler_order_sheet_name
  139.  * @desc Sets the filename of the sprite sheet in battler_order_sheet_folder
  140.  *       used by the battler sprites in the battler order window as
  141.  *       battler_order_sheet_name
  142.  * @default IconSet
  143.  *
  144.  * @param battler_order_sheet_hue
  145.  * @desc Sets the hue of battler_order_sheet_name used by the battler sprites in
  146.  *       the battler order window as battler_order_sheet_hue
  147.  * @default 0
  148.  *
  149.  * @param battler_order_sheet_smooth
  150.  * @desc Sets the smooth flag of battler_order_sheet_name used by the battler
  151.  *       sprites in the battler order window as battler_order_sheet_smooth
  152.  * @default true
  153.  *
  154.  * @param battler_order_sprite_width
  155.  * @desc Sets the width of each sprite in sprite sheet used by the battler
  156.  *       sprites in the battler order window as battler_order_sprite_width
  157.  * @default 32
  158.  *
  159.  * @param battler_order_sprite_height
  160.  * @desc Sets the height of each sprite in sprite sheet used by the battler
  161.  *       sprites in the battler order window as battler_order_sprite_height
  162.  * @default 32
  163.  *
  164.  * @param battler_order_sprite_x
  165.  * @desc Sets the leftmost x position of the battler sprites in the battler
  166.  *       order window as battler_order_sprite_x
  167.  * @default 14
  168.  *
  169.  * @param actor_order_sprite_y
  170.  * @desc Sets the y position of the actor sprites in the battler order window
  171.  *       as actor_order_sprite_y
  172.  * @default 8
  173.  *
  174.  * @param enemy_order_sprite_y
  175.  * @desc Sets the y position of the enemy sprites in the battler order window
  176.  *       as enemy_order_sprite_y
  177.  * @default 72
  178.  *
  179.  * @help
  180.  * The description text of the atb bar's hardcoded as atb with its colors
  181.  * hardcoded to be the same as the default of those of battler atb bars
  182.  * If the charge addon's used, the charge bar's hardcoded at the right of the
  183.  * atb bar with its description text hardcoded as charge and colors hardcoded
  184.  * to be the same as the dedault of those of battler charge bars
  185.  * If the cooldown addon's used, the cooldown bar's hardcoded at the right of
  186.  * the atb bar and the right of the charge bar(if present) with its
  187.  * description text hardcoded as cooldown and colors hardcoded to be the same
  188.  * as the default of those of battler cooldown bars
  189.  * If both the charge and cooldown addons are used, it's highly encouraged and
  190.  * recommended to place the former above the latter
  191.  * The default plugin file name is DoubleX RMMV Popularized ATB Order v101b
  192.  * If you want to change that, you must edit the value of
  193.  * DoubleX_RMMV.PATB_Order_File, which must be done via opening this plugin js
  194.  * file directly
  195.  *============================================================================
  196.  *    ## Notetag Info
  197.  *----------------------------------------------------------------------------
  198.  *    # Actor/Class/Weapon/Armor/Enemy/State Notetags:
  199.  *      State notetags take the highest priority, followed by enemy, weapon,
  200.  *      armor, class and actor
  201.  *      Notetag settings override their correponding configuration settings
  202.  *      1. <patb order icon index: row, column>
  203.  *         - Sets the row and column of icon used by this battler's sprite in
  204.  *           the battler order window as row and column respectively
  205.  *         - The row and column are used with battler_order_sheet_name
  206.  *         - The 1st notetag that's being read by the battler will be used
  207.  *         - If either row or column is neagtive or this notetag's absent, the
  208.  *           actors' face graphics will be used for actors and the enemies'
  209.  *           battler sprites will be used for enemies
  210.  *      2. <patb order icon opacity: opacity>
  211.  *         - Sets the opacity of icon used by this battler's sprite in the
  212.  *           battler order window as opacity ranged from 0 to 255
  213.  *         - The 1st notetag that's being read by the battler will be used
  214.  *      3. (v1.01a+)<patb order sheet folder: folder>
  215.  *         - Sets the folder of the sprite sheet used by the battler sprites
  216.  *           in the battler order window as folder
  217.  *         - The 1st notetag that's being read by the battler will be used
  218.  *      4. (v1.01a+)<patb order sheet name: name>
  219.  *         - Sets the name of the sprite sheet in the specified folder used by
  220.  *           the battler sprites in the battler order window as name
  221.  *         - The 1st notetag that's being read by the battler will be used
  222.  *      5. (v1.01a+)<patb order icon hue: hue>
  223.  *         - Sets the hue of icon used by this battler's sprite in the battler
  224.  *           order window as hue ranged from -360 to 360
  225.  *         - The 1st notetag that's being read by the battler will be used
  226.  *      6. (v1.01a+)<patb order icon smooth: smooth>
  227.  *         - Sets the smooth of icon used by this battler's sprite in the
  228.  *           battler order window as smooth which can be either true or false
  229.  *         - The 1st notetag that's being read by the battler will be used
  230.  *============================================================================
  231.  *    ## Plugin Call Info
  232.  *----------------------------------------------------------------------------
  233.  *    # Configuration manipulations
  234.  *      1. $gameSystem.patb.param
  235.  *         - Returns the value of param listed in the plugin manager
  236.  *      2. $gameSystem.patb.param = val
  237.  *         - Sets the value of param listed in the plugin manager as val
  238.  *         - All $gameSystem.patb.param changes will be saved
  239.  *    # Data actor/class/weapon/armor/enemy/state manipulations
  240.  *      1. meta.patb_order_icon_index
  241.  *         - Returns the row and column of icon used by this battler's sprite
  242.  *           in the battler order window stored in
  243.  *           <patb order icon index: row, column> in the form of [row, column]
  244.  *      2. meta.patb_order_icon_index = [row, column]
  245.  *         - Sets the index of icon used by this battler's sprite in the
  246.  *           battler order window stored in
  247.  *           <patb order icon index: row, column> in the form of [row, column]
  248.  *         - All meta.patb_order_icon_index changes can be saved if
  249.  *           DoubleX RMMV Dynamic Data is used
  250.  *      3. meta.patb_order_icon_opacity
  251.  *         - Returns the opacity of icon used by this battler's sprite in the
  252.  *           battler order window stored in <patb order icon opacity: opacity>
  253.  *           as Number opacity ranged from 0 to 255
  254.  *      4. meta.patb_order_icon_opacity = opacity
  255.  *         - Sets the opacity of icon used by this battler's sprite in the
  256.  *           battler order window stored in <patb order icon opacity: opacity>
  257.  *           as Number opacity ranged from 0 to 255
  258.  *         - All meta.patb_order_icon_opacity changes can be saved if
  259.  *           DoubleX RMMV Dynamic Data is used
  260.  *      5. meta.patb_order_sheet_folder
  261.  *         - Returns the folder of sprite sheet used by this battler's sprite
  262.  *           in the battler order window stored in
  263.  *           <patb order sheet folder: folder> as file path in String
  264.  *      6. meta.patb_order_sheet_folder = folder
  265.  *         - Sets the folder of sprite sheet used by this battler's sprite in
  266.  *           the battler order window stored in
  267.  *           <patb order sheet folder: folder> as String folder
  268.  *         - All meta.patb_order_sheet_folder changes can be saved if
  269.  *           DoubleX RMMV Dynamic Data is used
  270.  *      7. (v1.01a+)meta.patb_order_sheet_name
  271.  *         - Returns the name of sprite sheet used by this battler's sprite in
  272.  *           the battler order window stored in <patb order sheet name: name>
  273.  *           as file name in String
  274.  *      8. (v1.01a+)meta.patb_order_sheet_name = name
  275.  *         - Sets the name of sprite sheet used by this battler's sprite in
  276.  *           the battler order window stored in <patb order sheet name: name>
  277.  *           as String name
  278.  *         - All meta.patb_order_sheet_name changes can be saved if
  279.  *           DoubleX RMMV Dynamic Data is used
  280.  *============================================================================
  281.  */
  282.  
  283. "use strict";
  284. var DoubleX_RMMV = DoubleX_RMMV || {};
  285. DoubleX_RMMV["PATB Order"] = "v1.01b";
  286.  
  287. // The plugin file name must be the same as DoubleX_RMMV.PATB_Order_File
  288. DoubleX_RMMV.PATB_Order_File = "DoubleX RMMV Popularized ATB Order v101b";
  289.  
  290. /*============================================================================
  291.  *    ## Plugin Implementations
  292.  *       You need not edit this part as it's about how this plugin works
  293.  *----------------------------------------------------------------------------
  294.  *    # Plugin Support Info:
  295.  *      1. Prerequisites
  296.  *         - Basic knowledge of this plugin on the user level, the default
  297.  *           battle system implementations and the atb system concepts
  298.  *         - Some Javascript coding proficiency to fully comprehend this
  299.  *           plugin
  300.  *      2. Function documentation
  301.  *         - The 1st part describes why this function's rewritten/extended for
  302.  *           rewritten/extended functions or what the function does for new
  303.  *           functions
  304.  *         - The 2nd part describes what the arguments of the function are
  305.  *         - The 3rd part informs which version rewritten, extended or created
  306.  *           this function
  307.  *         - The 4th part informs whether the function's rewritten or new
  308.  *         - The 5th part informs whether the function's a real or potential
  309.  *           hotspot
  310.  *         - The 6th part describes how this function works for new functions
  311.  *           only, and describes the parts added, removed or rewritten for
  312.  *           rewritten or extended functions only
  313.  *         Example:
  314.  * /*----------------------------------------------------------------------
  315.  *  *    Why rewrite/extended/What this function does
  316.  *  *----------------------------------------------------------------------*/
  317. /* // arguments: What these arguments are
  318.  * function_name = function(arguments) { // Version X+; Rewrite/New; Hotspot
  319.  *     // Added/Removed/Rewritten to do something/How this function works
  320.  *     function_name_code;
  321.  *     //
  322.  * } // function_name
  323.  *----------------------------------------------------------------------------*/
  324.  
  325. function Sprite_Patb_Order_Battler_Icon() {
  326.     this.initialize.apply(this, arguments);
  327. }
  328. function Sprite_Patb_Order_Actor_Icon() {
  329.     this.initialize.apply(this, arguments);
  330. }
  331. function Sprite_Patb_Order_Enemy_Icon() {
  332.     this.initialize.apply(this, arguments);
  333. }
  334. function Window_Patb_Order() { this.initialize.apply(this, arguments); }
  335.  
  336. if (DoubleX_RMMV["PATB Core"]) {
  337.  
  338. /*----------------------------------------------------------------------------*/
  339.  
  340. /*----------------------------------------------------------------------------
  341.  *    # Edit class: DataManager
  342.  *----------------------------------------------------------------------------*/
  343.  
  344. // data: The data to have its notetags read
  345. DataManager.load_patb_order_data_notes = DataManager.load_patb_data_notes;
  346. DataManager.load_patb_data_notes = function(data) {
  347.     this.load_patb_order_data_notes(data);
  348.     this.load_patb_order_notes(data); // Added
  349. }; // DataManager.load_patb_data_notes
  350.  
  351. // data: The data to have its notetags read
  352. DataManager.load_patb_order_notes = function(data) { // New
  353.     var meta = data.meta, name = /< *patb +order +sheet +name *: *(\w+) *>/i;
  354.     var icon_index = /< *patb +order +icon +index *: *(\d+) *, *(\d+) *>/i;
  355.     var opacity = /< *patb +order +icon +opacity *: *(\d+) *>/i;
  356.     var folder = /< *patb +order +sheet +folder *: *(\w+) *>/i;
  357.     var hue = /< *patb +order +icon +hue *: *(\d+) *>/i;
  358.     var smooth = /< *patb +order +icon +smooth *: *(\w+) *>/i;
  359.     data.note.split(/[\r\n]+/).forEach(function(line) {
  360.         if (!meta.patb_order_icon_index && line.match(icon_index)) {
  361.             return meta.patb_order_icon_index = [+RegExp.$1, +RegExp.$2];
  362.         } else if (!meta.patb_order_icon_opacity && line.match(opacity)) {
  363.             return meta.patb_order_icon_opacity = +RegExp.$1;
  364.         } else if (!meta.patb_order_sheet_folder && line.match(folder)) {
  365.             return meta.patb_order_sheet_folder = RegExp.$1;
  366.         } else if (!meta.patb_order_sheet_name && line.match(name)) {
  367.             return meta.patb_order_sheet_name = RegExp.$1;
  368.         } else if (!meta.patb_order_icon_hue && line.match(hue)) {
  369.             return meta.patb_order_icon_hue = +RegExp.$1;
  370.         } else if (!meta.patb_order_icon_smooth && line.match(smooth)) {
  371.             return meta.patb_order_icon_smooth = RegExp.$1 === "true";
  372.         }
  373.     });
  374. }; // DataManager.load_patb_order_notes
  375.  
  376. /*----------------------------------------------------------------------------
  377.  *    # Edit class: Game_System
  378.  *      - Stores the values of all configurations listed in the plugin manager
  379.  *----------------------------------------------------------------------------*/
  380.  
  381. Game_System.prototype.init_patb_order_params =
  382. Game_System.prototype.init_patb_params;
  383. Game_System.prototype.init_patb_params = function() {
  384.     this.init_patb_order_params();
  385.     // Added
  386.     var params = PluginManager.parameters(DoubleX_RMMV.PATB_Order_File), val;
  387.     Object.keys(params).forEach(function(param) {
  388.         val = +params[param];
  389.         this._patb[param] = isNaN(val) ? params[param] : val;
  390.     }, this);
  391.     this._patb.show_battler_order_window =
  392.     params.show_battler_order_window === "true";
  393.     this._patb.battler_order_sheet_smooth =
  394.     params.battler_order_sheet_smooth === "true";
  395.     //
  396. }; // Game_System.prototype.init_patb_params
  397.  
  398. /*----------------------------------------------------------------------------
  399.  *    # Edit class: Game_Battler
  400.  *----------------------------------------------------------------------------*/
  401.  
  402. /*----------------------------------------------------------------------------
  403.  *    New private instance variables
  404.  *----------------------------------------------------------------------------*/
  405. // _order_icon_index: The index of battler icon in battler_order_sheet_name
  406. // _order_icon_opacity: The opacity of battler icon in battler_order_sheet_name
  407.  
  408. Game_Battler.prototype.init_patb_order = Game_Battler.prototype.init_patb;
  409. Game_Battler.prototype.init_patb = function() {
  410.     this.init_patb_order();
  411.     // Added
  412.     this._patb_battler_change.order_icon_index = true;
  413.     this._patb_battler_change.order_icon_opacity = true;
  414.     this._patb_battler_change.order_sheet_folder = true;
  415.     this._patb_battler_change.order_sheet_name = true;
  416.     this._patb_note_change.order_icon_index = true;
  417.     this._patb_note_change.order_icon_opacity = true;
  418.     this._patb_note_change.order_sheet_folder = true;
  419.     this._patb_note_change.order_sheet_name = true;
  420.     //
  421. }; // Game_Battler.prototype.init_patb
  422.  
  423. /*----------------------------------------------------------------------------
  424.  *    Rereads the effective battler icon notetag only if its values can change
  425.  *----------------------------------------------------------------------------*/
  426. Game_Battler.prototype.patb_order_note = function(note) {
  427. // v1.01a+; New; Hotspot
  428.     if (this.are_patb_battler_changed(note)) { this["set_patb_" + note](); }
  429.     return this["_patb_" + note];
  430. }; // Game_Battler.prototype.patb_order_note
  431.  
  432. Game_Battler.prototype.set_patb_order_icon_index = function() {
  433. // New; Potential Hotspot
  434.     this._patb_order_icon_index = this.set_patb_notes("patb_order_icon_index");
  435.     if (this._patb_order_icon_index) { return; }
  436.     this._patb_order_icon_index = [];
  437. }; // Game_Battler.prototype.set_patb_order_icon_index
  438.  
  439. Game_Battler.prototype.set_patb_order_icon_opacity = function() {
  440. // New; Potential Hotspot
  441.     this._patb_order_icon_opacity =
  442.     this.set_patb_notes("patb_order_icon_opacity");
  443.     if (this._patb_order_icon_opacity) { return; }
  444.     this._patb_order_icon_opacity =
  445.     $gameSystem.patb.battler_order_sprite_opacity;
  446. }; // Game_Battler.prototype.set_patb_order_icon_opacity
  447.  
  448. Game_Battler.prototype.set_patb_order_sheet_folder = function() {
  449. // v1.01a+; New; Potential Hotspot
  450.     this._patb_order_sheet_folder =
  451.     this.set_patb_notes("patb_order_sheet_folder");
  452.     if (this._patb_order_sheet_folder) { return; }
  453.     this._patb_order_sheet_folder = $gameSystem.patb.battler_order_sheet_folder;
  454. }; // Game_Battler.prototype.set_patb_order_sheet_folder
  455.  
  456. Game_Battler.prototype.set_patb_order_sheet_name = function() {
  457. // v1.01a+; New; Potential Hotspot
  458.     this._patb_order_sheet_name = this.set_patb_notes("patb_order_sheet_name");
  459.     if (this._patb_order_sheet_name) { return; }
  460.     this._patb_order_sheet_name = $gameSystem.patb.battler_order_sheet_name;
  461. }; // Game_Battler.prototype.set_patb_order_sheet_name
  462.  
  463. Game_Battler.prototype.set_patb_order_icon_hue = function() {
  464. // v1.01a+; New; Potential Hotspot
  465.     this._patb_order_icon_hue = this.set_patb_notes("patb_order_icon_hue");
  466.     if (this._patb_order_icon_hue) { return; }
  467.     this._patb_order_icon_hue = $gameSystem.patb.battler_order_sprite_hue;
  468. }; // Game_Battler.prototype.set_patb_order_icon_hue
  469.  
  470. Game_Battler.prototype.set_patb_order_icon_smooth = function() {
  471. // v1.01a+; New; Potential Hotspot
  472.     this._patb_order_icon_smooth =
  473.     this.set_patb_notes("patb_order_icon_smooth");
  474.     if (this._patb_order_icon_smooth !== null) { return; }
  475.     this._patb_order_icon_smooth = $gameSystem.patb.battler_order_sprite_smooth;
  476. }; // Game_Battler.prototype.set_patb_order_icon_smooth
  477.  
  478. /*----------------------------------------------------------------------------
  479.  *    # (v1.00b+)Edit class: Game_Party
  480.  *----------------------------------------------------------------------------*/
  481.  
  482. /*----------------------------------------------------------------------------
  483.  *    New public instance variables
  484.  *----------------------------------------------------------------------------*/
  485. Object.defineProperties(Game_Party.prototype, {
  486.     // The list of id of actors that are just added into the party
  487.     "added_patb_actor_ids": { get: function() {
  488.         return this._added_patb_actor_ids;
  489.     }, configurable: true },
  490.     // The list of id of actors that are just removed from the party
  491.     "removed_patb_actor_ids": { get: function() {
  492.         return this._removed_patb_actor_ids;
  493.     }, configurable: true },
  494. });
  495.  
  496. Game_Party.prototype.initializePatb = Game_Party.prototype.initialize;
  497. Game_Party.prototype.initialize = function() {
  498.     this.initializePatb();
  499.     // Added
  500.     this._added_patb_actor_ids = [], this._removed_patb_actor_ids = [];
  501.     //
  502. }; // Game_Party.prototype.initialize
  503.  
  504. Game_Party.prototype.addActorPatb = Game_Party.prototype.addActor;
  505. Game_Party.prototype.addActor = function(actorId) {
  506.     // Added to mark that this actor's just added into the party'
  507.     if (!this._actors.contains(actorId)) {
  508.         this._added_patb_actor_ids.push(actorId);
  509.     }
  510.     //
  511.     this.addActorPatb(actorId);
  512. }; // Game_Party.prototype.addActor
  513.  
  514. Game_Party.prototype.removeActorPatb = Game_Party.prototype.removeActor;
  515. Game_Party.prototype.removeActor = function(actorId) {
  516.     // Added to mark that this actor's just removed from the party'
  517.     if (this._actors.contains(actorId)) {
  518.         this._removed_patb_actor_ids.push(actorId);
  519.     }
  520.     //
  521.     this.removeActorPatb(actorId);
  522. }; // Game_Party.prototype.removeActor
  523.  
  524. /*----------------------------------------------------------------------------
  525.  *    # New class: Sprite_Patb_Order_Battler_Icon
  526.  *      This class only supports actor and enemy icons
  527.  *----------------------------------------------------------------------------*/
  528.  
  529. /*----------------------------------------------------------------------------
  530.  *    New private instance variables
  531.  *----------------------------------------------------------------------------*/
  532. // _atbTypes: The list of all ATB types
  533. // _battler: The owner of this battler sprite
  534. // _bitmapSource: The last source battler sprite bitmap
  535. // _bitmapSh: The height of the source battler sprite bitmap
  536. // _bitmapSw: The width of the source battler sprite bitmap
  537. // _bitmapSx: The x position of the source battler sprite bitmap
  538. // _bitmapSy: The y position of the source battler sprite bitmap
  539. // _iconIndex: The index of battler icon in battler_order_sheet_name
  540. // _iconSize: The battler icon size
  541. // _lastBitmapSource: The last source battler sprite bitmap
  542. // _xOrigin: The leftmost x position of this battler sprite in the order window
  543.  
  544. Sprite_Patb_Order_Battler_Icon.prototype = Object.create(Sprite_Base.prototype);
  545. Sprite_Patb_Order_Battler_Icon.prototype.constructor =
  546. Sprite_Patb_Order_Battler_Icon;
  547.  
  548. // battler: The owner of this battler sprite
  549. Sprite_Patb_Order_Battler_Icon.prototype.initialize = function(battler) {
  550.     Sprite_Base.prototype.initialize.call(this);
  551.     this._battler = battler, this.anchor.x = this.anchor.y = 0;
  552.     var patb = $gameSystem.patb;
  553.     this._iconSize = patb.battler_order_sprite_size;
  554.     this._iconIndex = [], this.opacity = patb.battler_order_sprite_opacity;
  555.     this.updateIcon();
  556.     this.updateIconSheet();
  557.     this._xOrigin = patb.battler_order_sprite_x;
  558.     this._atbTypes = Object.keys(this._battler.patb_val);
  559.     if (patb.atb_fill_code === "delay") {
  560.         var barW = patb.battler_order_bar_width;
  561.         this._xOrigin += barW * (Object.keys(battler.patb_val).length - 1);
  562.     }
  563.     this.x = this._xOrigin;
  564.     this.bitmap = new Bitmap(this._iconSize, this._iconSize);
  565.     this.updateBitmapSource();
  566. }; // Sprite_Patb_Order_Battler_Icon.prototype.initialize
  567.  
  568. Sprite_Patb_Order_Battler_Icon.prototype.update = function() { // Hotspot
  569.     this.visible = this._battler.isAlive();
  570.     if (!this.visible) { return; }
  571.     this.opacity = this._battler.patb_order_note("order_icon_opacity");
  572.     if (this.opacity <= 0) { return; }
  573.     // Updating this._bitmapSource and this.bitmap can be too resource consuming
  574.     this.updateBitmap();
  575.     this.updateXPos();
  576.     this.updateYPos(); // Only actor and enemy sprites can use this function
  577.     this.updateBitmapSource();
  578.     //
  579. }; // Sprite_Patb_Order_Battler_Icon.prototype.update
  580.  
  581. Sprite_Patb_Order_Battler_Icon.prototype.updateBitmapSource = function() {
  582. // Hotspot
  583.     var sameIcon = this.isSameIcon(), sameIconSheet = this.isSameIconSheet();
  584.     if (sameIcon && sameIconSheet) return this.updateIconSize();
  585.     if (this.isValidIconIndex()) { return this.setBitmapSourceIcon(); }
  586.     // Only actor and enemy sprites can use this function
  587.     this.setBitmapSourceBattler();
  588.     //
  589. }; // Sprite_Patb_Order_Battler_Icon.prototype.updateBitmapSource
  590.  
  591. Sprite_Patb_Order_Battler_Icon.prototype.isSameIcon = function() {
  592. // v1.00b+; Hotspot
  593.     var iconIndex = this._iconIndex, iconChange;
  594.     var bitmapSw = this._bitmapSw, bitmapSh = this._bitmapSh;
  595.     this.updateIcon();
  596.     var patb = $gameSystem.patb;
  597.     if (this.isValidIconIndex()) {
  598.         this._bitmapSw = patb.battler_order_sprite_width;
  599.         this._bitmapSh = patb.battler_order_sprite_height;
  600.     }
  601.     iconChange = bitmapSw !== this._bitmapSw || bitmapSh !== this._bitmapSh;
  602.     return iconChange || iconIndex !== this._iconIndex;
  603. }; // Sprite_Patb_Order_Battler_Icon.prototype.isSameIcon
  604.  
  605. Sprite_Patb_Order_Battler_Icon.prototype.updateIcon = function() {
  606. // v1.00b+; Hotspot
  607.     this._iconIndex = this._battler.patb_order_note("order_icon_index");
  608.     var patb = $gameSystem.patb;
  609.     this._bitmapSw = patb.battler_order_sprite_width;
  610.     this._bitmapSh = patb.battler_order_sprite_height;
  611. }; // Sprite_Patb_Order_Battler_Icon.prototype.updateIcon
  612.  
  613. Sprite_Patb_Order_Battler_Icon.prototype.isValidIconIndex = function() {
  614. // v1.01a+; Hotspot
  615.     if (this._iconIndex.length < 2) { return false; }
  616.     return this._iconIndex[0] >= 0 && this._iconIndex[1] >= 0;
  617. }; // Sprite_Patb_Order_Battler_Icon.prototype.isValidIconIndex
  618.  
  619. Sprite_Patb_Order_Battler_Icon.prototype.isSameIconSheet = function() {
  620. // v1.00b+; Hotspot
  621.     var iconFolder = this._iconFolder, iconFilename = this._iconFilename;
  622.     var iconHue = this._iconHue, iconSmooth = this._iconSmooth, iconSheetChange;
  623.     this.updateIconSheet();
  624.     iconSheetChange = iconFolder !== this._iconFolder;
  625.     iconSheetChange = iconSheetChange || iconFilename !== this._iconFilename;
  626.     iconSheetChange = iconSheetChange || iconHue !== this._iconHue;
  627.     return iconSheetChange || iconSmooth !== this._iconSmooth;
  628. }; // Sprite_Patb_Order_Battler_Icon.prototype.isSameIconSheet
  629.  
  630. Sprite_Patb_Order_Battler_Icon.prototype.updateIconSheet = function() {
  631. // v1.00b+; Hotspot
  632.     this._iconFolder = this._battler.patb_order_note("order_sheet_folder");
  633.     this._iconFilename = this._battler.patb_order_note("order_sheet_name");
  634.     this._iconHue = this._battler.patb_order_note("order_icon_hue");
  635.     this._iconSmooth = this._battler.patb_order_note("order_icon_smooth");
  636. }; // Sprite_Patb_Order_Battler_Icon.prototype.updateIconSheet
  637.  
  638. Sprite_Patb_Order_Battler_Icon.prototype.updateIconSize = function() {
  639. // v1.00b+; Hotspot
  640.     var iconSize = this._iconSize;
  641.     this._iconSize = $gameSystem.patb.battler_order_sprite_size;
  642.     if (iconSize !== this._iconSize) { this.redrawBitmap(); }
  643. }; // Sprite_Patb_Order_Battler_Icon.prototype.updateIconSize
  644.  
  645. Sprite_Patb_Order_Battler_Icon.prototype.setBitmapSourceIcon = function() {
  646. // Potential Hotspot
  647.     var patb =$gameSystem.patb, folder = this._iconFolder, hue = this._iconHue;
  648.     var filename = this._iconFilename, smooth = this._iconSmooth;
  649.     this._bitmapSource = ImageManager.loadBitmap(folder, filename, hue, smooth);
  650.     this._bitmapSx = this._iconIndex[0] * this._bitmapSw;
  651.     this._bitmapSy = this._iconIndex[1] * this._bitmapSh;
  652. }; // Sprite_Patb_Order_Battler_Icon.prototype.setBitmapSourceIcon
  653.  
  654. Sprite_Patb_Order_Battler_Icon.prototype.updateBitmap = function() {
  655. // Potential Hotspot
  656.     if (this._lastBitmapSource === this._bitmapSource) { return; }
  657.     this._lastBitmapSource = this._bitmapSource;
  658.     this._bitmapSw = this._bitmapSw || this._bitmapSource.width;
  659.     this._bitmapSh = this._bitmapSh || this._bitmapSource.height;
  660.     this._iconSize = $gameSystem.patb.battler_order_sprite_size;
  661.     this.redrawBitmap();
  662. }; // Sprite_Patb_Order_Battler_Icon.prototype.updateBitmapSource
  663.  
  664. Sprite_Patb_Order_Battler_Icon.prototype.redrawBitmap = function() {
  665. // v1.00b+; Potential Hotspot
  666.     var sx = this._bitmapSx, sy = this._bitmapSy;
  667.     var sw = this._bitmapSw, sh = this._bitmapSh, ds = this._iconSize;
  668.     this.bitmap.blt(this._bitmapSource, sx, sy, sw, sh, 0, 0, ds, ds);
  669. }; // Sprite_Patb_Order_Battler_Icon.prototype.redrawBitmap
  670.  
  671. Sprite_Patb_Order_Battler_Icon.prototype.updateXPos = function() { // Hotspot
  672.     var patb = $gameSystem.patb, barW = patb.battler_order_bar_width;
  673.     var newX = this._xOrigin = patb.battler_order_sprite_x;
  674.     var currentType = this._battler.patb_type(), type;
  675.     var sign = patb.atb_fill_code === "delay" ? -1 : 1, r;
  676.     for (var i = 0, length = this._atbTypes.length; i < length; i++) {
  677.         type = this._atbTypes[i];
  678.         if (currentType === type) {
  679.             r = this._battler.patb_fill_rate(type);
  680.             return this.x = newX + barW * (type === "cooldown" ? 1 - r : r);
  681.         }
  682.         newX += barW * sign;
  683.     }
  684. }; // Sprite_Patb_Order_Battler_Icon.prototype.updateXPos
  685.  
  686. /*----------------------------------------------------------------------------
  687.  *    # New class: Sprite_Patb_Order_Actor_Icon
  688.  *----------------------------------------------------------------------------*/
  689.  
  690. Sprite_Patb_Order_Actor_Icon.prototype =
  691. Object.create(Sprite_Patb_Order_Battler_Icon.prototype);
  692. Sprite_Patb_Order_Actor_Icon.prototype.constructor =
  693. Sprite_Patb_Order_Actor_Icon;
  694.  
  695. Sprite_Patb_Order_Actor_Icon.prototype.setBitmapSourceBattler = function() {
  696.     this._bitmapSource = ImageManager.loadFace(this._battler.faceName());
  697.     var faceIndex = this._battler.faceIndex();
  698.     this._bitmapSx = faceIndex % 4 * Window_Base._faceWidth;
  699.     this._bitmapSy = Math.floor(faceIndex / 4) * Window_Base._faceHeight;
  700.     this._bitmapSw = Window_Base._faceWidth;
  701.     this._bitmapSh = Window_Base._faceHeight;
  702. }; // Sprite_Patb_Order_Actor_Icon.prototype.setBitmapSourceBattler
  703.  
  704. Sprite_Patb_Order_Actor_Icon.prototype.updateYPos = function() {
  705. // v1.00b+; Hotspot
  706.     var newY = $gameSystem.patb.actor_order_sprite_y;
  707.     if (this.y !== newY) { this.y = newY; }
  708. }; // Sprite_Patb_Order_Actor_Icon.prototype.updateYPos
  709.  
  710. /*----------------------------------------------------------------------------
  711.  *    # New class: Sprite_Patb_Order_Enemy_Icon
  712.  *----------------------------------------------------------------------------*/
  713.  
  714. Sprite_Patb_Order_Enemy_Icon.prototype =
  715. Object.create(Sprite_Patb_Order_Battler_Icon.prototype);
  716. Sprite_Patb_Order_Enemy_Icon.prototype.constructor =
  717. Sprite_Patb_Order_Enemy_Icon;
  718.  
  719. Sprite_Patb_Order_Enemy_Icon.prototype.setBitmapSourceBattler = function() {
  720.     var func = $gameSystem.isSideView() ? "loadSvEnemy" : "loadEnemy";
  721.     var name = this._battler.battlerName();
  722.     this._bitmapSource = ImageManager[func](name, this._battler.battlerHue());
  723.     this._bitmapSx = this._bitmapSy = 0, this._bitmapSw = this._bitmapSh = null;
  724. }; // Sprite_Patb_Order_Enemy_Icon.prototype.setBitmapSourceBattler
  725.  
  726. Sprite_Patb_Order_Enemy_Icon.prototype.updateYPos = function() {
  727. // v1.00b+; Hotspot
  728.     var newY = $gameSystem.patb.enemy_order_sprite_y;
  729.     if (this.y !== newY) { this.y = newY; }
  730. }; // Sprite_Patb_Order_Enemy_Icon.prototype.updateYPos
  731.  
  732. /*----------------------------------------------------------------------------
  733.  *    # New class: Window_Patb_Order
  734.  *----------------------------------------------------------------------------*/
  735.  
  736. /*----------------------------------------------------------------------------
  737.  *    New private instance variables
  738.  *----------------------------------------------------------------------------*/
  739. // _actor_sprites: The container of all actor sprites
  740. // _atbTypes: The list of all ATB bar types
  741. // _barColor1: The color 1 of ATB bar of each ATB type
  742. // _barColor2: The color 2 of ATB bar of each ATB type
  743. // _barW: The width of ATB bar of each ATB type
  744. // _barX: The x offset of ATB bar of each ATB type
  745. // _barY: The y offset of ATB bar of each ATB type
  746. // _enemy_sprites: The container of all enemy sprites
  747. // _textSize: The ATB bar description text size
  748. // _textX: The x offset of ATB bar description text of each ATB type
  749. // _textY: The y offset of ATB bar description text of each ATB type
  750. // _redrawBars: The ATB bar redraw flag
  751. // _redrawTexts: The ATB bar description text redraw flag
  752.  
  753. Window_Patb_Order.prototype = Object.create(Window_Base.prototype);
  754. Window_Patb_Order.prototype.constructor = Window_Patb_Order;
  755.  
  756. Window_Patb_Order.prototype.initialize = function() {
  757.     var patb = $gameSystem.patb;
  758.     var x = patb.battler_order_window_x, y = patb.battler_order_window_y;
  759.     var width = patb.battler_order_window_width;
  760.     var height = patb.battler_order_window_height;
  761.     Window_Base.prototype.initialize.call(this, x, y, width, height);
  762.     this._barColor1 = {}, this._barColor2 = {};
  763.     // $gameParty.battleMembers()[0] always exists upon battle start
  764.     this._atbTypes = Object.keys($gameParty.battleMembers()[0].patb_val);
  765.     //
  766.     this.updateBars();
  767.     this.updateTexts();
  768.     this.drawBarTexts();
  769.     this.initializeBattlerSprites();
  770. }; // Window_Patb_Order.prototype.initialize
  771.  
  772. Window_Patb_Order.prototype.initializeBattlerSprites = function() {
  773.     this._actor_sprites = {}, this._enemy_sprites = {};
  774.     var key;
  775.     $gameParty.battleMembers().forEach(function(mem) {
  776.         key = mem.actorId();
  777.         this._actor_sprites[key] = new Sprite_Patb_Order_Actor_Icon(mem);
  778.         this.addChild(this._actor_sprites[key]);
  779.     }, this);
  780.     $gameTroop.members().forEach(function(mem) {
  781.         key = mem.index();
  782.         this._enemy_sprites[key] = new Sprite_Patb_Order_Enemy_Icon(mem);
  783.         this.addChild(this._enemy_sprites[key]);
  784.     }, this);
  785. }; // Window.Patb_Order.prototype.initializeBattlerSprites
  786.  
  787. Window_Patb_Order.prototype.update = function() { // Hotspot
  788.     Window_Base.prototype.update.call(this);
  789.     this.visible = $gameSystem.patb.show_battler_order_window;
  790.     if (!this.visible) { return; }
  791.     this.updateXYWH();
  792.     this.updateBars();
  793.     this.updateTexts();
  794.     if (this._redrawBars || this._redrawTexts) { this.drawBarTexts(); }
  795.     this.addActorSprites();
  796.     this.removeActorSprites();
  797.     this.updateBattlerSprites();
  798. }; // Window_Patb_Order.prototype.update
  799.  
  800. Window_Patb_Order.prototype.updateXYWH = function() { // v1.00b+; Hotspot
  801.     var patb = $gameSystem.patb, width = patb.battler_order_window_width;
  802.     var x = patb.battler_order_window_x, y = patb.battler_order_window_y;
  803.     var height = patb.battler_order_window_height;
  804.     if (this.x !== x) this.x = x;
  805.     if (this.y !== y) this.y = y;
  806.     if (this.width !== width) this.width = width;
  807.     if (this.height !== height) this.height = height;
  808. }; // Window_Patb_Order.prototype.updateXYWH
  809.  
  810. Window_Patb_Order.prototype.updateBars = function() { // v1.00b+; Hotspot
  811.     var barW = this._barW, barX = this._barX, barY = this._barY;
  812.     var patb = $gameSystem.patb;
  813.     this._barW = patb.battler_order_bar_width;
  814.     this._barX = patb.battler_order_bar_x;
  815.     this._barY = patb.battler_order_bar_y;
  816.     this._redrawBars = barX !== this._barX || barY !== this._barY;
  817.     this._redrawBars = this._redrawBars || barW !== this._barW;
  818.     this.updateBarColors();
  819. }; // Window_Patb_Order.prototype.updateBars
  820.  
  821. Window_Patb_Order.prototype.updateBarColors = function() { // v1.00b+; Hotspot
  822.     // Loosens the coupling among charge, cooldown and order plugins
  823.     var barC1, barC2, patb = $gameSystem.patb;
  824.     this._atbTypes.forEach(function(type) {
  825.         barC1 = this._barColor1[type], barC2 = this._barColor2[type];
  826.         this._barColor1[type] = this.textColor(patb[type + "_c1"]);
  827.         this._barColor2[type] = this.textColor(patb[type + "_c2"]);
  828.         this._redrawBars = this._redrawBars || barC1 !== this._barColor1[type];
  829.         this._redrawBars = this._redrawBars || barC2 !== this._barColor2[type];
  830.     }, this);
  831.     //
  832. }; // Window_Patb_Order.prototype.updateBarColors
  833.  
  834. Window_Patb_Order.prototype.updateTexts = function() { // v1.00b+; Hotspot
  835.     var textSize = this._textSize, textX = this._textX, textY = this._textY;
  836.     var patb = $gameSystem.patb;
  837.     this._textSize = patb.battler_order_text_size;
  838.     this._textX = patb.battler_order_text_x;
  839.     this._textY = patb.battler_order_text_y;
  840.     this._redrawTexts = textX !== this._textX || textY !== this._textY;
  841.     this._redrawTexts = this._redrawTexts || textSize !== this._textSize;
  842.     if (textSize !== this._textSize) { this.resetFontSettings(); }
  843. }; // Window_Patb_Order.prototype.updateTexts
  844.  
  845. Window_Patb_Order.prototype.drawBarTexts = function() {
  846. // v1.00b+; Potential Hotspot
  847.     this._redrawBars = this._redrawTexts = false;
  848.     this.contents.clear();
  849.     this.drawBars();
  850.     this.drawTexts();
  851. }; // Window_Patb_Order.prototype.drawBarTexts
  852.  
  853. Window_Patb_Order.prototype.drawBars = function() { // Potential Hotspot
  854.     var patb = $gameSystem.patb, barC1, barC2, sign = 1, barX = this._barX;
  855.     if (patb.atb_fill_code === "delay") {
  856.         barX += this._barW * (types.length - 1), sign = -1;
  857.     }
  858.     // Loosens the coupling among charge, cooldown and order plugins
  859.     this._atbTypes.forEach(function(type) {
  860.         barC1 = this._barColor1[type], barC2 = this._barColor2[type];
  861.         this.drawGauge(barX, this._barY, this._barW, 1, barC1, barC2);
  862.         barX += this._barW * sign;
  863.     }, this);
  864.     //
  865. }; // Window_Patb_Order.prototype.drawBars
  866.  
  867. Window_Patb_Order.prototype.drawTexts = function() { // Potential Hotspot
  868.     var textX = this._textX, sign = 1;
  869.     if ($gameSystem.patb.atb_fill_code === "delay") {
  870.         textX += this._barW * (types.length - 1), sign = -1;
  871.     }
  872.     // Loosens the coupling among charge, cooldown and order plugins
  873.     this._atbTypes.forEach(function(type) {
  874.         this.drawText(type, textX, this._textY, this.textWidth(type));
  875.         textX += this._barW * sign;
  876.     }, this);
  877.     //
  878. }; // Window_Patb_Order.prototype.drawTexts
  879.  
  880. Window_Patb_Order.prototype.addActorSprites = function() {
  881.     var mem;
  882.     $gameParty.added_patb_actor_ids.forEach(function(actorId) {
  883.         if (this._actor_sprites[actorId]) { return; }
  884.         mem = $gameActors.actor(actorId);
  885.         this._actor_sprites[actorId] = new Sprite_Patb_Order_Actor_Icon(mem);
  886.         this.addChild(this._actor_sprites[actorId]);
  887.     }, this);
  888.     $gameParty.added_patb_actor_ids.length = 0;
  889. }; // Window_Patb_Order.prototype.addActorSprites
  890.  
  891. Window_Patb_Order.prototype.removeActorSprites = function() {
  892.     var mem;
  893.     $gameParty.removed_patb_actor_ids.forEach(function(actorId) {
  894.         if (!this._actor_sprites[actorId]) { return; }
  895.         this.removeChild(this._actor_sprites[actorId]);
  896.         this._actor_sprites[actorId] = null;
  897.     }, this);
  898.     $gameParty.removed_patb_actor_ids.length = 0;
  899. }; // Window_Patb_Order.prototype.removeActorSprites
  900.  
  901. Window_Patb_Order.prototype.updateBattlerSprites = function() { // Hotspot
  902.     Object.keys(this._actor_sprites).forEach(function(actorId) {
  903.         this._actor_sprites[actorId].update();
  904.     }, this);
  905.     Object.keys(this._enemy_sprites).forEach(function(enemyId) {
  906.         this._enemy_sprites[enemyId].update();
  907.     }, this);
  908. }; // Window_Patb_Order.prototype.updateBattlerSprites
  909.  
  910. Window_Patb_Order.prototype.standardFontSize = function() { // Potential Hotspot
  911.     return this._textSize;
  912. }; // Window_Patb_Order.prototype.standardFontSize
  913.  
  914. /*----------------------------------------------------------------------------
  915.  *    # Edit class: Scene_Battle
  916.  *----------------------------------------------------------------------------*/
  917.  
  918. /*----------------------------------------------------------------------------
  919.  *    New private instance variable
  920.  *----------------------------------------------------------------------------*/
  921. // _patb_order_window: The battler order window
  922.  
  923. Scene_Battle.prototype.createAllWindowsPatbOrder =
  924. Scene_Battle.prototype.createAllWindows;
  925. Scene_Battle.prototype.createAllWindows = function() {
  926.     this.createAllWindowsPatbOrder();
  927.     if ($gameSystem.is_patb()) { this.create_patb_order_window(); } // Added
  928. }; // Scene_Battle.prototype.createAllWindows
  929.  
  930. Scene_Battle.prototype.update_patb_process_order =
  931. Scene_Battle.prototype.update_patb_process;
  932. Scene_Battle.prototype.update_patb_process = function() { // Hotspot
  933.     this.update_patb_process_order();
  934.     this._patb_order_window.update(); // Added
  935. }; // Scene_Battle.prototype.update_patb_process
  936.  
  937. Scene_Battle.prototype.close_patb_windows_order =
  938. Scene_Battle.prototype.close_patb_windows;
  939. Scene_Battle.prototype.close_patb_windows = function() {
  940.     this.close_patb_windows_order();
  941.     this.close_patb_order_windows(); // Added
  942. }; // Scene_Battle.prototype.close_patb_windows
  943.  
  944. Scene_Battle.prototype.create_patb_order_window = function() { // New
  945.     this._patb_order_window = new Window_Patb_Order();
  946.     this.addWindow(this._patb_order_window);
  947. }; // Scene_Battle.prototype.create_patb_order_window
  948.  
  949. Scene_Battle.prototype.close_patb_order_windows = function() { // New
  950.     this._patb_order_window.hide();
  951.     this._patb_order_window.deactivate();
  952.     this._patb_order_window.close();
  953. }; // Scene_Battle.prototype.close_patb_order_windows
  954.  
  955. /*----------------------------------------------------------------------------*/
  956.  
  957. } else {
  958.     alert("To use PATB Order, place it below PATB Core.");
  959. }
  960.  
  961. /*============================================================================*/
RAW Paste Data