Class: UI::Summary_Remind
- Inherits:
-
Summary_Skills
- Object
- SpriteStack
- Summary_Skills
- UI::Summary_Remind
- Defined in:
- scripts/01450 Systems/00102 Party/00002 UI/00500 Summary_Remind.rb
Overview
UI displaying the Reminding move list
Constant Summary collapse
- MAX_MOVES =
Returns maximum number of moves shown in the screen.
5
Constants inherited from SpriteStack
UI::SpriteStack::NO_INITIAL_IMAGE
Instance Attribute Summary collapse
-
#learnable_skills ⇒ Array<PFM::Skill>
readonly
List of learnable moves.
-
#mode ⇒ Integer
Mode passed to the PFM::Pokemon#remindable_skills method.
Attributes inherited from Summary_Skills
Attributes inherited from SpriteStack
#animated, #data, #moving, #stack, #viewport, #x, #y
Instance Method Summary collapse
-
#data=(pokemon)
Set the Pokemon shown.
-
#index=(index)
Set the index of the shown move.
-
#initialize(viewport, pokemon) ⇒ Summary_Remind
constructor
Create a new Summary_Remind UI for the summary.
-
#update_graphics
Update the graphics.
-
#update_skills(pokemon = @data)
Update the skills shown in the UI.
Methods inherited from Summary_Skills
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, pokemon) ⇒ Summary_Remind
Create a new Summary_Remind UI for the summary
13 14 15 16 17 18 19 20 |
# File 'scripts/01450 Systems/00102 Party/00002 UI/00500 Summary_Remind.rb', line 13 def initialize(, pokemon) # @type [Integer] offset index telling the first move in the list that is shown on the screen @offset_index = 0 @mode = 0 super() # Setting the pokemon info self.data = pokemon end |
Instance Attribute Details
#learnable_skills ⇒ Array<PFM::Skill> (readonly)
Returns list of learnable moves.
9 10 11 |
# File 'scripts/01450 Systems/00102 Party/00002 UI/00500 Summary_Remind.rb', line 9 def learnable_skills @learnable_skills end |
#mode ⇒ Integer
Returns mode passed to the PFM::Pokemon#remindable_skills method.
7 8 9 |
# File 'scripts/01450 Systems/00102 Party/00002 UI/00500 Summary_Remind.rb', line 7 def mode @mode end |
Instance Method Details
#data=(pokemon)
Set the Pokemon shown
24 25 26 27 28 29 30 31 32 33 34 35 |
# File 'scripts/01450 Systems/00102 Party/00002 UI/00500 Summary_Remind.rb', line 24 def data=(pokemon) super @gender.ox = 88 - @name.real_width @nature_text.text = PFM::Text.parse(28, pokemon.nature_id) # Load the stat color according to the nature nature = pokemon.nature.partition.with_index { |nat, i| i != 3}.flatten(1) 1.upto(5) do |i| color = nature[i] < 100 ? 23 : 22 color = 0 if nature[i] == 100 @stat_name_texts[i - 1].load_color(color) end end |
#index=(index)
Set the index of the shown move
39 40 41 42 43 44 45 46 |
# File 'scripts/01450 Systems/00102 Party/00002 UI/00500 Summary_Remind.rb', line 39 def index=(index) last_index = (@index || 0) - @offset_index index = fix_index(index) @skills[last_index].selected = false @index = index.to_i @move_info.data = @learnable_skills[@index] if @learnable_skills @skills[@index - @offset_index].selected = true end |
#update_graphics
Update the graphics
57 58 59 |
# File 'scripts/01450 Systems/00102 Party/00002 UI/00500 Summary_Remind.rb', line 57 def update_graphics @icon.update end |
#update_skills(pokemon = @data)
Update the skills shown in the UI
50 51 52 53 54 |
# File 'scripts/01450 Systems/00102 Party/00002 UI/00500 Summary_Remind.rb', line 50 def update_skills(pokemon = @data) @learnable_skills = pokemon.remindable_skills(@mode).collect { |db_symbol| PFM::Skill.new(db_symbol) } @move_info.data = @learnable_skills[@index] update_skill_list end |