Advertisement
Guest User

320 guy's Equip menu

a guest
Jun 29th, 2016
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 2.62 KB | None | 0 0
  1. #------------------------------------
  2. Graphics.resize_screen(320, 320)
  3.  
  4. #------------------------------------
  5. class Scene_Equip < Scene_MenuBase
  6.   # Added the last line (the help window is an evil villain that hates me)
  7.   def start
  8.     super
  9.     create_help_window
  10.     create_status_window
  11.     create_command_window
  12.     create_slot_window
  13.     create_item_window
  14.     @help_window.hide
  15.   end
  16.  
  17.   # Repositioned
  18.   def create_status_window
  19.     @status_window = Window_EquipStatus.new(0, 0)
  20.     @status_window.viewport = @viewport
  21.     @status_window.actor = @actor
  22.   end
  23.  
  24.   # Repositioned
  25.   def create_command_window
  26.     wx = 0
  27.     wy = @status_window.height
  28.     ww = Graphics.width
  29.     @command_window = Window_EquipCommand.new(wx, wy, ww)
  30.     @command_window.viewport = @viewport
  31.     @command_window.help_window = @help_window
  32.     @command_window.set_handler(:equip,    method(:command_equip))
  33.     @command_window.set_handler(:optimize, method(:command_optimize))
  34.     @command_window.set_handler(:clear,    method(:command_clear))
  35.     @command_window.set_handler(:cancel,   method(:return_scene))
  36.     @command_window.set_handler(:pagedown, method(:next_actor))
  37.     @command_window.set_handler(:pageup,   method(:prev_actor))
  38.   end
  39.  
  40.   # Repositioned
  41.   def create_slot_window
  42.     wx = 0
  43.     wy = @command_window.y + @command_window.height
  44.     ww = Graphics.width
  45.     @slot_window = Window_EquipSlot.new(wx, wy, ww)
  46.     @slot_window.viewport = @viewport
  47.     @slot_window.help_window = @help_window
  48.     @slot_window.status_window = @status_window
  49.     @slot_window.actor = @actor
  50.     @slot_window.set_handler(:ok,       method(:on_slot_ok))
  51.     @slot_window.set_handler(:cancel,   method(:on_slot_cancel))
  52.   end
  53. end
  54.  
  55. #------------------------------------
  56. class Window_EquipStatus < Window_Base
  57.   # Don't change
  58.   def window_width
  59.     return Graphics.width
  60.   end
  61.  
  62.   # Don't change
  63.   def visible_line_number
  64.     return 2
  65.   end
  66.  
  67.   # You could use different math here to display the stats in a different order
  68.   def refresh
  69.     contents.clear
  70.     4.times {|i| draw_item(0 + (i%2 == 0 ? 0 : 160), line_height * (i > 1 ? 1 : 0), 2 + i) }
  71.   end
  72.  
  73.   # You can fine-tune all the bits added to x if you want
  74.   def draw_item(x, y, param_id)
  75.     draw_param_name(x + 4, y, param_id)
  76.     draw_current_param(x + 32, y, param_id) if @actor
  77.     draw_right_arrow(x + 74, y)
  78.     draw_new_param(x + 96, y, param_id) if @temp_actor
  79.   end
  80. end
  81.  
  82. #------------------------------------
  83. class Window_ItemList < Window_Selectable
  84.   # 1-column item list looks better (default is 2)
  85.   def col_max
  86.     return 1
  87.   end
  88. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement