Class: BattleUI::PlayerChoice::SubChoice
- Inherits:
-
UI::SpriteStack
- Object
- UI::SpriteStack
- BattleUI::PlayerChoice::SubChoice
- Defined in:
- scripts/01600 Alpha 25 Battle Engine/00001 Battle_Scene/00001 BattleUI/00200 PlayerChoice.rb
Overview
UI element showing the sub_choice and interacting with the parent choice
Constant Summary
Constants inherited from UI::SpriteStack
UI::SpriteStack::NO_INITIAL_IMAGE
Instance Attribute Summary
Attributes inherited from UI::SpriteStack
#animated, #data, #moving, #stack, #viewport, #x, #y
Instance Method Summary collapse
-
#done? ⇒ Boolean
Tell if the choice is done.
-
#initialize(viewport, scene, choice) ⇒ SubChoice
constructor
Create the sub choice.
-
#reset
Reset the sub choice.
-
#update
Update the button.
Methods inherited from UI::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_animation, #update_position, #visible, #visible=, #with_cache, #with_font, #with_surface, #z, #z=
Constructor Details
#initialize(viewport, scene, choice) ⇒ SubChoice
Create the sub choice
184 185 186 187 188 189 |
# File 'scripts/01600 Alpha 25 Battle Engine/00001 Battle_Scene/00001 BattleUI/00200 PlayerChoice.rb', line 184 def initialize(, scene, choice) super() @scene = scene @choice = choice create_sprites end |
Instance Method Details
#done? ⇒ Boolean
Tell if the choice is done
199 200 201 |
# File 'scripts/01600 Alpha 25 Battle Engine/00001 Battle_Scene/00001 BattleUI/00200 PlayerChoice.rb', line 199 def done? return !@item_info.visible && !@bar_visibility end |
#reset
Reset the sub choice
204 205 206 207 208 209 |
# File 'scripts/01600 Alpha 25 Battle Engine/00001 Battle_Scene/00001 BattleUI/00200 PlayerChoice.rb', line 204 def reset @item_info.visible = false @bar_visibility = false @last_item_button.refresh @info_button.refresh end |
#update
Update the button
192 193 194 195 196 |
# File 'scripts/01600 Alpha 25 Battle Engine/00001 Battle_Scene/00001 BattleUI/00200 PlayerChoice.rb', line 192 def update super @item_info.update done? ? update_done : update_not_done end |