Show Window_EquipSlot while Window_EquipItem is Open

● ARCHIVED · READ-ONLY
Started by Rello 4 posts View original ↗
  1. Hey all,

    Right now I'm redoing my Equip Scene but I'm unable to find a way to keep WIndow_EquipSlot visable while Window_EquipItem is Up. Normally, Window_EquipSlot disappears when Window_EquipItem is opened up, and I don't like that. Apparently, my minimal scripting knowlege isn't getting my anywhere so I figured I'd ask you find people to help.

    Spoiler
    My Scene_Equip#==============================================================================# ■ Scene_Equip#==============================================================================class Scene_Equip < Scene_MenuBase #-------------------------------------------------------------------------- # overwrite method: create_status_window #-------------------------------------------------------------------------- def create_status_window wx = 0 wy = @help_window.height + 92 @status_window = Window_EquipStatus.new(wx, wy) @status_window.viewport = @viewport @status_window.actor = @actor end #-------------------------------------------------------------------------- # overwrite method: create_command_window #-------------------------------------------------------------------------- def create_command_window wx = 0 wy = @help_window.height - 23 ww = 140 @command_window = Window_EquipCommand.new(wx, wy, ww) @command_window.viewport = @viewport @command_window.help_window = @help_window if !$game_temp.scene_equip_index.nil? @command_window.select($game_temp.scene_equip_index) @command_window.oy = $game_temp.scene_equip_oy end $game_temp.scene_equip_index = nil $game_temp.scene_equip_oy = nil @command_window.set_handler:)equip, method:)command_equip)) @command_window.set_handler:)optimize, method:)command_optimize)) @command_window.set_handler:)clear, method:)command_clear)) @command_window.set_handler:)cancel, method:)return_scene)) @command_window.set_handler:)pagedown, method:)next_actor)) @command_window.set_handler:)pageup, method:)prev_actor)) process_custom_equip_commands create_actor_window end #-------------------------------------------------------------------------- # new method: create_actor_window #-------------------------------------------------------------------------- def create_actor_window wy = @help_window.height - 28 @actor_window = Window_EquipActor.new(@command_window.width, wy) @actor_window.viewport = @viewport @actor_window.actor = @actor end #-------------------------------------------------------------------------- # new method: process_custom_equip_commands #-------------------------------------------------------------------------- def process_custom_equip_commands for command in YEA::EQUIP::COMMAND_LIST next unless YEA::EQUIP::CUSTOM_EQUIP_COMMANDS.include?(command) called_method = YEA::EQUIP::CUSTOM_EQUIP_COMMANDS[command][3] @command_window.set_handler(command, method(called_method)) end end #-------------------------------------------------------------------------- # overwrite method: create_slot_window #-------------------------------------------------------------------------- def create_slot_window wx = 250 wy = 182-19 ww = Graphics.width - @status_window.width @slot_window = Window_EquipSlot.new(wx, wy, ww) @slot_window.viewport = @viewport @slot_window.help_window = @help_window @slot_window.status_window = @status_window @slot_window.actor = @actor @slot_window.set_handler:)ok, method:)on_slot_ok)) @slot_window.set_handler:)cancel, method:)on_slot_cancel)) end #-------------------------------------------------------------------------- # overwrite method: create_item_window #-------------------------------------------------------------------------- def create_item_window wx = @slot_window.x wy = @slot_window.y ww = @slot_window.width wh = @slot_window.height @item_window = Window_EquipItem.new(wx, wy + 80, ww, wh) @item_window.viewport = @viewport @item_window.help_window = @help_window @item_window.status_window = @status_window @item_window.actor = @actor @item_window.set_handler:)ok, method:)on_item_ok)) @item_window.set_handler:)cancel, method:)on_item_cancel)) @slot_window.item_window = @item_window @item_window.hide end #-------------------------------------------------------------------------- # alias method: command_optimize #-------------------------------------------------------------------------- alias scene_equip_command_optimize_aee command_optimize def command_optimize scene_equip_command_optimize_aee @actor_window.refresh end #-------------------------------------------------------------------------- # alias method: command_clear #-------------------------------------------------------------------------- alias scene_equip_command_clear_aee command_clear def command_clear scene_equip_command_clear_aee @actor_window.refresh end #-------------------------------------------------------------------------- # alias method: on_slot_ok #-------------------------------------------------------------------------- alias scene_equip_on_slot_ok_aee on_slot_ok def on_slot_ok scene_equip_on_slot_ok_aee @slot_window.hide @item_window.refresh @item_window.show end #-------------------------------------------------------------------------- # alias method: on_item_ok #-------------------------------------------------------------------------- alias scene_equip_on_item_ok_aee on_item_ok def on_item_ok scene_equip_on_item_ok_aee @actor_window.refresh @slot_window.show @item_window.hide end #-------------------------------------------------------------------------- # alias method: on_item_cancel #-------------------------------------------------------------------------- alias scene_equip_on_item_cancel_aee on_item_cancel def on_item_cancel scene_equip_on_item_cancel_aee @slot_window.show @item_window.hide end #-------------------------------------------------------------------------- # alias method: on_actor_change #-------------------------------------------------------------------------- alias scene_equip_on_actor_change_aee on_actor_change def on_actor_change scene_equip_on_actor_change_aee @actor_window.actor = @actor end #-------------------------------------------------------------------------- # new method: command_name1 #-------------------------------------------------------------------------- def command_name1 # Do nothing. end #-------------------------------------------------------------------------- # new method: command_name2 #-------------------------------------------------------------------------- def command_name2 # Do nothing. end end # Scene_Equip#==============================================================================# # ▼ End of File# #==============================================================================
    My EquipItem is already being moved to make room for the what-would-be visable EquipSlot. Any help is appreciated. Thanks!
  2. Give this a try. You need to remove the @slot_window.hide line from the on_slot_ok method since that hides the slot window when a slot is selected (and the equip items window is shown). Then, though not required, you can remove the @slot_window.show commands from on_item_ok and on_item_cancel since they won't do anything anymore.

    Here's a modified version of your script:

    Spoiler
    Code:
    #==============================================================================# ■ Scene_Equip#==============================================================================class Scene_Equip < Scene_MenuBase    #--------------------------------------------------------------------------  # overwrite method: create_status_window  #--------------------------------------------------------------------------  def create_status_window    wx = 0    wy = @help_window.height + 92    @status_window = Window_EquipStatus.new(wx, wy)    @status_window.viewport = @viewport    @status_window.actor = @actor  end    #--------------------------------------------------------------------------  # overwrite method: create_command_window  #--------------------------------------------------------------------------  def create_command_window    wx = 0    wy = @help_window.height - 23    ww = 140    @command_window = Window_EquipCommand.new(wx, wy, ww)    @command_window.viewport = @viewport    @command_window.help_window = @help_window    if !$game_temp.scene_equip_index.nil?      @command_window.select($game_temp.scene_equip_index)      @command_window.oy = $game_temp.scene_equip_oy    end    $game_temp.scene_equip_index = nil    $game_temp.scene_equip_oy = nil    @command_window.set_handler(:equip,    method(:command_equip))    @command_window.set_handler(:optimize, method(:command_optimize))    @command_window.set_handler(:clear,    method(:command_clear))    @command_window.set_handler(:cancel,   method(:return_scene))    @command_window.set_handler(:pagedown, method(:next_actor))    @command_window.set_handler(:pageup,   method(:prev_actor))    process_custom_equip_commands    create_actor_window  end    #--------------------------------------------------------------------------  # new method: create_actor_window  #--------------------------------------------------------------------------  def create_actor_window    wy = @help_window.height - 28    @actor_window = Window_EquipActor.new(@command_window.width, wy)    @actor_window.viewport = @viewport    @actor_window.actor = @actor  end    #--------------------------------------------------------------------------  # new method: process_custom_equip_commands  #--------------------------------------------------------------------------  def process_custom_equip_commands    for command in YEA::EQUIP::COMMAND_LIST      next unless YEA::EQUIP::CUSTOM_EQUIP_COMMANDS.include?(command)      called_method = YEA::EQUIP::CUSTOM_EQUIP_COMMANDS[command][3]      @command_window.set_handler(command, method(called_method))    end  end    #--------------------------------------------------------------------------  # overwrite method: create_slot_window  #--------------------------------------------------------------------------  def create_slot_window    wx = 250    wy = 182-19    ww = Graphics.width - @status_window.width    @slot_window = Window_EquipSlot.new(wx, wy, ww)    @slot_window.viewport = @viewport    @slot_window.help_window = @help_window    @slot_window.status_window = @status_window    @slot_window.actor = @actor    @slot_window.set_handler(:ok,       method(:on_slot_ok))    @slot_window.set_handler(:cancel,   method(:on_slot_cancel))  end    #--------------------------------------------------------------------------  # overwrite method: create_item_window  #--------------------------------------------------------------------------  def create_item_window    wx = @slot_window.x    wy = @slot_window.y    ww = @slot_window.width    wh = @slot_window.height    @item_window = Window_EquipItem.new(wx, wy + 80, ww, wh)    @item_window.viewport = @viewport    @item_window.help_window = @help_window    @item_window.status_window = @status_window    @item_window.actor = @actor    @item_window.set_handler(:ok,     method(:on_item_ok))    @item_window.set_handler(:cancel, method(:on_item_cancel))    @slot_window.item_window = @item_window    @item_window.hide  end    #--------------------------------------------------------------------------  # alias method: command_optimize  #--------------------------------------------------------------------------  alias scene_equip_command_optimize_aee command_optimize  def command_optimize    scene_equip_command_optimize_aee    @actor_window.refresh  end    #--------------------------------------------------------------------------  # alias method: command_clear  #--------------------------------------------------------------------------  alias scene_equip_command_clear_aee command_clear  def command_clear    scene_equip_command_clear_aee    @actor_window.refresh  end    #--------------------------------------------------------------------------  # alias method: on_slot_ok  #--------------------------------------------------------------------------  alias scene_equip_on_slot_ok_aee on_slot_ok  def on_slot_ok    scene_equip_on_slot_ok_aee    @item_window.refresh    @item_window.show  end    #--------------------------------------------------------------------------  # alias method: on_item_ok  #--------------------------------------------------------------------------  alias scene_equip_on_item_ok_aee on_item_ok  def on_item_ok    scene_equip_on_item_ok_aee    @actor_window.refresh    @item_window.hide  end    #--------------------------------------------------------------------------  # alias method: on_item_cancel  #--------------------------------------------------------------------------  alias scene_equip_on_item_cancel_aee on_item_cancel  def on_item_cancel    scene_equip_on_item_cancel_aee    @item_window.hide  end    #--------------------------------------------------------------------------  # alias method: on_actor_change  #--------------------------------------------------------------------------  alias scene_equip_on_actor_change_aee on_actor_change  def on_actor_change    scene_equip_on_actor_change_aee    @actor_window.actor = @actor  end    #--------------------------------------------------------------------------  # new method: command_name1  #--------------------------------------------------------------------------  def command_name1    # Do nothing.  end    #--------------------------------------------------------------------------  # new method: command_name2  #--------------------------------------------------------------------------  def command_name2    # Do nothing.  end  end # Scene_Equip#==============================================================================# # ▼ End of File# #==============================================================================
  3. Ah! Thank you! Works great!
  4. This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.