Class: UI::Bag::InfoWide
- Inherits:
-
SpriteStack
- Object
- SpriteStack
- UI::Bag::InfoWide
- Defined in:
- scripts/01450 Systems/00103 Bag/00002 UI/00090 InfoWide.rb
Overview
Class that shows the full item info (descr)
Constant Summary collapse
- COORDINATES =
Coordinate of the UI
0, 33
Constants inherited from SpriteStack
Instance Attribute Summary collapse
-
#mode ⇒ Symbol
readonly
Mode of the bag.
Attributes inherited from SpriteStack
#animated, #data, #moving, #stack, #viewport, #x, #y
Instance Method Summary collapse
-
#initialize(viewport, mode) ⇒ InfoWide
constructor
Create a new InfoWide.
-
#show_item(id)
Change the item it shows.
Methods inherited from SpriteStack
#[], #add_background, #add_line, #add_text, #anime, #anime_delta_set, #dispose, #each, #execute_anime, #move, #move_to, #opacity, #opacity=, #push, #push_sprite, #set_origin, #set_position, #simple_mouse_in?, #size, #stop_animation, #translate_mouse_coords, #update, #update_animation, #update_position, #visible, #visible=, #with_cache, #with_font, #with_surface, #z, #z=
Constructor Details
#initialize(viewport, mode) ⇒ InfoWide
Create a new InfoWide
13 14 15 16 17 |
# File 'scripts/01450 Systems/00103 Bag/00002 UI/00090 InfoWide.rb', line 13 def initialize(, mode) super(, *COORDINATES) @mode = mode init_sprite end |
Instance Attribute Details
#mode ⇒ Symbol (readonly)
Mode of the bag
7 8 9 |
# File 'scripts/01450 Systems/00103 Bag/00002 UI/00090 InfoWide.rb', line 7 def mode @mode end |
Instance Method Details
#show_item(id)
Change the item it shows
21 22 23 24 25 26 27 28 29 30 31 32 33 34 |
# File 'scripts/01450 Systems/00103 Bag/00002 UI/00090 InfoWide.rb', line 21 def show_item(id) unless (self.visible = !id.nil?) @icon.data = 0 @icon.visible = true return @stack.first.visible = true end item = data_item(id) @icon.data = id @quantity.text = (id == 0 ? 0 : $bag.item_quantity(id)).to_s.to_pokemon_number @num_x.visible = @quantity.visible = item.is_limited @name.text = item.exact_name @descr.multiline_text = item.descr @fav_icon.visible = $bag.shortcuts.include?(item.db_symbol) end |