european_son
Member
I have this bit of code as my menu scene:
The problem is that I don't know what to put in the 'update_status' method to get the player status window to show the stats of the player defined by the cursor index of 'window_target'.
I'm not sure if my explanation makes any sense. In other words, the idea is that in the main menu screen I would have the command window (with 3 commands: Items, Skills and Equip) and below it a target window (which activates when selecting Skills or Equip from command window). The target window is just the default Window_MenuStatus class with nothing but a 72x72 picture of the character. When the target window is activated, a status window would appear next to it, showing the stats of the player to which the cursor of the target window is pointing. Whew... I hope you get the idea. And thanks in advance!
Code:
#==============================================================================
# ** Scene_Inventory
#------------------------------------------------------------------------------
# Â This class performs inventory screen processing.
#==============================================================================
Â
class Scene_Inventory
 #--------------------------------------------------------------------------
 # * Object Initialization
 #   menu_index : command cursor's initial position
 #--------------------------------------------------------------------------
 def initialize(menu_index = 0)
  @menu_index = menu_index
 end
 #--------------------------------------------------------------------------
 # * Main Processing
 #--------------------------------------------------------------------------
 def main
  # Get actor for status window
  @actor = $game_party.actors[@menu_index]
  # Make command window
  s1 = $data_system.words.item
  s2 = $data_system.words.skill
  s3 = $data_system.words.equip
  @command_window = Window_Command.new(72 + 32, [s1, s2, s3])
  @command_window.index = @menu_index
  @command_window.back_opacity = 230
  # If number of party members is 0
  if $game_party.actors.size == 0
   # Disable items, skills, equipment, and status
   @command_window.disable_item(0)
   @command_window.disable_item(1)
   @command_window.disable_item(2)
  end
  # Make target window
  @target_window = Window_MenuTarget.new
  @target_window.x = 0
  @target_window.y = 160
  @target_window.opacity = 230
  # Make status window
  @status_window = Window_Status.new(@actor)
  @status_window.x = 72 + 32
  @status_window.y = 0
  @status_window.opacity = 230
  # Show map as background
  @spriteset = Spriteset_Map.new
  # Execute transition
  Graphics.transition
  # Main loop
  loop do
   # Update game screen
   Graphics.update
   # Update input information
   Input.update
   # Frame update
   update
   # Abort loop if screen is changed
   if $scene != self
    break
   end
  end
  # Prepare for transition
  Graphics.freeze
  # Dispose of windows
  @command_window.dispose
  @target_window.dispose
  @status_window.dispose
 end
 #--------------------------------------------------------------------------
 # * Frame Update
 #--------------------------------------------------------------------------
 def update
  # Update windows
  @command_window.update
  @target_window.update
  @status_window.update
  # If command window is active: call update_command
  if @command_window.active
   update_command
   return
  end
  # If target window is active: call update_target & update_status
  if @target_window.active
   update_target
   update_status
   return
  end
 end
 #--------------------------------------------------------------------------
 # * Frame Update (when command window is active)
 #--------------------------------------------------------------------------
 def update_command
  # If A button was pressed
  if Input.trigger?(Input::A)
   # Play cancel SE
   $game_system.se_play($data_system.cancel_se)
   # Switch to map screen
   $scene = Scene_Map.new
   return
  end
  # If B button was pressed
  if Input.trigger?(Input::B)
   # Play cancel SE
   $game_system.se_play($data_system.cancel_se)
   # Switch to map screen
   $scene = Scene_Map.new
   return
  end
  # If C button was pressed
  if Input.trigger?(Input::C)
   # If command other than save or end game, and party members = 0
   if $game_party.actors.size == 0 and @command_window.index < 4
    # Play buzzer SE
    $game_system.se_play($data_system.buzzer_se)
    return
   end
   # Branch by command window cursor position
   case @command_window.index
   when 0  # item
    # Play decision SE
    $game_system.se_play($data_system.decision_se)
    # Switch to item screen
    $scene = Scene_Item.new
   when 1  # skill
    # Play decision SE
    $game_system.se_play($data_system.decision_se)
    # Make target window active
    @command_window.active = false
    @target_window.active = true
    @target_window.index = 0
   when 2  # equipment
    # Play decision SE
    $game_system.se_play($data_system.decision_se)
    # Make target window active
    @command_window.active = false
    @target_window.active = true
    @target_window.index = 0
   end
   return
  end
 end
 #--------------------------------------------------------------------------
 # * Frame Update (when target window is active)
 #--------------------------------------------------------------------------
 def update_target
  # If A button was pressed
  if Input.trigger?(Input::A)
   # Play cancel SE
   $game_system.se_play($data_system.cancel_se)
   # Make command window active
   @command_window.active = true
   @target_window.active = false
   @target_window.index = -1
   return
  end
  # If B button was pressed
  if Input.trigger?(Input::B)
   # Play cancel SE
   $game_system.se_play($data_system.cancel_se)
   # Make command window active
   @command_window.active = true
   @target_window.active = false
   @target_window.index = -1
   return
  end
  # If C button was pressed
  if Input.trigger?(Input::C)
   # Branch by command window cursor position
   case @command_window.index
   when 1  # skill
    # If this actor's action limit is 2 or more
    if $game_party.actors[@target_window.index].restriction >= 2
     # Play buzzer SE
     $game_system.se_play($data_system.buzzer_se)
     return
    end
    # Play decision SE
    $game_system.se_play($data_system.decision_se)
    # Switch to skill screen
    $scene = Scene_Skill.new(@target_window.index)
   when 2  # equipment
    # Play decision SE
    $game_system.se_play($data_system.decision_se)
    # Switch to equipment screen
    $scene = Scene_Equip.new(@target_window.index)
   end
   return
  end
 end
 def update_status
  # ???
 end
end
Â
I'm not sure if my explanation makes any sense. In other words, the idea is that in the main menu screen I would have the command window (with 3 commands: Items, Skills and Equip) and below it a target window (which activates when selecting Skills or Equip from command window). The target window is just the default Window_MenuStatus class with nothing but a 72x72 picture of the character. When the target window is activated, a status window would appear next to it, showing the stats of the player to which the cursor of the target window is pointing. Whew... I hope you get the idea. And thanks in advance!