Advertisement
TheSixth

Scene Addon for Tsukihime's Party Manager by Sixth

Sep 2nd, 2015
388
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 77.71 KB | None | 0 0
  1. #===============================================================================
  2. # * [ACE] Party Manager Scene Addon
  3. #===============================================================================
  4. # * Made by: Sixth (www.rpgmakervxace.net, www.forums.rpgmakerweb.com)
  5. # * Version: 1.4
  6. # * Updated: 21/01/2015
  7. # * Requires: Tsukihime's Party Manager script
  8. #-------------------------------------------------------------------------------
  9. # * < Change Log >
  10. #-------------------------------------------------------------------------------
  11. # * Version 1.0 (07/12/2014)
  12. #   - Initial release.
  13. # * Version 1.1 (08/12/2014)
  14. #   - Fixed a starting party selection bug.
  15. #     It was not possible to select a party if it had the maximum mebmers
  16. #     assigned to it.
  17. #   - Added an option to force the player to start with a specific party after
  18. #     the arrangement has been finished instead of always letting the player to
  19. #     select the starting party.
  20. # * Version 1.2 (09/12/2014)
  21. #   - Added a status window for the scene which can show the basic params and
  22. #     equips of the selected party member. Afterall, nobody likes to put their
  23. #     members blindly anywhere without knowing their stats, right?
  24. #     The status window is fully customizable, of course!
  25. #   - Added windowskin option for each window separately!
  26. # * Version 1.3 (14/12/2014)
  27. #   - Added a method which was missing and hence caused a crash. Sorry! *-*
  28. #   - Fixed a visual bug with the party selection cursor.
  29. #     The bottom of the cursor for the last party's window disappeared in certain
  30. #     conditions. This won't happen anymore.
  31. #   - Depending on the size of the 'to be created' parties, sometimes a few pixels
  32. #     were left empty at the bottom of the screen. From now on, those empty pixels
  33. #     will be simply added to the last window's height.
  34. #     It looks a bit better this way. This is only effective if you are using the
  35. #     default window divider method.
  36. #   - The windows for the parties are now scrollable. So, if there are more
  37. #     parties than what you can display on the screen, you can scroll up and down
  38. #     to check every parties whenever you want. This enables you to make a lot
  39. #     of parties at once without the need to shrink the party windows too much!
  40. #     New settings are added for this scroll function, so you can limit how many
  41. #     parties you want to be shown maximum on the screen at once.
  42. #   - Added text options for each window!
  43. #   - Added more settings for you to configure!
  44. # * Version 1.4 (21/01/2015)
  45. #   - Fixed the blinking of the cursor on the 'to be created' party windows.
  46. #-------------------------------------------------------------------------------
  47. # * < Installation >
  48. #-------------------------------------------------------------------------------
  49. # * In the script editor, place this script below Tsukihime's Party Manager and
  50. #   above Main.
  51. #-------------------------------------------------------------------------------
  52. # * < Compatibility Info >
  53. #-------------------------------------------------------------------------------
  54. # * No known incompatibilities.
  55. # * Includes compatibility for the following scripts:
  56. #   - Yanfly's Equip Engine:
  57. #     The status window will show all available equip slots, not just the default
  58. #     ones! You can still hide any slots if you want thou!
  59. #   - Yanfly's Class System:
  60. #     The status window will show the primary and the secondary class names too!
  61. #   - GaryCXJk's Class Extensions System:
  62. #     The status window will show the primary, secondary and the combined class
  63. #     names too!
  64. #   - Blackmorning's Title System:
  65. #     The status window will show the current title of the actor! If this script
  66. #     is not installed, the player's nickname will show up instead where the
  67. #     title would show up!
  68. #-------------------------------------------------------------------------------
  69. # * < Description >
  70. #-------------------------------------------------------------------------------
  71. # * This script makes a party manager scene to visualise party creations.
  72. # * Enables the creation of parties with dynamic party members.
  73. #   Define the party ID, minimum required members, maximum party members, the
  74. #   location of the parties, the starting members (locked members), as well as a
  75. #   little custom text for each party to show the player a little information
  76. #   about the parties, and let the player himself/herself choose the members of
  77. #   the parties however they want!
  78. # * A status window showing the basic parameters and equips of the party members
  79. #   will help the player to choose the actor without guessing what stats they
  80. #   actually have!
  81. # * Actors can be locked, so the player can not assign them to any parties, and
  82. #   actors can also be locked the other way around, so the player can not remove
  83. #   them from the parties!
  84. # * When the arrange is finished, the player can choose the starting party as well!
  85. # * After selecting a starting party, all of the parties will be created at their
  86. #   defined location, and the player gains control over the selected starting
  87. #   party on the map automatically.
  88. #-------------------------------------------------------------------------------
  89. # * < Script Calls >
  90. #-------------------------------------------------------------------------------
  91. # * For calling the party manager scene, use the following script call:
  92. #
  93. #     enter_party_scene([info])
  94. #
  95. #   The 'info' is an array which can contain any number of 'data arrays'.
  96. #   Each 'data_array' should look like this:
  97. #
  98. #     data_array = [party_id,[starting_members],[map_id,map_x,map_y],[min_members,max_members],"custom_text"]
  99. #  
  100. #   Explanation of each data:
  101. #
  102. #     party_id = The ID of the "to be created" party.
  103. #                NOTE: Never use the current party ID for this!
  104. #
  105. #     starting_members = The starting members of the party.
  106. #                        These members are automatically assigned to the party
  107. #                        and the player can not remove them from the party.
  108. #                        NOTE: Use [] if you don't want any starting members!
  109. #
  110. #     map_id = The ID of the map where the party will spawn after the arrange.
  111. #     map_x  = The X position on the map where the party will spawn.
  112. #     map_y  = The Y position on the map where the party will spawn.
  113. #     NOTE: map_id, map_x and map_y needs to be put into an array.
  114. #           This array will be the 'location' data array.
  115. #
  116. #     min_members = The minimum amount of members required for the party.
  117. #                   The player can not leave the scene until all of the parties's
  118. #                   total members reach their defined minimum amount of members.
  119. #     max_members = The maximum amount of allowed members in the party.
  120. #                   The player can not place any actor into a party if the party's
  121. #                   total members reached the maximum member capacity.
  122. #                   NOTE: You can add more members like usually, but only after
  123. #                         exiting the party arrangement scene!
  124. #     NOTE: min_members and max_members needs to be put into an array.
  125. #           This array will be the 'members info' data array.
  126. #
  127. #     custom_text = A custom string to be shown on the arrangement scene.
  128. #                   You can use any valid message codes here!
  129. #                   NOTE: custom_text must be put between " " signs!
  130. #
  131. #   This certainly looks like a lot of info in a small script call, right?
  132. #   Here are a few examples to make it easier to understand all this information:
  133. #
  134. #     party1 = [2,[],[21,3,4],[3,4],"Location: Dark Cave"]
  135. #     party2 = [3,[2,3],[21,4,4],[4,5],"Location: Detrai Mountains"]
  136. #     info = [party1,party2]
  137. #     enter_party_scene(info)
  138. #
  139. #   So, we can define each party separately on a new line.
  140. #   Each of these parties can be named however you like.
  141. #   I named them 'party1' and 'party2' in this example.
  142. #   After this, we put these parties into a new array.
  143. #   This new array can also be named however you like.
  144. #   I named it 'info' in this example.
  145. #  
  146. #   On the scene, we will see that with this script call, two parties will be
  147. #   created.
  148. #   The first party will get 2 for it's ID, while the second gets 3 for it's ID.
  149. #   The first party will not have any starting members, while the second will
  150. #   have the actors with ID 2 and 3 already assigned, and they can not be removed
  151. #   before the player exits the arrangements scene.
  152. #   After the arrangement, the first party will be spawned on the map with ID 21
  153. #   at the (3,4) co-ordinates (x,y), while the second party will be spawned
  154. #   right next to the first one (on the same map at the (4,4) co-ordinates).
  155. #   The first party needs at least 3 members assigned and the second party needs
  156. #   at least 4 members assigned before the player can leave the scene.
  157. #   The first party can have a maximum of 4 members assigned, while the second
  158. #   party can have 5.
  159. #   The first party's info text will show "Location: Dark Cave", while the second
  160. #   party's info text will show "Location: Detrai Mountains".
  161. #   These info texts will show up on the top left side of each party window.
  162. #  
  163. #   And this should explain the kinda long script call.
  164. #   Let's take a look at an even longer one:
  165. #
  166. #     party1 = [2,[],[21,3,4],[3,4],"Location: Grassfields"]
  167. #     party2 = [3,[4],[21,4,4],[3,5],"Location: Prairie Camp"]
  168. #     party3 = [4,[2,1],[21,5,4],[2,3],"Location: Racer's Hideout"]
  169. #     party4 = [5,[],[21,6,4],[2,3],"Location: Lake of Calmness"]
  170. #     info = [party1,party2,party3,party4]
  171. #     enter_party_scene(info)
  172. #  
  173. #   Wow, lotsa parties, indeed!
  174. #   As you can see, it is the same as before, but now with 4 different parties!
  175. #   You can create as many parties as you want!
  176. #
  177. #   Well, this should explain the script call for the scene!
  178. #- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  179. # * For making a certain actor unable to be assigned to any parties, you can use
  180. #   the following script call:
  181. #
  182. #     pm_lock_actor([actor_ids])
  183. #
  184. #   Replace 'actor_ids' with any number of actor IDs.
  185. #   Example:
  186. #    
  187. #     pm_lock_actor([1,3,5])
  188. #
  189. #   This script call would make the actors with ID 1, 3 and 5 unable to be
  190. #   assigned to any parties on the party arrangement scene.
  191. #
  192. #   Similarly, you can remove this restriction with the following script call:
  193. #
  194. #     pm_unlock_actor([actor_ids])
  195. #- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  196. # * For forcing a starting party, you can use the following script call:
  197. #
  198. #     pm_starting_party(party_id)
  199. #
  200. #   Replace 'party_id' with the ID of the party you want for the starting party.
  201. #   Using this script call, the party selection window will not pop up after
  202. #   pressing the "Finish" button. Instead of that, the starting party will be
  203. #   the one you defined with this script call.
  204. #   To enable the manual starting party selection again after using this script
  205. #   call, you can make the same script call and use -1 for the 'party_id'.
  206. #-------------------------------------------------------------------------------
  207. # * < Known Issues >
  208. #-------------------------------------------------------------------------------
  209. # * No known issues.
  210. #-------------------------------------------------------------------------------
  211. # * < Author's Thanks and Credits >
  212. #-------------------------------------------------------------------------------
  213. # * I used Blackmorning's method to draw the actor's faces on the scene.
  214. #   Credit and my thanks goes to him for that method!
  215. #-------------------------------------------------------------------------------
  216. # * < Terms of Use >
  217. #-------------------------------------------------------------------------------
  218. # * Free to use for whatever purposes you want.
  219. # * Credit me (Sixth) in your game, pretty please! :P
  220. # * Posting modified versions of this script is allowed as long as you notice me
  221. #   about it with a link to it!
  222. #===============================================================================
  223. $imported = {} if $imported.nil?
  224. $imported["SixthPartyManagerScene"] = true
  225. #===============================================================================
  226. # Settings:
  227. #===============================================================================
  228. module PM_Scene
  229.   Texty = [] # <-- No touchy-touchy!
  230. #===============================================================================
  231. # Window Settings:
  232. #===============================================================================
  233.  
  234.   # The properties of the help window.
  235.   # Format: Help_Window = [x,y,width,height,"windowskin"]
  236.   Help_Window    = [0,0,140,48,"Window"]
  237.  
  238.   # The properties of the command window.
  239.   # Format: Command_Window = [x,y,width,height,"windowskin"]
  240.   Command_Window = [0,48,140,72,"Window"]
  241.  
  242.   # The properties of the current party members window.
  243.   # Format: Members_Window = [x,y,width,height,"windowskin"]
  244.   Members_Window = [0,120,140,Graphics.height-120,"Window"]
  245.  
  246.   # The properties of the new parties windows.
  247.   # Format: Parties_Window = [x,y,width,height,"windowskin1","windowskin2"]
  248.   # NOTE: The height of this window will be divided by the number of parties you
  249.   #       defined in the script call automatically or if there are more parties
  250.   #       than what the party window can display, it will be divided by the value
  251.   #       set for the 'MaxPartyAtOnce' setting.
  252.   # NOTE: The the windowskin setting here affects two different things:
  253.   # - windowskin1 = This will be the windowskin used for all of the
  254.   #                 "to be created" party windows.
  255.   # - windowskin2 = This will be the windowskin of the party selection window.
  256.   #                 Since this window is fully transparent, this setting will
  257.   #                 only affect the cursor type shown when selecting parties.
  258.   Parties_Window = [140,0,Graphics.width-140,Graphics.height,"Window","Window"]
  259.  
  260.   # The properties of the status window.
  261.   # Format: Stat_Window = [x,y,width,[height1,height2,height3],"windowskin"]
  262.   # NOTE: The status window can change it's height depending on what is shown
  263.   #       in it. If you don't want this feature, simply set the below setting
  264.   #       to false! More info on this can be found at the next setting!
  265.   # Here is when each height is effective:
  266.   #  - height1 = When the basic parameters are shown.
  267.   #  - height2 = When the equip info is shown.
  268.   #  - height3 = When no party member is selected (cursor is on an "Empty" place).
  269.   Stat_Window    = [Graphics.width-400,0,400,[374,350,96],"Window"]
  270.      
  271.   # You can disable the status window's dynamic height change feature here.
  272.   # If you do, the height of the status window will always be the higest value
  273.   # set up for the height values of the status window.
  274.   # If the dynamic height is enabled, the status window will be pinned to the
  275.   # bottom of the screen, regardless what value did you set for the status
  276.   # window's Y position! If it is disabled, the Y position will take the value
  277.   # from the above setting for the status window!
  278.   Dynamic_Stat_Height = true
  279.  
  280. #===============================================================================
  281. # Text Settings:
  282. #===============================================================================
  283.  
  284.   # Text settings for each window.
  285.   # Format: Name_Font = [["font1","font2","font3"],size]
  286.   # You can use any amount of font types in the font type array.
  287.   # The first on the list will be chosen, but if the system can't find that
  288.   # font type installed, it will move on to the next type listed here.
  289.   #           [[       Font Types         ],size]
  290.   Help_Font = [["Monotype Corsiva","Arial"],  20]
  291.   Cmnd_Font = [["Monotype Corsiva","Arial"],  20]
  292.   Memb_Font = [["Monotype Corsiva","Arial"],  20]
  293.   Name_Font = [["Monotype Corsiva","Arial"],  20]
  294.   Info_Font = [["Monotype Corsiva","Arial"],  20]
  295.   Stat_Font = [["Monotype Corsiva","Arial"],  20]
  296.  
  297.   # Text display options:
  298.   Texty[0]  = "Arrange" # Used for the arrange command button.
  299.   Texty[1]  = "Finish"  # Used for the arrange finish command button.
  300.   Texty[2]  = "Select a command." # Used in the help window.
  301.   Texty[3]  = "Select a member."  # Used in the help window.
  302.   Texty[4]  = "Select a party."   # Used in the help window.
  303.   Texty[5]  = "Starting party:" # Used in the help window.
  304.   Texty[6]  = "Party " # Used in the party windows.
  305.   Texty[7]  = "Status: " # Used in the party windows (max/min member text).
  306.   Texty[8]  = "Members Required: " # Used in the party windows (req. member text).
  307.   Texty[9]  = "Empty" # Used when a party is empty.
  308.   Texty[10] = "Status" # Used in the status window.
  309.   Texty[11] = "Equips" # Used in the status window.
  310.   Texty[12] = "Empty" # Used in the status window for showing an empty equip slot.
  311.   Texty[13] = "Name" # Used in the status window.
  312.   Texty[14] = "Class" # Used in the status window.
  313.   Texty[15] = "Title" # Used in the status window.
  314.   Texty[16] = "No party member is selected!" # Used in the status window when no member is selected.
  315.   Texty[17] = "General Info" # Used in the status window.
  316.  
  317. #===============================================================================
  318. # Color Settings:
  319. #===============================================================================
  320.  
  321.   # Colors used on the scene.
  322.   # These settings use RGBA codes!
  323.  
  324.   # Text colors:
  325.   Min_Mem_OK = [100,220,100,255] # When the minimum member requirement is OK.
  326.   Min_Mem_NO = [220,100,100,255] # When the minimum member requirement is not OK.
  327.   Status_Col = [100,100,220,255] # Color for the min/max members indicator text.
  328.   Party_Col  = [220,220,100,255] # Color for the party identifier text.
  329.   Enable_Mem = [255,255,255,255] # Color for the enabled party members' name text.
  330.   Locked_Mem = [220,150,100,255] # Color for the locked party members' name text.
  331.   No_Member  = [220,150,100,255] # Color for the text in the stat window when no member is selected.
  332.  
  333.   # Color for the text boxes in the status window.
  334.   TextBox_C  = [  0,  0,  0, 80]
  335.  
  336.   # Color for the visual boxes appearing around the stat and equip info in the
  337.   # status window and for the line shown below the general info text.
  338.               # [[  Outer Color  ],[  Inner Color  ]] <-- For the boxes.
  339.               # [[  Upper Color  ],[  Lower Color  ]] <-- For the line.
  340.   Box_Colors  = [[100,100,220,250],[ 60, 60, 60,250]]
  341.  
  342. #===============================================================================
  343. # Visual Settings:
  344. #===============================================================================
  345.  
  346.   # Max colums (party members) shown on the "to be created" party windows.
  347.   # If the faces and/or the actor names become too crowded, decrease the number
  348.   # of shown columns, so that they have more space to display.
  349.   # If there are more members in a party than the value set here, the cursor can
  350.   # be scrolled to the right, so all of the members are displayable regardless
  351.   # of how many there are in one party.
  352.   Max_Colums = 4
  353.  
  354.   # The spacing between each party members on the right windows.
  355.   Spacing = 6
  356.  
  357.   # Size of the face icons used on the scene.
  358.   # The value represents pixels.
  359.   # 96 is the default face image size drawn on default scenes.
  360.   # Lower values than that will result in smaller face images.
  361.   # Higher values than that will result in bigger face images.
  362.   Face_Size = 42
  363.  
  364.   # The height of the cursor shown on the "to be created" party windows.
  365.   Cursor_Height = 70
  366.  
  367.   # The Y offset value for the cursor shown on the "to be created" party windows.
  368.   # Positive values will move the cursor down.
  369.   # Negative values will move the cursor up.
  370.   Cursor_Y_Offset = 0
  371.  
  372.   # The Y offset value for the names shown below the face images.
  373.   # Positive values will move the name display down.
  374.   # Negative values will move the name display up.
  375.   Name_Y_Offset = -6
  376.  
  377.   # This setting will affect how many parties will be displayed at once at the
  378.   # "to be created" party windows section.
  379.   # The height of the parties window you set up above will be divided by this
  380.   # value when the amount of the parties is more than this value.
  381.   # If it is less, it will use the default dividing method, unless you disable
  382.   # the next option below.
  383.   # If there are more parties, the parties window section becomes scrollable,
  384.   # so it is now really possible to make infinite amount of parties if someone
  385.   # would like... I wonder why would anyone, but the option is there now without
  386.   # the shrinking of the windows to oblivion. :D
  387.   MaxPartyAtOnce = 3
  388.  
  389.   # If this is enabled, the scene will use the default method of dividing the
  390.   # height of the parties window when there are equal or less parties on the
  391.   # screen than what you have defined in the above setting.
  392.   # If this is disabled, the scene will always divide the height by the number
  393.   # you have defined in the above setting.
  394.   DefaultDivide = true
  395.  
  396.   # You can set up the up and down indicators here.
  397.   # These will appear when there are more "to be created" parties on the scene
  398.   # than what you have set for the 'MaxPartyAtOnce' settings.
  399.   # In other words, these will operate just like an up and down scroll indicator
  400.   # in a regular selection window when there are more items than what the window
  401.   # can display.
  402.   # Format = ["img_file_name",[x,y]]
  403.   # img_file_name = The name of the picture to be used for the arrow.
  404.   #                 The picture used must be in the folder: Graphics/System!
  405.   # x = The X position of the picture. If you set this to :center, the picture
  406.   #     will be automatically centered within the party windows.
  407.   #     Otherwise it will take the direct X position you define here.
  408.   #     The direct X position is not relative to the window's X position!
  409.   #     So, setting this to 0 means it will appear at the left edge of the game's
  410.   #     screen and not at the left edge of the window!
  411.   # y = The Y position offset for the picture.
  412.   #     This will act as an offset value, so postive values will move the picture
  413.   #     down, while negative ones will move it up.
  414.   #     By default, the up scroll picture is stuck at the top of the first party
  415.   #     window. This setting will add the defined value to that position.
  416.   #     By default, the down scroll picture is stuck at the bottom of the last
  417.   #     displayable party window. This setting will add the defined value to that
  418.   #     position.
  419.   Arrow_U = ["UpArrow2"  ,[:center, 6]] # Setup for the upper scroll indicator.
  420.   Arrow_D = ["DownArrow2",[:center,-6]] # Setup for the lower scroll indicator.
  421.  
  422.   # The X and Y position of the actor face drawn in the status window.
  423.   Face_X = 10
  424.   Face_Y = 10
  425.  
  426.   # The properties and position of the base info shown in the status window.
  427.   # The base info includes the name, class and title of the actor and the base
  428.   # info text above them with the line below it.
  429.   Base_Info_X = 132 # X position.
  430.   Base_Info_Y = 33  # Y position.
  431.   Base_Info_W = 230 # Width of the base info.
  432.  
  433.   # The properties and position of the detailed info shown in the status window.
  434.   # The detailed info includes the base params and equips of the actor and the
  435.   # base info text above them with the boxes around all of this.
  436.   Dtls_Info_X = 21  # X position.
  437.   Dtls_Info_Y = 140 # Y position.
  438.   Dtls_Info_W = 334 # Width of the detailed info.
  439.  
  440.   # The X offset value for the name of the equipped items shown in the stat window.
  441.   # It might need to be changed for certain font types.
  442.   # Positive values will move the text right, negative values will move it left.
  443.   Item_X_Offset = -5
  444.  
  445.   # You can set which parameters you want to show for the player in the status
  446.   # window. Put the parameter's IDs which you want to show in the array here.
  447.   # The parameter IDs not included here will not show up in the status window!
  448.   # 0 - MHP, 1 - MMP, 2 - ATT, 3 - DEF, 4 - MAT, 5 - MDF, 6 - AGI, 7 - LUK.
  449.   Include_Params = [0,1,2,3,4,5,6,7]
  450.  
  451.   # You can set which equip slots you DO NOT want to show here.
  452.   # Any equip slot IDs included here will NOT show up in the status window!
  453.   # Make sure that you do not put any invalid numbers here!
  454.   # The equip info shown in the status window is compatible with Yanfly's Equip
  455.   # Engine, so you can have more equip slot IDs than the default ones!
  456.   # Default IDs:
  457.   # 0 - Weapon, 1 - Shield/2nd Weapon, 2 - Headgear, 3 - Armor, 4 - Accessory.
  458.   Equip_Exclude  = [] # Example array: [1,4]
  459.  
  460.   # Max pages shown in the status window.
  461.   # If you want to disable some pages, you can edit this setting with the below
  462.   # settings. The default is 2, which means it will show the base params of the
  463.   # actor on one page, and the equips of the actor on the other page.
  464.   Max_Page = 2
  465.  
  466.   # The page setup for the status window.
  467.   # For now, there are 2 things you can set to show:
  468.   # ':params' stands for the basic parameter info page.
  469.   # ':equips' stands for the equip info page.
  470.   # The numbers indicates on which page will they show up.
  471.   # Page numbers start from 1 and they go up to the number of available options
  472.   # here, which means 2 at the moment.
  473.   # Default values:
  474.   # :params => 1,
  475.   # :equips => 2,
  476.   Page_Setup = { # <-- No touchy-touchy!
  477.                 :params => 1, # Page number for the base params shown.
  478.                 :equips => 2, # Page number for the equips shown.
  479.                 } # <-- No touchy-touchy!
  480.  
  481. #===============================================================================
  482. # Audio Settings:
  483. #===============================================================================
  484.  
  485.   # Set the sound effects to be played at various actions on the arrangement scene.
  486.               # RPG::SE.new("SE_Name", volume, pitch)
  487.   Member_Add  = RPG::SE.new("Chime1" ,     80,   100) # When adding members.
  488.   Member_Rem  = RPG::SE.new("Buzzer2",     80,   100) # When removing members.
  489.   Arrange_Fin = RPG::SE.new("Chime2" ,     80,   100) # When finishing the arrange.
  490.   Stats_Open  = RPG::SE.new("Decision1",   80,   100) # When opening the stat window.
  491.   Toggle_Stat = RPG::SE.new("Cursor1",     80,   100) # When toggling the stat window.
  492.  
  493. #===============================================================================
  494. # Button Settings:
  495. #===============================================================================
  496.  
  497.   # Button trigger for switching between the current party window and the
  498.   # "to be created" party windows.
  499.   Window_Switch = :A
  500.  
  501.   # Button trigger for showing/hiding the status window.
  502.   # The status window will only ever show up if the active window is either the
  503.   # current party member window or the "to be created" party window!
  504.   # You can disable the status window feature if you set this to 'nil'.
  505.   Status_Window = :CTRL
  506.  
  507.   # Button trigger for changing pages on the status window.
  508.   # You can disable the page changing if you set this to 'nil'.
  509.   Status_Toggle = :Z
  510.  
  511. end
  512. #===============================================================================
  513. # End of Settings! You can modify things below too if you don't mind the risk
  514. # of flaming potatoes dropping down on your PC...
  515. #===============================================================================
  516.  
  517. #==============================================================================
  518. # Game_Actor
  519. #------------------------------------------------------------------------------
  520. # Adding the locked flag for the actors here.
  521. #==============================================================================
  522. class Game_Actor < Game_Battler
  523.   #--------------------------------------------------------------------------
  524.   # New Public Instance Variable
  525.   #--------------------------------------------------------------------------
  526.   attr_accessor  :actor_lock_in_party
  527.   #--------------------------------------------------------------------------
  528.   # Alias Method: Initialize
  529.   #--------------------------------------------------------------------------
  530.   alias sixth_actor_lock122 initialize
  531.   def initialize(actor_id)
  532.     sixth_actor_lock122(actor_id)
  533.     @actor_lock_in_party = false
  534.   end
  535. end
  536. #==============================================================================
  537. # Game_System
  538. #------------------------------------------------------------------------------
  539. # Adding the party switch enable flag here.
  540. #==============================================================================
  541. class Game_System
  542.   #--------------------------------------------------------------------------
  543.   # New Public Instance Variable
  544.   #--------------------------------------------------------------------------
  545.   attr_accessor  :starting_party
  546.   #--------------------------------------------------------------------------
  547.   # Alias Method: Initialize
  548.   #--------------------------------------------------------------------------
  549.   alias sixth_party_switcher134 initialize
  550.   def initialize
  551.     sixth_party_switcher134
  552.     @starting_party = -1
  553.   end
  554. end
  555. #==============================================================================
  556. # Game_Interpreter
  557. #------------------------------------------------------------------------------
  558. # Adding the new script call here.
  559. #==============================================================================
  560. class Game_Interpreter
  561.   #--------------------------------------------------------------------------
  562.   # Party Manager Scene Script Call
  563.   #--------------------------------------------------------------------------
  564.   def enter_party_scene(info=[])
  565.     SceneManager.call(Scene_Party_Manager_S)
  566.     SceneManager.scene.prepare(info)
  567.   end
  568.   #--------------------------------------------------------------------------
  569.   # Actor Lock Script Call
  570.   #--------------------------------------------------------------------------
  571.   def pm_lock_actor(actor_id)
  572.     actor_id.each do |id|
  573.       $game_actors[id].actor_lock_in_party = true
  574.     end
  575.   end
  576.   #--------------------------------------------------------------------------
  577.   # Actor Unlock Script Call
  578.   #--------------------------------------------------------------------------
  579.   def pm_unlock_actor(actor_id)
  580.     actor_id.each do |id|
  581.       $game_actors[id].actor_lock_in_party = false
  582.     end
  583.   end
  584.   #--------------------------------------------------------------------------
  585.   # Starting Party Script Call
  586.   #--------------------------------------------------------------------------
  587.   def pm_starting_party(party_id)
  588.     $game_system.starting_party = party_id
  589.   end
  590. end
  591. #==============================================================================
  592. # Scene_Party_Manager_S
  593. #------------------------------------------------------------------------------
  594. # The scene for the party manager.
  595. #==============================================================================
  596. class Scene_Party_Manager_S < Scene_Base
  597.   #--------------------------------------------------------------------------
  598.   # Scene Startup
  599.   #--------------------------------------------------------------------------
  600.   def start
  601.     super
  602.     @stat_shower_index = 0
  603.     @party_index = 0
  604.     @pmem_index = 0
  605.     @c_mem_index = 0
  606.     @view_index = 0
  607.     @pm_viewport = Viewport.new
  608.     @pm_viewport.oy = PM_Scene::Parties_Window[1]
  609.     create_all_windows
  610.     create_ud_arrows
  611.     @maxi = [@parties.size,PM_Scene::MaxPartyAtOnce].min
  612.   end
  613.   #--------------------------------------------------------------------------
  614.   # Preparing Info
  615.   #--------------------------------------------------------------------------
  616.   def prepare(info)
  617.     @partiess = Array.new
  618.     @locked_members = Array.new
  619.     info.each do |party| # [party_id,[starting_actor_ids],[map_id, map_x, map_y],[min_mem,max_mem],"custom_text"]
  620.       @locked_members[info.index(party)] = Array.new
  621.       @partiess[info.index(party)] = [party[0],party[1],party[2],party[3],party[4]]
  622.       if party[1].size > 0
  623.         party[1].each do |actor_id|
  624.           if !$game_actors[actor_id].nil? && $game_party.members.include?($game_actors[actor_id])
  625.             $game_party.remove_actor(actor_id)
  626.             @locked_members[info.index(party)].push(actor_id)
  627.           else
  628.             @partiess[info.index(party)][1].delete(actor_id)
  629.           end
  630.         end
  631.       end
  632.     end  
  633.   end
  634.   #--------------------------------------------------------------------------
  635.   # Creating All Windows
  636.   #--------------------------------------------------------------------------
  637.   def create_all_windows
  638.     create_help_window
  639.     create_command_window
  640.     create_party_member_window
  641.     create_parties_window
  642.     create_party_select_big
  643.     create_stat_window
  644.   end
  645.   #--------------------------------------------------------------------------
  646.   # Creating the Help Window
  647.   #--------------------------------------------------------------------------
  648.   def create_help_window
  649.     @helpy = PM_Help.new
  650.   end
  651.   #--------------------------------------------------------------------------
  652.   # Creating the Command Window
  653.   #--------------------------------------------------------------------------
  654.   def create_command_window
  655.     @commands = PM_Commands.new(@partiess)
  656.     @commands.set_handler(:on_arrange, method(:arrange_members))
  657.     @commands.set_handler(:on_finish, method(:starting_party_select))
  658.   end
  659.   #--------------------------------------------------------------------------
  660.   # Creating the Current Party Members Window
  661.   #--------------------------------------------------------------------------
  662.   def create_party_member_window
  663.     @members = PM_Members.new
  664.     @members.set_handler(:on_member, method(:member_popup))
  665.     @members.set_handler(:on_cancel, method(:confirm_cancel))
  666.     @members.set_handler(:cancel, method(:confirm_cancel))
  667.     @members.deactivate
  668.     @members.unselect
  669.   end
  670.   #--------------------------------------------------------------------------
  671.   # Creating the Parties Windows
  672.   #--------------------------------------------------------------------------
  673.   def create_parties_window
  674.     @parties = Array.new
  675.     @partiess.each_with_index do |party,i|
  676.       @parties[i] = PM_Parties.new(@partiess[i],i,@partiess.size,@locked_members[i])
  677.       @parties[i].set_handler(:on_member_new, method(:member_remove))
  678.       @parties[i].set_handler(:on_cancel, method(:confirm_cancel_par))
  679.       @parties[i].set_handler(:cancel, method(:confirm_cancel_par))
  680.       @parties[i].viewport = @pm_viewport
  681.       @parties[i].deactivate
  682.       @parties[i].unselect
  683.     end
  684.   end
  685.   #--------------------------------------------------------------------------
  686.   # Creating the Stat Window
  687.   #--------------------------------------------------------------------------
  688.   def create_stat_window
  689.     @stat_win = PM_Stat_Shower.new
  690.     @stat_win.opacity = 0
  691.     @stat_win.contents_opacity = 0
  692.   end
  693.   #--------------------------------------------------------------------------
  694.   # Creating the Party Selection Window
  695.   #--------------------------------------------------------------------------
  696.   def create_party_select_big
  697.     @partybig = PM_Party_Select_Big.new(@partiess)
  698.     @partybig.set_handler(:on_location_ok, method(:select_location))
  699.     @partybig.set_handler(:cancel, method(:confirm_cancel_pop))
  700.     @partybig.viewport = @pm_viewport
  701.     @partybig.unselect
  702.   end
  703.   #--------------------------------------------------------------------------
  704.   # Creating the Arrows
  705.   #--------------------------------------------------------------------------
  706.   def create_ud_arrows
  707.     @uarrow = Sprite.new
  708.     @darrow = Sprite.new
  709.     @uarrow.bitmap = Cache.system(PM_Scene::Arrow_U[0])
  710.     @darrow.bitmap = Cache.system(PM_Scene::Arrow_D[0])
  711.     if PM_Scene::Arrow_U[1][0] == :center
  712.       @ucenter = PM_Scene::Parties_Window[0]+(PM_Scene::Parties_Window[2]-@uarrow.bitmap.width)/2
  713.       @uarrow.x = @ucenter
  714.     else
  715.       @uarrow.x = PM_Scene::Arrow_U[1][0]
  716.     end
  717.     if PM_Scene::Arrow_D[1][0] == :center
  718.       @dcenter = PM_Scene::Parties_Window[0]+(PM_Scene::Parties_Window[2]-@darrow.bitmap.width)/2
  719.       @darrow.x = @dcenter
  720.     else
  721.       @darrow.x = PM_Scene::Arrow_D[1][0]
  722.     end
  723.     @uarrow.y = PM_Scene::Parties_Window[1]+PM_Scene::Arrow_U[1][1]
  724.     @darrow.y = PM_Scene::Parties_Window[1]+PM_Scene::Parties_Window[3]+PM_Scene::Arrow_D[1][1]-@darrow.bitmap.height
  725.     @uarrow.opacity = 0
  726.     if @parties.size > PM_Scene::MaxPartyAtOnce
  727.       @darrow.opacity = 255
  728.     else
  729.       @darrow.opacity = 0
  730.     end
  731.   end
  732.   #--------------------------------------------------------------------------
  733.   # Confirm Method on the Arrange Command
  734.   #--------------------------------------------------------------------------
  735.   def arrange_members
  736.     Sound.play_ok
  737.     @commands.deactivate
  738.     @helpy.refresh(1)
  739.     @members.select(@c_mem_index)
  740.     @members.activate
  741.   end
  742.   #--------------------------------------------------------------------------
  743.   # Starting Party Selection Method
  744.   #--------------------------------------------------------------------------
  745.   def starting_party_select
  746.     Sound.play_ok
  747.     @partybig.finish = true
  748.     @commands.deactivate
  749.     @helpy.refresh(3)
  750.     if $game_system.starting_party == -1
  751.       refresh_every_window
  752.       @partybig.select(@party_index)
  753.       @partybig.activate
  754.     else
  755.       exit_pm_scene
  756.     end
  757.   end
  758.   #--------------------------------------------------------------------------
  759.   # Arrange Finish Method
  760.   #--------------------------------------------------------------------------
  761.   def exit_pm_scene
  762.     PM_Scene::Arrange_Fin.play
  763.     @partiess.each do |party|
  764.       id = party[0]
  765.       members = party[1]
  766.       location = Game_Location.new(party[2][0], party[2][1], party[2][2])
  767.       $game_parties.create_party(id, members, location)
  768.     end
  769.     if $game_system.starting_party == -1
  770.       $game_parties.switch_party(@partiess[@partybig.index][0])
  771.     else
  772.       $game_parties.switch_party($game_system.starting_party)
  773.     end
  774.     return_scene
  775.   end
  776.   #--------------------------------------------------------------------------
  777.   # Disposing the Parties Windows
  778.   #--------------------------------------------------------------------------
  779.   def dispose_stuffs
  780.     @parties.each do |party_win|
  781.       party_win.dispose
  782.     end
  783.     @pm_viewport.dispose
  784.     @uarrow.bitmap.dispose
  785.     @darrow.bitmap.dispose
  786.     @uarrow.dispose
  787.     @darrow.dispose    
  788.   end
  789.   #--------------------------------------------------------------------------
  790.   # Confirm Method on the Current Party Members Window
  791.   #--------------------------------------------------------------------------
  792.   def member_popup
  793.     Sound.play_ok
  794.     @stat_win.opacity = 0
  795.     @stat_win.contents_opacity = 0
  796.     @selected_member = @members.current_ext
  797.     @members.deactivate
  798.     @partybig.select(@party_index)
  799.     @partybig.activate
  800.     @helpy.refresh(2)
  801.     refresh_every_window
  802.   end
  803.   #--------------------------------------------------------------------------
  804.   # Confirm Method on the Parties Windows
  805.   #--------------------------------------------------------------------------
  806.   def member_remove
  807.     @selected_member = @parties[@party_index].current_ext
  808.     PM_Scene::Member_Rem.play
  809.     @partiess[@party_index][1].delete(@selected_member)
  810.     $game_party.add_actor(@selected_member)
  811.     refresh_every_window
  812.     @parties[@party_index].activate
  813.   end
  814.   #--------------------------------------------------------------------------
  815.   # Cancel Method on the Current Party Members Window
  816.   #--------------------------------------------------------------------------
  817.   def confirm_cancel
  818.     Sound.play_cancel
  819.     @stat_win.opacity = 0
  820.     @stat_win.contents_opacity = 0
  821.     @c_mem_index = @members.index
  822.     @members.deactivate
  823.     @members.unselect
  824.     @helpy.refresh(0)
  825.     @commands.activate
  826.   end
  827.   #--------------------------------------------------------------------------
  828.   # Confirm Method on the Party Selection Window
  829.   #--------------------------------------------------------------------------
  830.   def select_location
  831.     if @partybig.finish == false
  832.       PM_Scene::Member_Add.play
  833.       $game_party.remove_actor(@selected_member)
  834.       @partiess[@partybig.index][1].push(@selected_member)
  835.       @partybig.unselect
  836.       @partybig.deactivate
  837.       @members.activate
  838.       @helpy.refresh(1)
  839.       refresh_every_window
  840.     else
  841.       exit_pm_scene
  842.     end
  843.   end
  844.   #--------------------------------------------------------------------------
  845.   # * Cancel Method on the Party Selection Window
  846.   #--------------------------------------------------------------------------
  847.   def confirm_cancel_pop
  848.     if @partybig.finish == false
  849.       Sound.play_cancel
  850.       @partybig.unselect
  851.       @partybig.deactivate
  852.       @helpy.refresh(1)
  853.       @members.activate
  854.     else
  855.       Sound.play_cancel
  856.       @partybig.unselect
  857.       @partybig.deactivate
  858.       @helpy.refresh(0)
  859.       @partybig.finish = false
  860.       @commands.activate
  861.     end
  862.   end
  863.   #--------------------------------------------------------------------------
  864.   # Cancel Method on the Parties Windows
  865.   #--------------------------------------------------------------------------
  866.   def confirm_cancel_par
  867.     Sound.play_cancel
  868.     @stat_win.opacity = 0
  869.     @stat_win.contents_opacity = 0
  870.     @parties[@party_index].deactivate
  871.     @parties[@party_index].unselect
  872.     @commands.activate
  873.   end
  874.   #--------------------------------------------------------------------------
  875.   # Refresh Windows
  876.   #--------------------------------------------------------------------------
  877.   def refresh_every_window
  878.     @members.refresh
  879.     @parties[@party_index].refresh
  880.     @partybig.refresh
  881.     @commands.refresh
  882.   end
  883.   #--------------------------------------------------------------------------
  884.   # Dispose All Windows
  885.   #--------------------------------------------------------------------------
  886.   def dispose_all_windows
  887.     dispose_stuffs
  888.     super
  889.   end
  890.   #--------------------------------------------------------------------------
  891.   # Update the party windows
  892.   #--------------------------------------------------------------------------
  893.   def update_parties_windows
  894.     @parties.each do |window|
  895.       window.update if window.is_a?(Window)
  896.     end
  897.   end
  898.   #--------------------------------------------------------------------------
  899.   # Update
  900.   #--------------------------------------------------------------------------
  901.   def update
  902.     super
  903.     update_parties_windows
  904.     if @members.active == true
  905.       if @stat_shower_index != @members.current_ext
  906.         @stat_shower_index = @members.current_ext
  907.         @stat_win.refresh(@stat_shower_index) if @stat_win.opacity == 255
  908.       end
  909.       if Input.trigger?(PM_Scene::Window_Switch)
  910.         @no_more = true
  911.         @c_mem_index = @members.index
  912.         Sound.play_cursor
  913.         while @pmem_index > @parties[@party_index].item_max - 1
  914.           @pmem_index -= 1
  915.         end
  916.         @parties[@party_index].select(@pmem_index)
  917.         @parties[@party_index].activate
  918.         @members.deactivate
  919.         @members.unselect
  920.       end
  921.     end
  922.     if !@parties[@party_index].disposed? && @parties[@party_index].active == true
  923.       if @stat_shower_index != @parties[@party_index].current_ext
  924.         @stat_shower_index = @parties[@party_index].current_ext
  925.         @stat_win.refresh(@stat_shower_index) if @stat_win.opacity == 255
  926.       end
  927.       if Input.trigger?(PM_Scene::Window_Switch) && @no_more == false
  928.         Sound.play_cursor
  929.         @pmem_index = @parties[@party_index].index
  930.         @parties[@party_index].deactivate
  931.         @parties[@party_index].unselect
  932.         @members.select(@c_mem_index)
  933.         @members.activate
  934.       end
  935.       @no_more = false if @no_more == true
  936.       if Input.trigger?(:DOWN) && !Input.trigger?(:UP)
  937.         pressing_down(true)
  938.       end
  939.       if Input.trigger?(:UP) && !Input.trigger?(:DOWN)
  940.         pressing_up(true)
  941.       end
  942.       if Input.trigger?(:ALT)
  943.         @parties[@party_index].select(@parties[@party_index].item_max-1)
  944.       end
  945.     end
  946.     if @partybig.active == true
  947.       if Input.trigger?(:DOWN) && !Input.trigger?(:UP)
  948.         pressing_down
  949.       end
  950.       if Input.trigger?(:UP) && !Input.trigger?(:DOWN)
  951.         pressing_up
  952.       end
  953.     end
  954.     if @commands.active == false && @partybig.active == false
  955.       if Input.trigger?(PM_Scene::Status_Window)
  956.         PM_Scene::Stats_Open.play
  957.         if @stat_win.opacity == 0
  958.           @stat_win.opacity = 255
  959.           @stat_win.contents_opacity = 255
  960.           @stat_win.refresh(@stat_shower_index)
  961.         else
  962.           @stat_win.opacity = 0
  963.           @stat_win.contents_opacity = 0
  964.         end
  965.       end
  966.       if Input.trigger?(PM_Scene::Status_Toggle) && @stat_win.opacity == 255
  967.         PM_Scene::Toggle_Stat.play
  968.         if @stat_win.pm_toggler < PM_Scene::Max_Page - 1
  969.           @stat_win.pm_toggler += 1
  970.         else
  971.           @stat_win.pm_toggler = 0
  972.         end
  973.         @stat_win.refresh(@stat_shower_index)
  974.       end
  975.     end
  976.   end
  977.   #--------------------------------------------------------------------------
  978.   # Pressing down processing
  979.   #--------------------------------------------------------------------------
  980.   def pressing_down(p_win=false)
  981.     @party_last = @party_index
  982.     Sound.play_cursor if p_win == true
  983.     @party_index += 1
  984.     if @party_index > @parties.size - 1
  985.       @party_index = 0
  986.     end
  987.     if @view_index < @maxi
  988.       @view_index += 1
  989.     end
  990.     if p_win == true
  991.       @pmem_index = @parties[@party_last].index
  992.       while @pmem_index > @parties[@party_index].item_max - 1
  993.         @pmem_index -= 1
  994.       end
  995.       @parties[@party_index].select(@pmem_index)
  996.       @parties[@party_index].activate
  997.       @parties[@party_last].deactivate
  998.       @parties[@party_last].unselect
  999.     end
  1000.     if @view_index == @maxi
  1001.       unless @pm_viewport.oy + @parties[@party_index].height > @parties[@parties.size - @maxi].y ||
  1002.              @pm_viewport.oy == @parties[@party_index-(@maxi-1)].y
  1003.         @pm_viewport.oy += @parties[@party_index].height
  1004.       end
  1005.     end
  1006.     if @party_index == 0
  1007.       @pm_viewport.oy = PM_Scene::Parties_Window[1]
  1008.       @view_index = 0
  1009.     end
  1010.     check_arrow_display
  1011.   end
  1012.   #--------------------------------------------------------------------------
  1013.   # Pressing up processing
  1014.   #--------------------------------------------------------------------------
  1015.   def pressing_up(p_win=false)
  1016.     @party_last = @party_index
  1017.     Sound.play_cursor if p_win == true
  1018.     @party_index -= 1
  1019.     if @party_index < 0
  1020.       @party_index = @parties.size - 1
  1021.     end
  1022.     if @view_index > 0
  1023.       @view_index -= 1
  1024.     end
  1025.     if p_win == true
  1026.       @pmem_index = @parties[@party_last].index
  1027.       while @pmem_index > @parties[@party_index].item_max - 1
  1028.         @pmem_index -= 1
  1029.       end
  1030.       @parties[@party_index].select(@pmem_index)
  1031.       @parties[@party_index].activate
  1032.       @parties[@party_last].deactivate
  1033.       @parties[@party_last].unselect
  1034.     end
  1035.     if @view_index == 0
  1036.       unless @pm_viewport.oy - @parties[@party_index].height < @parties[0].y ||
  1037.              @pm_viewport.oy == @parties[@party_index].y
  1038.         @pm_viewport.oy -= @parties[@party_index].height
  1039.       end
  1040.     end
  1041.     if @party_index == @parties.size - 1
  1042.       @pm_viewport.oy = @parties[@parties.size - @maxi].y
  1043.       @view_index = @maxi
  1044.     end
  1045.     check_arrow_display
  1046.   end
  1047.   #--------------------------------------------------------------------------
  1048.   # Show/hide up and down arrows method
  1049.   #--------------------------------------------------------------------------
  1050.   def check_arrow_display
  1051.     if @pm_viewport.oy + @parties[@party_index].height > @parties[@parties.size - @maxi].y
  1052.       @darrow.opacity = 0
  1053.     else
  1054.       @darrow.opacity = 255
  1055.     end
  1056.     if @pm_viewport.oy - @parties[@party_index].height < @parties[0].y
  1057.       @uarrow.opacity = 0
  1058.     else
  1059.       @uarrow.opacity = 255
  1060.     end
  1061.   end
  1062. end
  1063. #==============================================================================
  1064. # Cache
  1065. #------------------------------------------------------------------------------
  1066. # Adding the face image scaling method here. Credit for Blackmourning for this!
  1067. #==============================================================================
  1068. if !$imported[:bm_base]
  1069.   module Cache  
  1070.     #--------------------------------------------------------------------------
  1071.     # Storage Image - by Blackmourning!
  1072.     #--------------------------------------------------------------------------
  1073.     def self.storage_image(bitmap, name)
  1074.       @image_cache ||= {}
  1075.       @image_cache[name] = bitmap unless @image_cache.has_key?(name)
  1076.       @image_cache[name]
  1077.     end  
  1078.   end
  1079. end
  1080. #==============================================================================
  1081. # Window_Base
  1082. #------------------------------------------------------------------------------
  1083. # Adding the face image scaling method here. Credit for Blackmourning for this!
  1084. #==============================================================================
  1085. class Window_Base < Window
  1086.   if !$imported[:bm_base]
  1087.     #--------------------------------------------------------------------------
  1088.     # Draw Icon Face - by Blackmourning!
  1089.     #--------------------------------------------------------------------------
  1090.     def draw_icon_face(actor, dest_rect, enabled)
  1091.       bitmap = Cache.face(actor.face_name)
  1092.       rect = Rect.new(actor.face_index % 4 * 96, actor.face_index / 4 * 96, 96, 96)
  1093.       bitmap.blur if dest_rect.width < 96/2
  1094.       cache = Bitmap.new(dest_rect.width, dest_rect.height)
  1095.       cache.stretch_blt(Rect.new(0,0,dest_rect.width, dest_rect.height), bitmap, rect)
  1096.       Cache.storage_image(cache, actor.face_name + actor.face_index.to_s)
  1097.       bitmap.dispose
  1098.       contents.stretch_blt(dest_rect, cache, Rect.new(0,0,cache.width,cache.height), enabled ? 255 : translucent_alpha)
  1099.     end
  1100.   end
  1101.   #--------------------------------------------------------------------------
  1102.   # Draw Text Ex without the font settings reset
  1103.   #--------------------------------------------------------------------------
  1104.   def draw_text_ex_sixth12333(x, y, text)
  1105.     text = convert_escape_characters(text)
  1106.     pos = {:x => x, :y => y, :new_x => x, :height => calc_line_height(text)}
  1107.     process_character(text.slice!(0, 1), text, pos) until text.empty?
  1108.   end
  1109. end
  1110. #==============================================================================
  1111. # PM_Stat_Shower
  1112. #------------------------------------------------------------------------------
  1113. # Stat window for showing the player the stats of the selected actor.
  1114. #==============================================================================
  1115. class PM_Stat_Shower < Window_Base
  1116.   #--------------------------------------------------------------------------
  1117.   # New Public Instance Variable
  1118.   #--------------------------------------------------------------------------
  1119.   attr_accessor  :pm_toggler
  1120.   #--------------------------------------------------------------------------
  1121.   # Initialize
  1122.   #--------------------------------------------------------------------------
  1123.   def initialize
  1124.     @pm_toggler = 0
  1125.     xs = PM_Scene::Stat_Window[0]
  1126.     ys = PM_Scene::Stat_Window[1]
  1127.     ws = PM_Scene::Stat_Window[2]
  1128.     hs = PM_Scene::Stat_Window[3].max
  1129.     super(xs, ys, ws, hs)
  1130.     self.windowskin = Cache.system(PM_Scene::Stat_Window[4])
  1131.   end  
  1132.   #--------------------------------------------------------------------------
  1133.   # Refresh
  1134.   #--------------------------------------------------------------------------
  1135.   def refresh(index)
  1136.     contents.clear
  1137.     if index.nil?
  1138.       if PM_Scene::Dynamic_Stat_Height == true
  1139.         self.height = PM_Scene::Stat_Window[3][2]
  1140.         self.y = Graphics.height - self.height
  1141.         create_contents
  1142.       end
  1143.       contents.font.name = PM_Scene::Stat_Font[0]
  1144.       contents.font.size = PM_Scene::Stat_Font[1]
  1145.       change_color(Color.new(*PM_Scene::No_Member))
  1146.       draw_text(0,0,contents.width,contents.height,PM_Scene::Texty[16],1)
  1147.     else
  1148.       if PM_Scene::Dynamic_Stat_Height == true
  1149.         if @pm_toggler == PM_Scene::Page_Setup[:params]-1
  1150.           self.height = PM_Scene::Stat_Window[3][0]
  1151.           self.y = Graphics.height - self.height
  1152.         elsif @pm_toggler == PM_Scene::Page_Setup[:equips]-1
  1153.           self.height = PM_Scene::Stat_Window[3][1]
  1154.           self.y = Graphics.height - self.height
  1155.         end
  1156.         create_contents
  1157.       end
  1158.       contents.font.name = PM_Scene::Stat_Font[0]
  1159.       contents.font.size = PM_Scene::Stat_Font[1]
  1160.       @actor = $game_actors[index]
  1161.       @color1 = Color.new(*PM_Scene::Box_Colors[0])
  1162.       @color2 = Color.new(*PM_Scene::Box_Colors[1])
  1163.       @color3 = Color.new(*PM_Scene::TextBox_C)
  1164.       draw_actor_face(@actor,PM_Scene::Face_X,PM_Scene::Face_Y,true)
  1165.       xb = PM_Scene::Base_Info_X; xi = PM_Scene::Dtls_Info_X
  1166.       yb = PM_Scene::Base_Info_Y; yi = PM_Scene::Dtls_Info_Y
  1167.       wb = PM_Scene::Base_Info_W; wi = PM_Scene::Dtls_Info_W
  1168.       contents.fill_rect(xb-4,yb-10,wb+8,3,@color1)
  1169.       contents.fill_rect(xb-4,yb-7,wb+8,2,@color2)
  1170.       change_color(system_color)
  1171.       draw_text(xb,yb-25,wb,line_height,PM_Scene::Texty[17],1)
  1172.       draw_basic_info(xb,yb,wb,line_height)
  1173.       draw_top_line(xi,yi,wi,line_height)
  1174.       if @pm_toggler == PM_Scene::Page_Setup[:params]-1
  1175.         draw_params_att(xi,yi-2,wi,line_height)
  1176.       elsif @pm_toggler == PM_Scene::Page_Setup[:equips]-1
  1177.         draw_equips_att(xi,yi-2,wi,line_height)
  1178.       end
  1179.       draw_all_lines(xi,yi,wi,@yy)
  1180.     end
  1181.   end
  1182.   #--------------------------------------------------------------------------
  1183.   # Drawing the top line of the box
  1184.   #--------------------------------------------------------------------------
  1185.   def draw_top_line(x,y,width,height)
  1186.     contents.fill_rect(x-15,y-line_height+12,width+30,3,@color1)
  1187.     contents.fill_rect(x-15,y-line_height+15,width+30,2,@color2)
  1188.     change_color(system_color)
  1189.   end
  1190.   #--------------------------------------------------------------------------
  1191.   # Drawing the rest of the box lines
  1192.   #--------------------------------------------------------------------------
  1193.   def draw_all_lines(x,y,width,height)
  1194.     contents.fill_rect(x-15,y-line_height+14,3,height+15,@color1)
  1195.     contents.fill_rect(x-12,y-line_height+17,2,height+10,@color2)
  1196.     contents.fill_rect(x+width+12,y-line_height+14,3,height+15,@color1)
  1197.     contents.fill_rect(x+width+10,y-line_height+17,2,height+10,@color2)
  1198.     contents.fill_rect(x-15,y-line_height+29+height,width+30,3,@color1)
  1199.     contents.fill_rect(x-12,y-line_height+27+height,width+24,2,@color2)
  1200.   end
  1201.   #--------------------------------------------------------------------------
  1202.   # Drawing the basic info
  1203.   #--------------------------------------------------------------------------
  1204.   def draw_basic_info(x,y,width,height)
  1205.     @y1 = 0
  1206.     3.times do
  1207.       contents.fill_rect(x-4,y+1+@y1,width+8,height-2,@color3)              
  1208.       @y1 += line_height
  1209.     end
  1210.     draw_text(x,y,width,line_height,PM_Scene::Texty[13])
  1211.     draw_text(x,y+line_height,width,line_height,PM_Scene::Texty[14])
  1212.     draw_text(x,y+line_height*2,width,line_height,PM_Scene::Texty[15])
  1213.     change_color(normal_color)
  1214.     draw_text(x,y,width,line_height,@actor.name,2)
  1215.     if $imported[:bm_titles]
  1216.       draw_text(x,y+line_height*2,width,line_height,Vocab.titles_name(@actor.title_id),2)
  1217.     else
  1218.       draw_text(x,y+line_height*2,width,line_height,@actor.nickname,2)
  1219.     end
  1220.     if $imported["CXJ-ClassExtensions"]
  1221.       if @actor.subclass.nil?
  1222.         text = @actor.class.name
  1223.       elsif !@actor.class.combined_name[@actor.subclass_id].nil?
  1224.         text = @actor.class.combined_name[@actor.subclass_id]
  1225.       else
  1226.         fmt = YEA::CLASS_SYSTEM::SUBCLASS_TEXT
  1227.         text = sprintf(fmt, @actor.class.name, @actor.subclass.name)
  1228.       end
  1229.     elsif $imported["YEA-ClassSystem"]
  1230.       fmt = YEA::CLASS_SYSTEM::SUBCLASS_TEXT
  1231.       if @actor.subclass
  1232.         text = sprintf(fmt, @actor.class.name, @actor.subclass.name)
  1233.       else
  1234.         text = @actor.class.name
  1235.       end
  1236.     else
  1237.       text = @actor.class.name
  1238.     end
  1239.     draw_text(x,y+line_height,width,line_height,text,2)
  1240.   end
  1241.   #--------------------------------------------------------------------------
  1242.   # Drawing equip info
  1243.   #--------------------------------------------------------------------------
  1244.   def draw_equips_att(x,y,width,height)
  1245.     change_color(system_color)
  1246.     draw_text(x,y-line_height-1,width,line_height,PM_Scene::Texty[11],1)
  1247.     @yy = 0
  1248.     @actor.equip_slots.each_with_index do |etype, i|
  1249.       if !PM_Scene::Equip_Exclude.include?(i)
  1250.         equip = @actor.equips[i]
  1251.         contents.fill_rect(x-4,y+1+@yy,width+8,height-2,@color3)              
  1252.         change_color(system_color)
  1253.         draw_text(x,y+@yy,width,height,Vocab::etype(etype))
  1254.         change_color(normal_color)
  1255.         if equip != nil
  1256.           xe = width-text_size(equip.name).width+PM_Scene::Item_X_Offset
  1257.           draw_item_name(equip,xe,y+@yy,true,width)
  1258.         else
  1259.           draw_text(x,y+@yy,width,height,PM_Scene::Texty[12],2)
  1260.         end
  1261.         @yy += line_height
  1262.       end
  1263.     end
  1264.   end
  1265.   #--------------------------------------------------------------------------
  1266.   # Drawing param info
  1267.   #--------------------------------------------------------------------------
  1268.   def draw_params_att(x,y,width,height)
  1269.     draw_text(x,y-line_height-1,width,line_height,PM_Scene::Texty[10],1)
  1270.     @yy = 0
  1271.     @id = 0
  1272.     $data_system.terms.params.each do |par|
  1273.       if PM_Scene::Include_Params.include?(@id)
  1274.         contents.fill_rect(x-4,y+1+@yy,width+8,height-2,@color3)
  1275.         change_color(system_color)
  1276.         draw_text(x,y+@yy,width,height,Vocab::param(@id))
  1277.         change_color(normal_color)
  1278.         text = sprintf("%d", @actor.param(@id))
  1279.         draw_text(x,y+@yy,width,height,text,2)
  1280.         @yy += line_height
  1281.       end
  1282.       @id += 1
  1283.     end  
  1284.   end
  1285. end
  1286. #==============================================================================
  1287. # PM_Help
  1288. #------------------------------------------------------------------------------
  1289. # Help Window for the scene.
  1290. #==============================================================================
  1291. class PM_Help < Window_Base
  1292.   #--------------------------------------------------------------------------
  1293.   # Initialize
  1294.   #--------------------------------------------------------------------------
  1295.   def initialize
  1296.     xs = PM_Scene::Help_Window[0]
  1297.     ys = PM_Scene::Help_Window[1]
  1298.     ws = PM_Scene::Help_Window[2]
  1299.     hs = PM_Scene::Help_Window[3]
  1300.     super(xs, ys, ws, hs)
  1301.     self.windowskin = Cache.system(PM_Scene::Help_Window[4])
  1302.     contents.font.name = PM_Scene::Help_Font[0]
  1303.     contents.font.size = PM_Scene::Help_Font[1]
  1304.     refresh(0)
  1305.   end
  1306.   #--------------------------------------------------------------------------
  1307.   # Refresh
  1308.   #--------------------------------------------------------------------------
  1309.   def refresh(index)
  1310.     contents.clear
  1311.     case index
  1312.     when 0
  1313.       text = PM_Scene::Texty[2]
  1314.     when 1
  1315.       text = PM_Scene::Texty[3]
  1316.     when 2
  1317.       text = PM_Scene::Texty[4]
  1318.     when 3
  1319.       text = PM_Scene::Texty[5]
  1320.     end
  1321.     draw_text(0,0,contents.width,contents.height,text,1)
  1322.   end
  1323. end
  1324. #==============================================================================
  1325. # PM_Commands
  1326. #------------------------------------------------------------------------------
  1327. # Command Window for the scene.
  1328. #==============================================================================
  1329. class PM_Commands < Window_Command
  1330.   #--------------------------------------------------------------------------
  1331.   # Initialize
  1332.   #--------------------------------------------------------------------------
  1333.   def initialize(parties)
  1334.     @parties_c = parties
  1335.     xs = PM_Scene::Command_Window[0]
  1336.     ys = PM_Scene::Command_Window[1]
  1337.     super(xs, ys)
  1338.     self.windowskin = Cache.system(PM_Scene::Command_Window[4])
  1339.   end
  1340.   #--------------------------------------------------------------------------
  1341.   # Window Width
  1342.   #--------------------------------------------------------------------------
  1343.   def window_width
  1344.     PM_Scene::Command_Window[2]
  1345.   end
  1346.   #--------------------------------------------------------------------------
  1347.   # Window Height
  1348.   #--------------------------------------------------------------------------
  1349.   def window_height
  1350.     PM_Scene::Command_Window[3]
  1351.   end
  1352.   #--------------------------------------------------------------------------
  1353.   # Alignment
  1354.   #--------------------------------------------------------------------------
  1355.   def alignment
  1356.     return 1
  1357.   end
  1358.   #--------------------------------------------------------------------------
  1359.   # Make Command List
  1360.   #--------------------------------------------------------------------------
  1361.   def make_command_list
  1362.     add_command(PM_Scene::Texty[0],:on_arrange)
  1363.     add_command(PM_Scene::Texty[1],:on_finish,can_exit)
  1364.   end
  1365.   #--------------------------------------------------------------------------
  1366.   # Can Exit
  1367.   #--------------------------------------------------------------------------
  1368.   def can_exit
  1369.     @oki = 0
  1370.     @parties_c.each do |party|
  1371.       if party[1].size >= party[3][0]
  1372.         @oki += 1
  1373.       end
  1374.     end
  1375.     if @oki >= @parties_c.size
  1376.       return true
  1377.     else
  1378.       return false
  1379.     end
  1380.   end
  1381.   #--------------------------------------------------------------------------
  1382.   # Draw Items
  1383.   #--------------------------------------------------------------------------
  1384.   def draw_item(index)
  1385.     contents.font.name = PM_Scene::Cmnd_Font[0]
  1386.     contents.font.size = PM_Scene::Cmnd_Font[1]
  1387.     super
  1388.   end
  1389.   #--------------------------------------------------------------------------
  1390.   # Process Ok
  1391.   #--------------------------------------------------------------------------
  1392.   def process_ok
  1393.     if current_item_enabled?
  1394.       Input.update
  1395.       deactivate
  1396.       call_ok_handler
  1397.     else
  1398.       Sound.play_buzzer
  1399.     end
  1400.   end
  1401. end
  1402. #==============================================================================
  1403. # PM_Members
  1404. #------------------------------------------------------------------------------
  1405. # Current Party Member Window for the scene.
  1406. #==============================================================================
  1407. class PM_Members < Window_Command
  1408.   #--------------------------------------------------------------------------
  1409.   # Initialize
  1410.   #--------------------------------------------------------------------------
  1411.   def initialize
  1412.     xs = PM_Scene::Members_Window[0]
  1413.     ys = PM_Scene::Members_Window[1]
  1414.     super(xs, ys)
  1415.     self.windowskin = Cache.system(PM_Scene::Members_Window[4])
  1416.   end
  1417.   #--------------------------------------------------------------------------
  1418.   # Window Width
  1419.   #--------------------------------------------------------------------------
  1420.   def window_width
  1421.     PM_Scene::Members_Window[2]
  1422.   end
  1423.   #--------------------------------------------------------------------------
  1424.   # Window Height
  1425.   #--------------------------------------------------------------------------
  1426.   def window_height
  1427.     PM_Scene::Members_Window[3]
  1428.   end
  1429.   #--------------------------------------------------------------------------
  1430.   # Alignment
  1431.   #--------------------------------------------------------------------------
  1432.   def alignment
  1433.     return 1
  1434.   end
  1435.   #--------------------------------------------------------------------------
  1436.   # Make Command List
  1437.   #--------------------------------------------------------------------------
  1438.   def make_command_list
  1439.     if $game_party.members.size <= 0
  1440.       add_command(PM_Scene::Texty[9],nil,false)
  1441.     else
  1442.       $game_party.members.each do |member|
  1443.         add_command(member.name, :on_member, can_assign_member(member), member.id)
  1444.       end
  1445.     end
  1446.   end
  1447.   #--------------------------------------------------------------------------
  1448.   # Enable/disable the member commands
  1449.   #--------------------------------------------------------------------------
  1450.   def can_assign_member(member)
  1451.     return false if member.actor_lock_in_party == true
  1452.     return true
  1453.   end
  1454.   #--------------------------------------------------------------------------
  1455.   # Refresh
  1456.   #--------------------------------------------------------------------------
  1457.   def refresh
  1458.     super
  1459.     if col_max > 1
  1460.       if index > item_max - 1
  1461.         cursor_left(true)
  1462.       end
  1463.     else
  1464.       if index > item_max - 1
  1465.         cursor_up(true)
  1466.       end
  1467.     end
  1468.   end
  1469.   #--------------------------------------------------------------------------
  1470.   # Draw Item
  1471.   #--------------------------------------------------------------------------
  1472.   def draw_item(index)
  1473.     contents.font.name = PM_Scene::Memb_Font[0]
  1474.     contents.font.size = PM_Scene::Memb_Font[1]
  1475.     super
  1476.   end
  1477.   #--------------------------------------------------------------------------
  1478.   # Process Ok
  1479.   #--------------------------------------------------------------------------
  1480.   def process_ok
  1481.     if current_item_enabled?
  1482.       Input.update
  1483.       deactivate
  1484.       call_ok_handler
  1485.     else
  1486.       Sound.play_buzzer
  1487.     end
  1488.   end
  1489. end
  1490. #==============================================================================
  1491. # PM_Parties
  1492. #------------------------------------------------------------------------------
  1493. # Party Window(s) for the scene.
  1494. #==============================================================================
  1495. class PM_Parties < Window_HorzCommand
  1496.   #--------------------------------------------------------------------------
  1497.   # Initialize
  1498.   #--------------------------------------------------------------------------
  1499.   def initialize(party,index,size,locked_members)
  1500.     @new_party = party
  1501.     @index_par = index
  1502.     @size = size
  1503.     @locked_mems = locked_members
  1504.     xs = PM_Scene::Parties_Window[0]
  1505.     if @size <= PM_Scene::MaxPartyAtOnce && PM_Scene::DefaultDivide == true
  1506.       ys = @index_par * (PM_Scene::Parties_Window[3]/@size)
  1507.     else
  1508.       ys = @index_par * (PM_Scene::Parties_Window[3]/PM_Scene::MaxPartyAtOnce)
  1509.     end
  1510.     super(xs, ys)
  1511.     self.windowskin = Cache.system(PM_Scene::Parties_Window[4])
  1512.   end
  1513.   #--------------------------------------------------------------------------
  1514.   # * Window Width
  1515.   #--------------------------------------------------------------------------
  1516.   def window_width
  1517.     PM_Scene::Parties_Window[2]
  1518.   end
  1519.   #--------------------------------------------------------------------------
  1520.   # Window Height
  1521.   #--------------------------------------------------------------------------
  1522.   def window_height
  1523.     if @size <= PM_Scene::MaxPartyAtOnce && PM_Scene::DefaultDivide == true
  1524.       height = PM_Scene::Parties_Window[3]/@size
  1525.       if PM_Scene::Parties_Window[3] % @size != 0
  1526.         if @index_par == @size - 1
  1527.           height += (PM_Scene::Parties_Window[3] % @size)
  1528.         end
  1529.       end
  1530.     else
  1531.       height = PM_Scene::Parties_Window[3]/PM_Scene::MaxPartyAtOnce
  1532.     end
  1533.     return height
  1534.   end
  1535.   #--------------------------------------------------------------------------
  1536.   # Max Columns
  1537.   #--------------------------------------------------------------------------
  1538.   def col_max
  1539.     PM_Scene::Max_Colums
  1540.   end
  1541.   #--------------------------------------------------------------------------
  1542.   # Max Rows
  1543.   #--------------------------------------------------------------------------
  1544.   def row_max
  1545.     return 1
  1546.   end
  1547.   #--------------------------------------------------------------------------
  1548.   # Standard Padding
  1549.   #--------------------------------------------------------------------------
  1550.   def standard_padding
  1551.     return 0
  1552.   end
  1553.   #--------------------------------------------------------------------------
  1554.   # Bottom Padding
  1555.   #--------------------------------------------------------------------------
  1556.   def update_padding_bottom
  1557.     self.padding_bottom = padding
  1558.   end
  1559.   #--------------------------------------------------------------------------
  1560.   # Spacing
  1561.   #--------------------------------------------------------------------------
  1562.   def spacing
  1563.     return PM_Scene::Spacing
  1564.   end
  1565.   #--------------------------------------------------------------------------
  1566.   # Item Width
  1567.   #--------------------------------------------------------------------------
  1568.   def item_width
  1569.     (width - 24 + spacing) / col_max - spacing
  1570.   end
  1571.   #--------------------------------------------------------------------------
  1572.   # Item Height
  1573.   #--------------------------------------------------------------------------
  1574.   def item_height
  1575.     window_height
  1576.   end
  1577.   #--------------------------------------------------------------------------
  1578.   # Top Col
  1579.   #--------------------------------------------------------------------------
  1580.   def top_col=(col)
  1581.     self.ox = (col < 0 ? 0 : col) * (item_width + spacing)
  1582.   end
  1583.   #--------------------------------------------------------------------------
  1584.   # Item Rect
  1585.   #--------------------------------------------------------------------------
  1586.   def item_rect(index)
  1587.     if @new_party[1].size <= 0
  1588.       rect = Rect.new
  1589.       rect.width = item_width
  1590.       rect.height = PM_Scene::Cursor_Height
  1591.       rect.x = (window_width-rect.width)/2
  1592.       y_add = ((window_height-standard_padding*2-line_height*2)-rect.height)/2
  1593.       rect.y = (index / col_max * item_height) + 48 + y_add + PM_Scene::Cursor_Y_Offset
  1594.       rect
  1595.     else
  1596.       rect = Rect.new
  1597.       rect.width = item_width
  1598.       rect.height = PM_Scene::Cursor_Height
  1599.       rect.x = index * (item_width + spacing) + 12
  1600.       y_add = ((window_height-standard_padding*2-line_height*2)-rect.height)/2
  1601.       rect.y = 48 + y_add + PM_Scene::Cursor_Y_Offset
  1602.       rect
  1603.     end
  1604.   end
  1605.   #--------------------------------------------------------------------------
  1606.   # Make Command List
  1607.   #--------------------------------------------------------------------------
  1608.   def make_command_list
  1609.     if @new_party[1].size <= 0
  1610.       add_command(PM_Scene::Texty[9],nil,false)
  1611.     else
  1612.       @new_party[1].each do |id|
  1613.         if !$game_actors[id].nil?
  1614.           add_command($game_actors[id].name, :on_member_new, member_enabled?(id), id)
  1615.         end
  1616.       end
  1617.     end
  1618.   end
  1619.   #--------------------------------------------------------------------------
  1620.   # Member can be removed?
  1621.   #--------------------------------------------------------------------------
  1622.   def member_enabled?(id)
  1623.     return true if !id.nil? && !@locked_mems.include?(id)
  1624.   end
  1625.   #--------------------------------------------------------------------------
  1626.   # Draw Item
  1627.   #--------------------------------------------------------------------------
  1628.   def draw_item(index)
  1629.     contents.font.name = PM_Scene::Name_Font[0]
  1630.     contents.font.size = PM_Scene::Name_Font[1]
  1631.     if @new_party[1].size <= 0
  1632.       super
  1633.     else
  1634.       rect = item_rect_for_text(index)
  1635.       face_wh = PM_Scene::Face_Size
  1636.       rect_face = Rect.new(rect.x+(rect.width-face_wh)/2,rect.y+4,face_wh,face_wh)
  1637.       draw_icon_face($game_actors[@list[index][:ext]],rect_face,true)
  1638.       if @locked_mems.include?(@list[index][:ext])
  1639.         change_color(Color.new(*PM_Scene::Locked_Mem))
  1640.       else
  1641.         change_color(Color.new(*PM_Scene::Enable_Mem))
  1642.       end
  1643.       rect.y += (28+PM_Scene::Name_Y_Offset)
  1644.       draw_text(rect, command_name(index),1)
  1645.     end
  1646.   end
  1647.   #--------------------------------------------------------------------------
  1648.   # Refresh
  1649.   #--------------------------------------------------------------------------
  1650.   def refresh
  1651.     super
  1652.     if col_max > 1
  1653.       if index > item_max - 1
  1654.         cursor_left(true)
  1655.       end
  1656.     else
  1657.       if index > item_max - 1
  1658.         cursor_up(true)
  1659.       end
  1660.     end
  1661.   end
  1662.   #--------------------------------------------------------------------------
  1663.   # Process Ok
  1664.   #--------------------------------------------------------------------------
  1665.   def process_ok
  1666.     if current_item_enabled?
  1667.       Input.update
  1668.       deactivate
  1669.       call_ok_handler
  1670.     else
  1671.       Sound.play_buzzer
  1672.     end
  1673.   end
  1674. end
  1675. #==============================================================================
  1676. # PM_Party_Select_Big
  1677. #------------------------------------------------------------------------------
  1678. # Party Selection Window for the scene.
  1679. #==============================================================================
  1680. class PM_Party_Select_Big < Window_Command
  1681.   #--------------------------------------------------------------------------
  1682.   # New Public Instance Variable
  1683.   #--------------------------------------------------------------------------
  1684.   attr_accessor  :finish
  1685.   #--------------------------------------------------------------------------
  1686.   # Initialize
  1687.   #--------------------------------------------------------------------------
  1688.   def initialize(parties)
  1689.     @parties_new = parties
  1690.     @finish = false
  1691.     xs = PM_Scene::Parties_Window[0]
  1692.     ys = PM_Scene::Parties_Window[1]
  1693.     super(xs, ys)
  1694.     self.windowskin = Cache.system(PM_Scene::Parties_Window[5])
  1695.     self.opacity = 0
  1696.     deactivate
  1697.   end
  1698.   #--------------------------------------------------------------------------
  1699.   # Window Width
  1700.   #--------------------------------------------------------------------------
  1701.   def window_width
  1702.     PM_Scene::Parties_Window[2]
  1703.   end
  1704.   #--------------------------------------------------------------------------
  1705.   # Window Height
  1706.   #--------------------------------------------------------------------------
  1707.   def window_height
  1708.     if @parties_new.size <= PM_Scene::MaxPartyAtOnce && PM_Scene::DefaultDivide == true
  1709.       height = @parties_new.size * (PM_Scene::Parties_Window[3]/@parties_new.size) #PM_Scene::Parties_Window[3]
  1710.       if PM_Scene::Parties_Window[3] % @parties_new.size != 0
  1711.         height += (PM_Scene::Parties_Window[3] % @parties_new.size)
  1712.       end
  1713.     else
  1714.       height = @parties_new.size * (PM_Scene::Parties_Window[3]/PM_Scene::MaxPartyAtOnce)
  1715.     end
  1716.     return height
  1717.   end
  1718.   #--------------------------------------------------------------------------
  1719.   # Standard Padding
  1720.   #--------------------------------------------------------------------------
  1721.   def standard_padding
  1722.     return 0
  1723.   end
  1724.   #--------------------------------------------------------------------------
  1725.   # Bottom Padding
  1726.   #--------------------------------------------------------------------------
  1727.   def update_padding_bottom
  1728.     self.padding_bottom = padding
  1729.   end
  1730.   #--------------------------------------------------------------------------
  1731.   # * Cursor Movement Processing
  1732.   #--------------------------------------------------------------------------
  1733.   def process_cursor_move
  1734.     return unless cursor_movable?
  1735.     last_index = @index
  1736.     cursor_down (Input.trigger?(:DOWN))   if Input.trigger?(:DOWN)
  1737.     cursor_up   (Input.trigger?(:UP))     if Input.trigger?(:UP)
  1738.     cursor_right(Input.trigger?(:RIGHT))  if Input.trigger?(:RIGHT)
  1739.     cursor_left (Input.trigger?(:LEFT))   if Input.trigger?(:LEFT)
  1740.     cursor_pagedown   if !handle?(:pagedown) && Input.trigger?(:R)
  1741.     cursor_pageup     if !handle?(:pageup)   && Input.trigger?(:L)
  1742.     Sound.play_cursor if @index != last_index
  1743.   end
  1744.   #--------------------------------------------------------------------------
  1745.   # Item Rect
  1746.   #--------------------------------------------------------------------------
  1747.   def item_rect(index)
  1748.     rect = Rect.new
  1749.     rect.width = item_width - 24
  1750.     rect.height = window_height/item_max - 24
  1751.     rect.x = index % col_max * (item_width + spacing) + 12
  1752.     rect.y = (index / col_max * (rect.height+24)) + 12
  1753.     rect
  1754.   end
  1755.   #--------------------------------------------------------------------------
  1756.   # Make Command List
  1757.   #--------------------------------------------------------------------------
  1758.   def make_command_list
  1759.     @parties_new.each do |party|
  1760.       max_mem = party[3][1]
  1761.       current_mem = party[1].size
  1762.       add_command("",:on_location_ok,can_place(current_mem,max_mem))
  1763.     end
  1764.   end
  1765.   #--------------------------------------------------------------------------
  1766.   # Can Place
  1767.   #--------------------------------------------------------------------------
  1768.   def can_place(current_mem,max_mem)
  1769.     if current_mem < max_mem || @finish == true
  1770.       return true
  1771.     else
  1772.       return false
  1773.     end
  1774.   end
  1775.   #--------------------------------------------------------------------------
  1776.   # Draw Party Info
  1777.   #--------------------------------------------------------------------------
  1778.   def draw_item(index)
  1779.     rect = item_rect_for_text(index)
  1780.     contents.font.name = PM_Scene::Info_Font[0]
  1781.     contents.font.size = PM_Scene::Info_Font[1]
  1782.     rect.height = line_height
  1783.     @pid = @parties_new[index]
  1784.     @color_ok = Color.new(*PM_Scene::Min_Mem_OK)
  1785.     @color_no = Color.new(*PM_Scene::Min_Mem_NO)
  1786.     @color_sy = Color.new(*PM_Scene::Status_Col)
  1787.     @color_ye = Color.new(*PM_Scene::Party_Col)  
  1788.     text1 = PM_Scene::Texty[8] + @pid[3][0].to_s
  1789.     text2 = PM_Scene::Texty[7] + @pid[1].size.to_s + " / " + @pid[3][1].to_s
  1790.     text3 = @pid[4]
  1791.     text4 = PM_Scene::Texty[6] + (index+1).to_s
  1792.     #custom text
  1793.     draw_text_ex_sixth12333(rect.x,rect.y,text3)
  1794.     #party index
  1795.     change_color(@color_ye)
  1796.     draw_text(rect,text4,1)
  1797.     #members required
  1798.     if @pid[1].size >= @pid[3][0]
  1799.       change_color(@color_ok)
  1800.     else
  1801.       change_color(@color_no)
  1802.     end
  1803.     draw_text(rect,text1,2)
  1804.     #current fill rate
  1805.     if @pid[1].size >= @pid[3][1]
  1806.       change_color(@color_no)
  1807.     else
  1808.       change_color(@color_sy)
  1809.     end
  1810.     rect.y += line_height
  1811.     draw_text(rect,text2,1)
  1812.     if @pid[1].size <= 0
  1813.       change_color(normal_color)
  1814.       contents.font.color.alpha = translucent_alpha
  1815.       rect = item_rect(index)
  1816.       rect.height -= line_height * 2
  1817.       rect.y += line_height*2
  1818.       draw_text(rect,PM_Scene::Texty[9],1)
  1819.     end
  1820.     change_color(normal_color)
  1821.   end
  1822.   #--------------------------------------------------------------------------
  1823.   # Process Ok
  1824.   #--------------------------------------------------------------------------
  1825.   def process_ok
  1826.     if current_item_enabled?
  1827.       Input.update
  1828.       deactivate
  1829.       call_ok_handler
  1830.     else
  1831.       Sound.play_buzzer
  1832.     end
  1833.   end
  1834. end
  1835. #==============================================================================
  1836. # !!END OF SCRIPT!!
  1837. #==============================================================================
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement