My idea is, to show a list of ALL avaliable skills at a specific type, but show only the learned skills (not the usable ...) in one color and the ones not learned yet in another color, heres the code I'm currently using:
As you may see, I made the skill to be "pushed" from ALL the avaliable skills, but now I want to show only the learned ones in normal_color with normal icon and the not learned yet in disabled_color with icon+"_disabled"
So I searched on the Scripts for any definition of style /skill_learn or something, but all I found was the /skill_can_use?, but this method dont' work for my idea, since the skil_can_use means if a skill can be used in batle, menu, never or always, and this is not my point, my point is show skills wich we already learned in one color and the not learned yet in a different color
Any ideas?
thanks
Code:
class Window_Skill < Window_ModifiedSelectable
def initialize(actor)
super(32, 50, 420, 512)
@actor = actor
@column_max = 1
self.z = 100
refresh(0)
self.index = 0
end
def skill
return @data[self.index]
end
def refresh(type)
@type = type
if self.contents != nil
self.contents.dispose
self.contents = nil
end
@data = []
for i in 0...$data_skills.size#@actor.skills.size
skill = $data_skills[i]#[@actor.skills[i]]
if skill != nil
case @type
when 0
if $light_skills_ids.include?(i)
@data.push(skill)
end
when 1
if $dark_skills_ids.include?(i)
@data.push(skill)
end
when 2
if $elemental_skills_ids.include?(i)
@data.push(skill)
end
when 3
if $summon_skills_ids.include?(i)
@data.push(skill)
end
end
end
end
@item_max = @data.size
if @item_max > 0
self.contents = Bitmap.new(width - 32, row_max * 60)
self.contents.font.name = "Comic Sans MS"
self.contents.font.size = 20
for i in 0...@item_max
draw_item(i)
end
end
end
def draw_item(index)
skill = @data[index]
x = 4 + index % @column_max * (288 + 60)
y = index / @column_max * 60
rect = Rect.new(x, y, self.width / @column_max - 32, 32)
self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
bitmap = RPG::Cache.icon(skill.icon_name)
# opacity = self.contents.font.color = normal_color ? 255 : 128
self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 48, 48))#, opacity
if @actor.skill_can_use?(skill.id)
bitmap = RPG::Cache.icon(skill.icon_name)
self.contents.font.color = shadow_color
self.contents.draw_text(x + 54, y + 2, 204, 32, skill.name, 0)
self.contents.font.color = normal_color
self.contents.draw_text(x + 52, y, 204, 32, skill.name, 0)
self.contents.font.color = shadow_color
self.contents.draw_text(x + 246, y + 2, 48, 32, skill.sp_cost.to_s, 2)
self.contents.font.color = normal_color
self.contents.draw_text(x + 244, y, 48, 32, skill.sp_cost.to_s, 2)
else
bitmap = RPG::Cache.icon(skill.icon_name+"_disabled")
self.contents.font.color = shadow_color
self.contents.draw_text(x + 50, y + 2, 204, 32, skill.name, 0)
self.contents.font.color = disabled_color
self.contents.draw_text(x + 52, y, 204, 32, skill.name, 0)
self.contents.font.color = shadow_color
self.contents.draw_text(x + 246, y + 2, 48, 32, skill.sp_cost.to_s, 2)
self.contents.font.color = disabled_color
self.contents.draw_text(x + 244, y, 48, 32, skill.sp_cost.to_s, 2)
end
end
def update_help
@help_window.set_text(self.skill == nil ? "" : self.skill.description)
end
end
As you may see, I made the skill to be "pushed" from ALL the avaliable skills, but now I want to show only the learned ones in normal_color with normal icon and the not learned yet in disabled_color with icon+"_disabled"
So I searched on the Scripts for any definition of style /skill_learn or something, but all I found was the /skill_can_use?, but this method dont' work for my idea, since the skil_can_use means if a skill can be used in batle, menu, never or always, and this is not my point, my point is show skills wich we already learned in one color and the not learned yet in a different color
Any ideas?
thanks