IceDragon200

FRV-EquipMenu

Jun 4th, 2011
171
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 3.39 KB | None | 0 0
  1. # // Last Modified :06/08/2011
  2. #==============================================================================#
  3. # Window_EquipHelp
  4. #==============================================================================#
  5. class Window_EquipHelp < IRS::Sprite_Help ; end
  6.  
  7. #==============================================================================#
  8. # Scene_Equip
  9. #==============================================================================#
  10. class Scene_Equip < Scene_Base
  11.  
  12.   #--------------------------------------------------------------------------#
  13.   # * overwrite method :start
  14.   #--------------------------------------------------------------------------#
  15.   def start()
  16.     super()
  17.     create_menu_background()
  18.     @actor = $game_party.members[@actor_index]
  19.     @help_window = Window_EquipHelp.new( 0, 0, Graphics.width, 32 )
  20.     create_item_windows()
  21.     @status_window = Window_EquipStatus.new( 0, 32, @actor )
  22.     @equip_window = Window_Equip.new( @status_window.width, 32, @actor )
  23.     @equip_window.help_window = @help_window
  24.     @equip_window.index = @equip_index
  25.     @inputhelp_window = Window_EquipHelp.new( 0, Graphics.height-32, Graphics.width, 32 )
  26.     @inputhelp_window.align = 1
  27.     @inputhelp_window.set_text("Use A and S to switch Characters")
  28.     # // ----------------------------------------------------------------- // #
  29.     @menuback_sprite.bitmap = Cache.system( "Menu_background" )
  30.     @menuback_sprite.opacity= 255
  31.   end
  32.  
  33.   #--------------------------------------------------------------------------#
  34.   # * overwrite method :terminate
  35.   #--------------------------------------------------------------------------#
  36.   def terminate()
  37.     super()
  38.     dispose_menu_background()
  39.     @help_window.dispose()
  40.     @equip_window.dispose()
  41.     @status_window.dispose()
  42.     dispose_item_windows
  43.     @inputhelp_window.dispose()
  44.   end
  45.  
  46.   #--------------------------------------------------------------------------#
  47.   # * overwrite method :create_item_windows
  48.   #--------------------------------------------------------------------------#
  49.   def create_item_windows()
  50.     @item_windows = []
  51.     for i in 0...EQUIP_TYPE_MAX
  52.       @item_windows[i] = Window_EquipItem.new(0, 208-32, 544, 208, @actor, i)
  53.       @item_windows[i].help_window = @help_window
  54.       @item_windows[i].visible = (@equip_index == i)
  55.       @item_windows[i].y = 208 - 32
  56.       @item_windows[i].height = 208
  57.       @item_windows[i].active = false
  58.       @item_windows[i].index = -1
  59.     end
  60.   end
  61.  
  62.   #--------------------------------------------------------------------------#
  63.   # * overwrite method :update_equip_selection
  64.   #--------------------------------------------------------------------------#
  65.   def update_equip_selection()
  66.     if Input.trigger?(Input::B)
  67.       Sound.play_cancel
  68.       return_scene
  69.     elsif Input.trigger?(Input::Y)
  70.       Sound.play_cursor
  71.       next_actor
  72.     elsif Input.trigger?(Input::X)
  73.       Sound.play_cursor
  74.       prev_actor
  75.     elsif Input.trigger?(Input::C)
  76.       if @actor.fix_equipment
  77.         Sound.play_buzzer
  78.       else
  79.         Sound.play_decision
  80.         @equip_window.active = false
  81.         @item_window.active = true
  82.         @item_window.index = 0
  83.       end
  84.     end
  85.   end
  86.  
  87. end  
  88. #=*==========================================================================*=#
  89. # ** END OF FILE
  90. #=*==========================================================================*=#
Advertisement
Add Comment
Please, Sign In to add comment