class Window_Skill
def get_element_icon(id)
b = case id
#::::::::::::::::::::::::::::::::::::::::::::::::
# CONFIG BEGIN
#::::::::::::::::::::::::::::::::::::::::::::::::
when 100 then '037-Item06'
# when ID then ICON_FILE_NAME
#::::::::::::::::::::::::::::::::::::::::::::::::
# CONFIG END
#::::::::::::::::::::::::::::::::::::::::::::::::
else
''
end
if b == ''
return nil unless $DEBUG
r = Bitmap.new(24, 24)
r.fill_rect(0, 0, 24, 24, Color.new(255, 255, 255, 192))
r.fill_rect(1, 1, 22, 22, Color.new(0, 0, 0, 192))
r.draw_text(0, 0, 24, 24, id.to_s, 1)
return r
end
return RPG::Cache.icon(b)
end
def make_element_icons
return if self.index < 0
return if self.help_window == nil
return if self.help_window.contents ==nil
skill = @data[self.index]
elements = skill.element_set
return if elements.size < 1
gap = 4 # Gap b/w icons in pixels
x = 608 - elements.size * (24 + gap)
elements.each_with_index {|id, i|
self.help_window.contents.fill_rect(x, 4, 24, 24, Color.new(0, 0, 0, 0))
bitmap = get_element_icon(id)
next if bitmap == nil
opacity = self.contents.font.color == normal_color ? 255 : 128
self.help_window.contents.blt(x, 4, bitmap, bitmap.rect, opacity)
x += 24 + gap}
end
alias win_skill_power_mod_draw_item draw_item
def draw_item(index)
win_skill_power_mod_draw_item(index)
skill = @data[index]
x = 4 + index % 2 * (288 + 32)
y = index / 2 * 32
txt = "#{skill.power} : #{skill.sp_cost}"
self.contents.fill_rect(x+196, y, 84, 32, Color.new(0, 0, 0, 0))
self.contents.draw_text(x + 196, y, 84, 32, txt, 2)
end
def index=(val)
super(val)
make_element_icons
end
alias win_skill_power_mod_help_window_eq help_window=
def help_window=(win)
win_skill_power_mod_help_window_eq(win)
make_element_icons
end
alias win_skill_power_mod_upd_hlp update_help
def update_help
win_skill_power_mod_upd_hlp
if Input.repeat?(Input::LEFT) || Input.repeat?(Input::UP) ||
Input.repeat?(Input::RIGHT) || Input.repeat?(Input::DOWN) ||
Input.repeat?(Input::L) || Input.repeat?(Input::R)
make_element_icons
end
end
end
Run it in DEBUG mode and you'll get dummy icons with the element ID number on them.