Class: Window_EquipSlot
- Inherits:
-
Window_Selectable
- Object
- Window
- Window_Base
- Window_Selectable
- Window_EquipSlot
- Defined in:
- lib/rgss3_default_scripts/Window_EquipSlot.rb
Overview
** Window_EquipSlot
This window displays items the actor is currently equipped with on the
equipment screen.
Instance Attribute Summary collapse
-
#item_window ⇒ Object
Item window.
-
#status_window ⇒ Object
————————————————————————– * Public Instance Variables ————————————————————————–.
Attributes inherited from Window_Selectable
#cursor_all, #cursor_fix, #help_window, #index
Instance Method Summary collapse
-
#actor=(actor) ⇒ Object
————————————————————————– * Set Actor ————————————————————————–.
-
#current_item_enabled? ⇒ Boolean
————————————————————————– * Get Activation State of Selection Item ————————————————————————–.
-
#draw_item(index) ⇒ Object
————————————————————————– * Draw Item ————————————————————————–.
-
#enable?(index) ⇒ Boolean
————————————————————————– * Display Equipment Slot in Enabled State? ————————————————————————–.
-
#initialize(x, y, width) ⇒ Window_EquipSlot
constructor
————————————————————————– * Object Initialization ————————————————————————–.
-
#item ⇒ Object
————————————————————————– * Get Item ————————————————————————–.
-
#item_max ⇒ Object
————————————————————————– * Get Number of Items ————————————————————————–.
-
#slot_name(index) ⇒ Object
————————————————————————– * Get Equipment Slot Name ————————————————————————–.
-
#update ⇒ Object
————————————————————————– * Frame Update ————————————————————————–.
-
#update_help ⇒ Object
————————————————————————– * Update Help Text ————————————————————————–.
-
#visible_line_number ⇒ Object
————————————————————————– * Get Number of Lines to Show ————————————————————————–.
-
#window_height ⇒ Object
————————————————————————– * Get Window Height ————————————————————————–.
Methods inherited from Window_Selectable
#active=, #bottom_row, #bottom_row=, #call_cancel_handler, #call_handler, #call_ok_handler, #call_update_help, #cancel_enabled?, #clear_item, #col_max, #contents_height, #cursor_down, #cursor_left, #cursor_movable?, #cursor_pagedown, #cursor_pageup, #cursor_right, #cursor_up, #draw_all_items, #ensure_cursor_visible, #handle?, #height=, #horizontal?, #item_height, #item_rect, #item_rect_for_text, #item_width, #ok_enabled?, #page_item_max, #page_row_max, #process_cancel, #process_cursor_move, #process_handling, #process_ok, #process_pagedown, #process_pageup, #redraw_current_item, #redraw_item, #refresh, #row, #row_max, #select, #set_handler, #spacing, #top_row, #top_row=, #unselect, #update_cursor, #update_padding, #update_padding_bottom
Methods inherited from Window_Base
#activate, #actor_name, #calc_line_height, #change_color, #close, #contents_height, #contents_width, #convert_escape_characters, #create_contents, #crisis_color, #deactivate, #dispose, #draw_actor_class, #draw_actor_face, #draw_actor_graphic, #draw_actor_hp, #draw_actor_icons, #draw_actor_level, #draw_actor_mp, #draw_actor_name, #draw_actor_nickname, #draw_actor_param, #draw_actor_simple_status, #draw_actor_tp, #draw_character, #draw_currency_value, #draw_current_and_max_values, #draw_face, #draw_gauge, #draw_icon, #draw_item_name, #draw_text, #draw_text_ex, #fitting_height, #gauge_back_color, #hide, #hp_color, #hp_gauge_color1, #hp_gauge_color2, #knockout_color, #line_height, #make_font_bigger, #make_font_smaller, #mp_color, #mp_cost_color, #mp_gauge_color1, #mp_gauge_color2, #normal_color, #obtain_escape_code, #obtain_escape_param, #open, #param_change_color, #party_member_name, #pending_color, #power_down_color, #power_up_color, #process_character, #process_draw_icon, #process_escape_character, #process_new_line, #process_new_page, #process_normal_character, #reset_font_settings, #show, #standard_padding, #system_color, #text_color, #text_size, #tp_color, #tp_cost_color, #tp_gauge_color1, #tp_gauge_color2, #translucent_alpha, #update_close, #update_open, #update_padding, #update_tone
Constructor Details
#initialize(x, y, width) ⇒ Window_EquipSlot
-
Object Initialization
17 18 19 20 21 |
# File 'lib/rgss3_default_scripts/Window_EquipSlot.rb', line 17 def initialize(x, y, width) super(x, y, width, window_height) @actor = nil refresh end |
Instance Attribute Details
#item_window ⇒ Object
Item window
13 14 15 |
# File 'lib/rgss3_default_scripts/Window_EquipSlot.rb', line 13 def item_window @item_window end |
#status_window ⇒ Object
-
Public Instance Variables
12 13 14 |
# File 'lib/rgss3_default_scripts/Window_EquipSlot.rb', line 12 def status_window @status_window end |
Instance Method Details
#actor=(actor) ⇒ Object
-
Set Actor
37 38 39 40 41 |
# File 'lib/rgss3_default_scripts/Window_EquipSlot.rb', line 37 def actor=(actor) return if @actor == actor @actor = actor refresh end |
#current_item_enabled? ⇒ Boolean
-
Get Activation State of Selection Item
86 87 88 |
# File 'lib/rgss3_default_scripts/Window_EquipSlot.rb', line 86 def current_item_enabled? enable?(index) end |
#draw_item(index) ⇒ Object
-
Draw Item
64 65 66 67 68 69 70 |
# File 'lib/rgss3_default_scripts/Window_EquipSlot.rb', line 64 def draw_item(index) return unless @actor rect = item_rect_for_text(index) change_color(system_color, enable?(index)) draw_text(rect.x, rect.y, 92, line_height, slot_name(index)) draw_item_name(@actor.equips[index], rect.x + 92, rect.y, enable?(index)) end |
#enable?(index) ⇒ Boolean
-
Display Equipment Slot in Enabled State?
80 81 82 |
# File 'lib/rgss3_default_scripts/Window_EquipSlot.rb', line 80 def enable?(index) @actor ? @actor.equip_change_ok?(index) : false end |
#item ⇒ Object
-
Get Item
58 59 60 |
# File 'lib/rgss3_default_scripts/Window_EquipSlot.rb', line 58 def item @actor ? @actor.equips[index] : nil end |
#item_max ⇒ Object
-
Get Number of Items
52 53 54 |
# File 'lib/rgss3_default_scripts/Window_EquipSlot.rb', line 52 def item_max @actor ? @actor.equip_slots.size : 0 end |
#slot_name(index) ⇒ Object
-
Get Equipment Slot Name
74 75 76 |
# File 'lib/rgss3_default_scripts/Window_EquipSlot.rb', line 74 def slot_name(index) @actor ? Vocab::etype(@actor.equip_slots[index]) : "" end |
#update ⇒ Object
-
Frame Update
45 46 47 48 |
# File 'lib/rgss3_default_scripts/Window_EquipSlot.rb', line 45 def update super @item_window.slot_id = index if @item_window end |
#update_help ⇒ Object
-
Update Help Text
106 107 108 109 110 |
# File 'lib/rgss3_default_scripts/Window_EquipSlot.rb', line 106 def update_help super @help_window.set_item(item) if @help_window @status_window.set_temp_actor(nil) if @status_window end |
#visible_line_number ⇒ Object
-
Get Number of Lines to Show
31 32 33 |
# File 'lib/rgss3_default_scripts/Window_EquipSlot.rb', line 31 def visible_line_number return 5 end |
#window_height ⇒ Object
-
Get Window Height
25 26 27 |
# File 'lib/rgss3_default_scripts/Window_EquipSlot.rb', line 25 def window_height fitting_height(visible_line_number) end |