Class: BattleUI::PlayerChoice

Inherits:
GenericChoice show all
Includes:
PlayerChoiceAbstraction, UI
Defined in:
scripts/01600 Alpha 25 Battle Engine/00001 Battle_Scene/00001 BattleUI/00200 PlayerChoice.rb

Overview

Class that allow the player to make the choice of the action he want to do

The object tells the player validated on #validated? and the result is stored inside #result

The object should be updated through #update otherwise no validation is possible

When result was taken, the scene should call #reset to undo the validated state

Defined Under Namespace

Classes: Button, ItemInfo, SpecialButton, SubChoice

Constant Summary collapse

BUTTON_COORDINATE =

Coordinate of each buttons

[[172, 172], [246, 182], [162, 201], [236, 211]]

Constants inherited from GenericChoice

GenericChoice::CURSOR_OFFSET_X, GenericChoice::CURSOR_OFFSET_Y

Constants inherited from UI::SpriteStack

UI::SpriteStack::NO_INITIAL_IMAGE

Instance Attribute Summary

Attributes included from PlayerChoiceAbstraction

#action, #index, #result

Attributes inherited from GenericChoice

#animation_handler, #scene

Attributes inherited from UI::SpriteStack

#animated, #data, #moving, #stack, #viewport, #x, #y

Instance Method Summary collapse

Methods included from PlayerChoiceAbstraction

#reset, #use_item, #validated?

Methods inherited from GenericChoice

#done?, #reset, #update

Methods included from GoingInOut

#animation_handler, #go_in, #go_out, #in?, #out?

Methods included from HideShow

#animation_handler, #hide, #show

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, #update_animation, #update_position, #visible, #visible=, #with_cache, #with_font, #with_surface, #z, #z=

Constructor Details

#initialize(viewport, scene) ⇒ PlayerChoice

Create a new PlayerChoice Window

Parameters:



18
19
20
21
22
# File 'scripts/01600 Alpha 25 Battle Engine/00001 Battle_Scene/00001 BattleUI/00200 PlayerChoice.rb', line 18

def initialize(viewport, scene)
  @can_switch = true
  @super_reset = true # Specify that the super class has the reset function
  super(viewport, scene)
end