Advertisement
AngryPacman

PAC Party Management 2.0 β

Sep 1st, 2011
270
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 26.96 KB | None | 0 0
  1. #===============================================================================
  2. #
  3. # Pacman Advanced Creative (PAC) Engine - Party Management System (2.0 β)
  4. # 19/6/2011
  5. # Type: Scene
  6. # Installation: Script calls.
  7. # Level: Average
  8. # Thanks: Infinate X
  9. #
  10. #===============================================================================
  11. #
  12. # Description:
  13. # VX limits your party to having 4 members. Isn't that terrible? This script
  14. # won't give you more members in your party, rather be able to change them
  15. # throughout the game at the player's call. Read the instructions to find out
  16. # more.
  17. #
  18. #===============================================================================
  19. #
  20. # Instructions:
  21. # INSTALLATION
  22. # Paste above main, below materials, in the script editor (F11). Make sure you
  23. # save upon exiting.
  24. # SCRIPT CALLS
  25. # $data_actors[ID].found = true/false
  26. # Where ID is the ID of an actor in the database. This places an actor in the
  27. # reserves party, ready for selection by the player if true, and takes them
  28. # out if false.
  29. # $data_actors[ID].unavailable = true/false
  30. # Makes actor with the specified ID unavailable to the player in the reserves
  31. # party if true. If false, makes them available.
  32. # $data_actors[ID].required = true/false
  33. # Locks actor with specified ID to the actual party, ergo mandatory to the
  34. # player, if true. Unlocks the character if false.
  35. # For each of these calls you can use, instead of $data_actors[ID],
  36. # $game_party.members[position].actor.found/unavailable/required to perform
  37. # the action for the actor in that position in the party, starting with 0 as
  38. # the party leader.
  39. # $game_system.party_menu_disabled = true/false
  40. # This will change the access of the command if PAC Main Menu is being used.
  41. # $scene = Scene_Party.new
  42. # Simply calls the Party Management scene. By default, there is no menu option
  43. # for the party scene, but it is simple to add if you are using PAC Main Menu,
  44. # and still quite easy if you are using the default menu system.
  45. #
  46. #===============================================================================
  47. #
  48. # EDITING BEGINS AT LINE XX. DO NOT TOUCH LINES XX-XX.
  49. #
  50. #===============================================================================
  51.  
  52. module PAC
  53. module MENU
  54. module PARTY
  55.  
  56. #===============================================================================
  57. #
  58. # BEGIN EDITING
  59. #
  60. #===============================================================================
  61.  
  62.   PARTY_SWITCH = Input::X # Button which will switch between equip and status
  63.   # display in the party scene.
  64.   PARTY_KILL = Input::Z # Button used to dispose of actors.
  65.   DISPOSE_TEXT = "Disband actor"  # Text displayed on disband command.
  66.   KEEP_TEXT = "Leave alone" # Text displayed on the leave alone command.
  67.   PARTY_VARIABLE = 1  # Variable which stores the id of the last acted upon
  68.   # actor.
  69.   STATUS_WINDOW = Input::Y  # Button to toggle status window existance.
  70.   START_NO_STATUS = false # false: status window at start. true: no status
  71.   # window at start.
  72.   MOVE_SPEED = 2  # Speed at which the windows move when opening the status
  73.   # window (pixels/second).
  74.  
  75. #===============================================================================
  76. #
  77. # This script requires no editing. Do not edit anything in this script
  78. # unless you are a compenent scripter. Should you edit without any scripting
  79. # education, it may result in me tutting at you for getting it wrong.
  80. #
  81. #===============================================================================
  82.  
  83. end
  84. end
  85. end
  86.  
  87. $pac = {} unless $pac
  88. $pac["Party Management"] = [2.0, :beta]
  89.  
  90. #==============================================================================
  91. # ** RPG::Actor
  92. #------------------------------------------------------------------------------
  93. #  Data class for actors.
  94. #==============================================================================
  95.  
  96. class RPG::Actor  
  97.   #--------------------------------------------------------------------------
  98.   # Public Instance Variables
  99.   #--------------------------------------------------------------------------
  100.   attr_accessor :found
  101.   attr_accessor :unavailable
  102.   attr_accessor :required
  103.   attr_accessor :disband
  104.   #--------------------------------------------------------------------------
  105.   # * Setup
  106.   #--------------------------------------------------------------------------
  107.   def setup
  108.     @found = false
  109.     @unavailable = false
  110.     @required = false
  111.     @disband = false
  112.   end
  113. end
  114.  
  115. #==============================================================================
  116. # ** Game_System
  117. #------------------------------------------------------------------------------
  118. #  This class handles system-related data. Also manages vehicles and BGM, etc.
  119. # The instance of this class is referenced by $game_system.
  120. #==============================================================================
  121.  
  122. class Game_System
  123.   #--------------------------------------------------------------------------
  124.   # Public Instance Variables
  125.   #--------------------------------------------------------------------------
  126.   attr_accessor :party_menu_disabled
  127.   #--------------------------------------------------------------------------
  128.   # alias listing
  129.   #--------------------------------------------------------------------------
  130.   alias pac_party_initialize initialize
  131.   #--------------------------------------------------------------------------
  132.   # * Object Initialization
  133.   #--------------------------------------------------------------------------
  134.   def initialize
  135.     pac_party_initialize
  136.     @party_menu_disabled = false
  137.   end
  138. end
  139.  
  140. #==============================================================================
  141. # ** Game_Actors
  142. #------------------------------------------------------------------------------
  143. #  This class handles the actor array. The instance of this class is
  144. # referenced by $game_actors.
  145. #==============================================================================
  146.  
  147. class Game_Actors
  148.   #--------------------------------------------------------------------------
  149.   # Public Instance Variables
  150.   #--------------------------------------------------------------------------
  151.   attr_reader :data
  152.   #--------------------------------------------------------------------------
  153.   # alias listing
  154.   #--------------------------------------------------------------------------
  155.   alias pac_pms_act_initialize initialize
  156.   #--------------------------------------------------------------------------
  157.   # * Object Initialization
  158.   #--------------------------------------------------------------------------
  159.   def initialize
  160.     pac_pms_act_initialize
  161.     $data_actors.each do |actor|
  162.       actor.setup if actor
  163.       @data[actor.id] = Game_Actor.new(actor.id) if actor
  164.     end
  165.   end
  166. end
  167.  
  168. #==============================================================================
  169. # ** Window_CurrentMember
  170. #------------------------------------------------------------------------------
  171. #  This window displays the current party member in the party scene.
  172. #==============================================================================
  173.  
  174. class Window_CurrentMember < Window_Base
  175.   #--------------------------------------------------------------------------
  176.   # Public Instance Variables
  177.   #--------------------------------------------------------------------------
  178.   attr_reader :mode
  179.   #--------------------------------------------------------------------------
  180.   # * Object Initialization
  181.   #--------------------------------------------------------------------------
  182.   def initialize(member = nil, mode = 0)
  183.     super(304, 80, 192, 256)
  184.     create_contents
  185.     @member = member
  186.     @mode = 0
  187.     refresh
  188.   end
  189.   #--------------------------------------------------------------------------
  190.   # * Get member
  191.   #--------------------------------------------------------------------------
  192.   def member
  193.     return @member
  194.   end
  195.   #--------------------------------------------------------------------------
  196.   # * Set Member
  197.   #--------------------------------------------------------------------------
  198.   def set_member(member)
  199.     old_member = @member
  200.     @member = member
  201.     refresh if old_member != @member
  202.   end
  203.   #--------------------------------------------------------------------------
  204.   # * Set modes
  205.   #--------------------------------------------------------------------------
  206.   def mode=(n)
  207.     @mode = n if [0, 1].include?(n)
  208.     refresh
  209.   end
  210.   #--------------------------------------------------------------------------
  211.   # * Refresh
  212.   #--------------------------------------------------------------------------
  213.   def refresh
  214.     self.contents.clear
  215.     return unless @member
  216.     x, y = 0, 0
  217.     self.draw_actor_face(@member, x, y, 48)
  218.     self.draw_actor_name(@member, x + 52, y)
  219.     self.draw_actor_class(@member, x + 52, y + WLH)
  220.     self.draw_actor_level(@member, x, y + WLH*2)
  221.     case @mode
  222.     when 0
  223.       self.draw_icon(142, self.contents.width - 24, y + WLH*2)
  224.       self.contents.draw_text(x, y + WLH*2, self.contents.width - 12, WLH,
  225.        'Stat', 2)
  226.       self.draw_actor_hp(@member, x, y + WLH*3, 160)
  227.       self.draw_actor_mp(@member, x, y + WLH*4, 160)
  228.       self.draw_actor_parameter(@member, x, y + WLH*5, 0)
  229.       self.draw_actor_parameter(@member, x, y + WLH*6, 1)
  230.       self.draw_actor_parameter(@member, x, y + WLH*7, 2)
  231.       self.draw_actor_parameter(@member, x, y + WLH*8, 3)
  232.     when 1
  233.       self.draw_icon(143, self.contents.width - 24, y + WLH*2)
  234.       self.contents.draw_text(x, y + WLH*2, self.contents.width - 12, WLH,
  235.        'Equip', 2)
  236.       for i in 0...@member.equips.size
  237.         item = @member.equips[i]
  238.         self.draw_item_name(item, x, y + WLH*(3+i), true)
  239.       end
  240.     end
  241.   end
  242. end
  243.  
  244. #==============================================================================
  245. # ** Window_CurrentParty
  246. #------------------------------------------------------------------------------
  247. #  This window displays the current party selected in the party scene.
  248. #==============================================================================
  249.  
  250. class Window_CurrentParty < Window_Selectable
  251.   #--------------------------------------------------------------------------
  252.   # * Object Initialization
  253.   #--------------------------------------------------------------------------
  254.   def initialize
  255.     super(48, 80, 256, 64)
  256.     @item_max = 4
  257.     @column_max = @item_max
  258.     create_contents
  259.     self.index = 0
  260.     refresh
  261.   end
  262.   #--------------------------------------------------------------------------
  263.   # * Get member
  264.   #--------------------------------------------------------------------------
  265.   def member
  266.     return $game_party.members[self.index]
  267.   end
  268.   #--------------------------------------------------------------------------
  269.   # * Refresh window
  270.   #--------------------------------------------------------------------------
  271.   def refresh
  272.     for i in 0...@item_max
  273.       rect = item_rect(i)
  274.       self.contents.clear_rect(rect)
  275.     end
  276.     for i in 0...$game_party.members.size
  277.       rect = item_rect(i)
  278.       bitmap = Cache.character($game_party.members[i].character_name)
  279.       sign = $game_party.members[i].character_name[/^[\!\$]./]
  280.       if sign != nil and sign.include?('$')
  281.         cw = bitmap.width / 3
  282.         ch = bitmap.height / 4
  283.       else
  284.         cw = bitmap.width / 12
  285.         ch = bitmap.height / 8
  286.       end
  287.       n = $game_party.members[i].character_index
  288.       src_rect = Rect.new((n%4*3+1)*cw, (n/4*4)*ch, cw, ch)
  289.       if $game_party.members[i].actor.unavailable
  290.         self.contents.blt(rect.x, rect.y, bitmap, src_rect, 128)
  291.       else
  292.         self.contents.blt(rect.x, rect.y, bitmap, src_rect, 255)
  293.       end
  294.       if $game_party.members[i].actor.required
  295.         lock_bitmap = Cache.system("Locked")
  296.         self.contents.blt(rect.x + rect.width - lock_bitmap.width,
  297.         rect.y + rect.height - lock_bitmap.height,lock_bitmap,lock_bitmap.rect)
  298.       end
  299.     end
  300.   end
  301.   #--------------------------------------------------------------------------
  302.   # * Get rectangle for displaying items
  303.   #     index : item number
  304.   #--------------------------------------------------------------------------
  305.   def item_rect(index)
  306.     rect = Rect.new(0, 0, 0, 0)
  307.     rect.width = (contents.width + @spacing) / @column_max - @spacing
  308.     rect.height = 32
  309.     rect.x = index % @column_max * (rect.width + @spacing)
  310.     rect.y = index / @column_max * 32
  311.     return rect
  312.   end
  313. end
  314.  
  315. #==============================================================================
  316. # ** Window_SelectMember
  317. #------------------------------------------------------------------------------
  318. #  This window displays the currently selected member in the party scene.
  319. #==============================================================================
  320.  
  321. class Window_SelectMember < Window_Selectable
  322.   #--------------------------------------------------------------------------
  323.   # * Object Initialization
  324.   #--------------------------------------------------------------------------
  325.   def initialize
  326.     super(48, 144, 256, 192)
  327.     calculate_actors
  328.     @item_max = @actors.size
  329.     @column_max = 4
  330.     self.index = -1
  331.     self.active = false
  332.     refresh
  333.   end
  334.   #--------------------------------------------------------------------------
  335.   # * Calculate Actors
  336.   #--------------------------------------------------------------------------
  337.   def calculate_actors
  338.     @actors = []
  339.     for a in $game_actors.data
  340.       if a != nil and a.actor.found and !$game_party.members.include?(a)
  341.         @actors << a unless $data_actors[a.id].disband
  342.       end
  343.     end
  344.   end
  345.   #--------------------------------------------------------------------------
  346.   # * Get member
  347.   #--------------------------------------------------------------------------
  348.   def member
  349.     return @actors[self.index]
  350.   end
  351.   #--------------------------------------------------------------------------
  352.   # * Refresh Window
  353.   #--------------------------------------------------------------------------
  354.   def refresh
  355.     self.contents.clear
  356.     calculate_actors
  357.     @item_max = @actors.size + 1
  358.     for i in 0...@actors.size
  359.       rect = item_rect(i)
  360.       bitmap = Cache.character(@actors[i].character_name)
  361.       sign = @actors[i].character_name[/^[\!\$]./]
  362.       if sign != nil and sign.include?('$')
  363.         cw = bitmap.width / 3
  364.         ch = bitmap.height / 4
  365.       else
  366.         cw = bitmap.width / 12
  367.         ch = bitmap.height / 8
  368.       end
  369.       n = @actors[i].character_index
  370.       src_rect = Rect.new((n%4*3+1)*cw, (n/4*4)*ch, cw, ch)
  371.       if @actors[i].actor.unavailable
  372.         self.contents.blt(rect.x, rect.y, bitmap, src_rect, 128)
  373.       else
  374.         self.contents.blt(rect.x, rect.y, bitmap, src_rect, 255)
  375.       end
  376.       if @actors[i].actor.required
  377.         lock_bitmap = Cache.system("Locked")
  378.         self.contents.blt(rect.x + rect.width - lock_bitmap.width,
  379.         rect.y + rect.height - lock_bitmap.height,lock_bitmap,lock_bitmap.rect)
  380.       end
  381.     end
  382.   end
  383.   #--------------------------------------------------------------------------
  384.   # * Get rectangle for displaying items
  385.   #     index : item number
  386.   #--------------------------------------------------------------------------  
  387.   def item_rect(index)
  388.     rect = Rect.new(0, 0, 0, 0)
  389.     rect.width = (contents.width + @spacing) / @column_max - @spacing
  390.     rect.height = 32
  391.     rect.x = index % @column_max * (rect.width + @spacing)
  392.     rect.y = index / @column_max * 32
  393.     return rect
  394.   end
  395. end
  396.  
  397. #==============================================================================
  398. # ** Scene_File
  399. #------------------------------------------------------------------------------
  400. #  This class performs the save and load screen processing.
  401. #==============================================================================
  402.  
  403. class Scene_File < Scene_Base
  404.   #--------------------------------------------------------------------------
  405.   # alias listing
  406.   #--------------------------------------------------------------------------
  407.   alias pac_pms_file_write_save_data write_save_data
  408.   alias pac_pms_file_read_save_data read_save_data
  409.   #--------------------------------------------------------------------------
  410.   # * Write Save Data
  411.   #     file : write file object (opened)
  412.   #--------------------------------------------------------------------------
  413.   def write_save_data(file)
  414.     pac_pms_file_write_save_data(file)
  415.     Marshal.dump($data_actors, file)
  416.   end
  417.   #--------------------------------------------------------------------------
  418.   # * Read Save Data
  419.   #     file : file object for reading (opened)
  420.   #--------------------------------------------------------------------------
  421.   def read_save_data(file)
  422.     pac_pms_file_read_save_data(file)
  423.     $data_actors = Marshal.load(file)
  424.   end
  425. end
  426.  
  427. #==============================================================================
  428. # ** Scene_Title
  429. #------------------------------------------------------------------------------
  430. #  This class performs the title screen processing.
  431. #==============================================================================
  432.  
  433. class Scene_Title < Scene_Base
  434.   #--------------------------------------------------------------------------
  435.   # alias listing
  436.   #--------------------------------------------------------------------------
  437.   alias pac_pms_ttl_command_new_game command_new_game
  438.   #--------------------------------------------------------------------------
  439.   # * Command: New Game
  440.   #--------------------------------------------------------------------------
  441.   def command_new_game
  442.     pac_pms_ttl_command_new_game
  443.     $game_party.members.each {|s| s.actor.found = true if s}
  444.   end
  445. end
  446.  
  447. #==============================================================================
  448. # ** Scene_Party
  449. #------------------------------------------------------------------------------
  450. #  This class performs the party screen processing.
  451. #==============================================================================
  452.  
  453. class Scene_Party < Scene_Base
  454.   include PAC::MENU::PARTY
  455.   #--------------------------------------------------------------------------
  456.   # * Object Initialization
  457.   #--------------------------------------------------------------------------
  458.   def initialize(from_map = true, from_menu = false)
  459.     @from_map = from_map
  460.     @from_menu = from_menu
  461.   end
  462.   #--------------------------------------------------------------------------
  463.   # * Start processing
  464.   #--------------------------------------------------------------------------
  465.   def start
  466.     super
  467.     create_menu_background
  468.     create_windows
  469.   end
  470.   #--------------------------------------------------------------------------
  471.   # * Create windows
  472.   #--------------------------------------------------------------------------
  473.   def create_windows
  474.     @member_window = Window_CurrentMember.new
  475.     @member_window.visible = false if START_NO_STATUS
  476.     @member_window.openness = 0 if START_NO_STATUS
  477.     @party_window = Window_CurrentParty.new
  478.     @party_window.active = true
  479.     @party_window.x += 96 if START_NO_STATUS
  480.     @selectable_window = Window_SelectMember.new
  481.     @selectable_window.x += 96 if START_NO_STATUS
  482.     commands = [PAC::MENU::PARTY::DISPOSE_TEXT, PAC::MENU::PARTY::KEEP_TEXT]
  483.     @choice_window = Window_Command.new(160, commands)
  484.     @choice_window.x = (544 - @choice_window.width) / 2
  485.     @choice_window.y = (416 - @choice_window.height) / 2
  486.     @choice_window.openness = 0
  487.   end
  488.   #--------------------------------------------------------------------------
  489.   # * Open Member Window (now with awesomeness!)
  490.   #--------------------------------------------------------------------------
  491.   def open_member_window
  492.     begin
  493.       @party_window.x -= MOVE_SPEED
  494.       @selectable_window.x -= MOVE_SPEED
  495.       Graphics.update
  496.     end until @party_window.x == 48
  497.     @member_window.visible = true
  498.     @member_window.open
  499.     begin
  500.       @member_window.update
  501.       Graphics.update
  502.     end until @member_window.openness == 255
  503.   end
  504.   #--------------------------------------------------------------------------
  505.   # * Close Member Window (with equal awesomeness!)
  506.   #--------------------------------------------------------------------------
  507.   def close_member_window
  508.     @member_window.close
  509.     begin
  510.       @member_window.update
  511.       Graphics.update
  512.     end until @member_window.openness == 0
  513.     @member_window.visible = false
  514.     begin
  515.       @party_window.x += MOVE_SPEED
  516.       @selectable_window.x += MOVE_SPEED
  517.       Graphics.update
  518.     end until @party_window.x == 144
  519.   end
  520.   #--------------------------------------------------------------------------
  521.   # * Window update
  522.   #--------------------------------------------------------------------------
  523.   def update_windows
  524.     @member_window.update
  525.     @party_window.update
  526.     @selectable_window.update
  527.     @choice_window.update
  528.     if @party_window.active
  529.       @member_window.set_member(@party_window.member)
  530.     elsif @selectable_window.active
  531.       @member_window.set_member(@selectable_window.member)
  532.     end
  533.   end
  534.   #--------------------------------------------------------------------------
  535.   # * Open Choice Window
  536.   #--------------------------------------------------------------------------
  537.   def activate_choice_window
  538.     @previously_active = @selectable_window.active ?
  539.      @selectable_window : @party_window
  540.     @previously_active.active = false
  541.     @choice_window.active = true
  542.     @choice_window.open
  543.     begin
  544.       @choice_window.update
  545.       Graphics.update
  546.     end until @choice_window.openness == 255
  547.   end
  548.   #--------------------------------------------------------------------------
  549.   # * Close Choice Window
  550.   #--------------------------------------------------------------------------
  551.   def deactivate_choice_window
  552.     @choice_window.active = false
  553.     @party_window.active = true
  554.     @choice_window.close
  555.     @selectable_window.index = -1
  556.     begin
  557.       @choice_window.update
  558.       Graphics.update
  559.     end until @choice_window.openness == 0
  560.   end
  561.   #--------------------------------------------------------------------------
  562.   # * Update Party Window
  563.   #--------------------------------------------------------------------------
  564.   def update_party_window
  565.     if Input.trigger?(Input::B) # If you want to leave,
  566.       if $game_party.members.size == 0  # If party is empty,
  567.         Sound.play_buzzer # Bee-bow.
  568.         return  # No soup for you
  569.       else
  570.         Sound.play_cancel # Bloop.
  571.         if @from_map
  572.           $scene = Scene_Map.new
  573.         elsif @from_menu
  574.           if $pac["Main Menu"]
  575.             $scene = Scene_Menu.new
  576.           else
  577.             $scene = Scene_Menu.new(4)
  578.           end
  579.         end
  580.       end
  581.     elsif Input.trigger?(Input::C)  # If you want to do something,
  582.       member = @party_window.member # do stuff.
  583.       if member != nil
  584.         if member.actor.unavailable or member.actor.required
  585.           Sound.play_buzzer
  586.           return
  587.         end
  588.       end
  589.       Sound.play_decision
  590.       @party_window.active = false
  591.       @selectable_window.active = true
  592.       @selectable_window.index = 0
  593.     elsif Input.trigger?(PARTY_KILL)
  594.       Sound.play_buzzer
  595.     end
  596.   end
  597.   #--------------------------------------------------------------------------
  598.   # * Update Selectable Window
  599.   #--------------------------------------------------------------------------
  600.   def update_selectable_window
  601.     if Input.trigger?(Input::B)
  602.       Sound.play_cancel
  603.       @selectable_window.index = -1
  604.       @selectable_window.active = false
  605.       @party_window.active = true
  606.     elsif Input.trigger?(Input::C)
  607.       member = @selectable_window.member
  608.       if member != nil
  609.         if member.actor.unavailable
  610.           Sound.play_buzzer
  611.           return
  612.         end
  613.       end
  614.       Sound.play_decision
  615.       if @party_window.member != nil
  616.         member = @party_window.member
  617.         $game_party.remove_actor(member.id)
  618.       end
  619.       if @selectable_window.member != nil
  620.         member = @selectable_window.member
  621.         $game_party.add_actor(member.id)
  622.       end
  623.       $game_variables[PAC::MENU::PARTY::PARTY_VARIABLE] = member.id
  624.       @selectable_window.refresh
  625.       @party_window.refresh
  626.       @selectable_window.index = -1
  627.       @selectable_window.active = false
  628.       @party_window.active = true
  629.     elsif Input.trigger?(PAC::MENU::PARTY::PARTY_KILL)
  630.       activate_choice_window
  631.     end
  632.   end
  633.   #--------------------------------------------------------------------------
  634.   # * Update Choice Window
  635.   #--------------------------------------------------------------------------
  636.   def update_choice_window
  637.     if Input.trigger?(Input::B)
  638.       Sound.play_cancel
  639.       deactivate_choice_window
  640.     elsif Input.trigger?(Input::C)
  641.       case @choice_window.index
  642.       when 0  # Disband
  643.         member = @selectable_window.member
  644.         if member != nil
  645.           if member.actor.unavailable
  646.             Sound.play_buzzer
  647.             return
  648.           end
  649.         end
  650.         Sound.play_decision
  651.         if @party_window.member != nil
  652.           member = @party_window.member
  653.         end
  654.         if @selectable_window.member != nil
  655.           member = @selectable_window.member
  656.         end
  657.         $game_party.remove_actor(member.id)
  658.         $game_variables[PAC::MENU::PARTY::PARTY_VARIABLE] = member.id
  659.         $data_actors[member.id].disband = true
  660.         @selectable_window.refresh
  661.         @party_window.refresh
  662.         @selectable_window.index = -1
  663.         deactivate_choice_window
  664.       when 1  # Leave
  665.         Sound.play_cancel
  666.         deactivate_choice_window
  667.       end
  668.     end
  669.   end
  670.   #--------------------------------------------------------------------------
  671.   # * Termination Processing
  672.   #--------------------------------------------------------------------------
  673.   def terminate
  674.     super
  675.     @member_window.dispose
  676.     @party_window.dispose
  677.     @selectable_window.dispose
  678.     @choice_window.dispose
  679.   end
  680.   #--------------------------------------------------------------------------
  681.   # * Frame Update
  682.   #--------------------------------------------------------------------------
  683.   def update
  684.     super
  685.     update_windows
  686.     update_input
  687.   end
  688.   #--------------------------------------------------------------------------
  689.   # * Update Command Input
  690.   #--------------------------------------------------------------------------
  691.   def update_input
  692.     if Input.trigger?(PARTY_SWITCH) # If the button is being pressed...
  693.       @member_window.mode = @member_window.mode == 1 ? 0 : 1
  694.     elsif Input.trigger?(STATUS_WINDOW)
  695.       if @member_window.visible
  696.         close_member_window
  697.       else
  698.         open_member_window
  699.       end
  700.     end
  701.     if @party_window.active # If the party member is active
  702.       update_party_window
  703.     elsif @selectable_window.active
  704.       update_selectable_window
  705.     elsif @choice_window.active
  706.       update_choice_window
  707.     end
  708.   end
  709. end
  710.  
  711. #===============================================================================
  712. #
  713. # END OF SCRIPT
  714. #
  715. #===============================================================================
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement