Class: UI::Summary_Remind

Inherits:
Summary_Skills show all
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.

Returns:

  • (Integer)

    maximum number of moves shown in the screen

5

Constants inherited from SpriteStack

UI::SpriteStack::NO_INITIAL_IMAGE

Instance Attribute Summary collapse

Attributes inherited from Summary_Skills

#index, #skills

Attributes inherited from SpriteStack

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

Instance Method Summary collapse

Methods inherited from Summary_Skills

#visible=

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

Parameters:



13
14
15
16
17
18
19
20
# File 'scripts/01450 Systems/00102 Party/00002 UI/00500 Summary_Remind.rb', line 13

def initialize(viewport, pokemon)
  # @type [Integer] offset index telling the first move in the list that is shown on the screen
  @offset_index = 0
  @mode = 0
  super(viewport)
  # Setting the pokemon info
  self.data = pokemon
end

Instance Attribute Details

#learnable_skillsArray<PFM::Skill> (readonly)

Returns list of learnable moves.

Returns:



9
10
11
# File 'scripts/01450 Systems/00102 Party/00002 UI/00500 Summary_Remind.rb', line 9

def learnable_skills
  @learnable_skills
end

#modeInteger

Returns mode passed to the PFM::Pokemon#remindable_skills method.

Returns:



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

Parameters:



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

Parameters:



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

Parameters:



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