Advertisement
Double_X

DoubleX RMMV Popularized ATB Order v101b

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