Advertisement
TheSixth

Equip Slot Display Order

Nov 27th, 2016
300
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 1.34 KB | None | 0 0
  1. =begin
  2.  
  3. Just a snippet for changing the order of the equip slots in the equipment menu.
  4.  
  5. Made by: Sixth
  6.  
  7. Put this below the default scripts, as high as possible relative to your other
  8. custom scripts!
  9.  
  10. =end
  11.  
  12. module EqSlotDisp
  13.  
  14.   # Set the equip slot display order here.
  15.   Order = [0,2,3,1,4]
  16.  
  17. end
  18.  
  19. class Window_EquipSlot < Window_Selectable
  20.  
  21.   def rindex(index=@index)
  22.     return EqSlotDisp::Order[index]
  23.   end
  24.  
  25.   def update
  26.     super
  27.     @item_window.slot_id = rindex(index) if @item_window
  28.   end
  29.  
  30.   def item
  31.     @actor ? @actor.equips[rindex(index)] : nil
  32.   end
  33.    
  34.   def draw_item(index)
  35.     return unless @actor
  36.     rect = item_rect_for_text(index)
  37.     change_color(system_color, enable?(index))
  38.     draw_text(rect.x, rect.y, 92, line_height, slot_name(index))
  39.     draw_item_name(@actor.equips[rindex(index)], rect.x + 92, rect.y, enable?(index))
  40.   end
  41.  
  42.   def slot_name(index)
  43.     @actor ? Vocab::etype(@actor.equip_slots[rindex(index)]) : ""
  44.   end
  45.  
  46.   def enable?(index)
  47.     @actor ? @actor.equip_change_ok?(rindex(index)) : false
  48.   end
  49.  
  50. end
  51.  
  52. class Scene_Equip < Scene_MenuBase
  53.  
  54.   def on_item_ok
  55.     Sound.play_equip
  56.     @actor.change_equip(@slot_window.rindex, @item_window.item)
  57.     @slot_window.activate
  58.     @slot_window.refresh
  59.     @item_window.unselect
  60.     @item_window.refresh
  61.   end
  62.  
  63. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement