I'm working on a custom ABS HUD, and I'm having a problem that I can't quite figure out. I have it so that the script will only draw the icons of the items you actually have (the IDs can be changed from inside a config module). What I can't figure out is how to do the same thing with the skills; the closest I've been able to come is drawing all of the icons for the skill IDs in the config module:
Item Icons:
class Hud_Item_Bar_Icons < Window_Base
def initialize
super(312, 357, 160, 100)
self.opacity = 0
self.z = 16
end
def update
contents.clear
draw_icon($data_items[MNK_ABS_HUD::ITEM_IDS[0]].icon_index, 0, 0) unless $game_party.item_number($data_items[MNK_ABS_HUD::ITEM_IDS[0]]) == 0
draw_icon($data_items[MNK_ABS_HUD::ITEM_IDS[1]].icon_index, 24, 0) unless $game_party.item_number($data_items[MNK_ABS_HUD::ITEM_IDS[1]]) == 0
draw_icon($data_items[MNK_ABS_HUD::ITEM_IDS[2]].icon_index, 48, 0) unless $game_party.item_number($data_items[MNK_ABS_HUD::ITEM_IDS[2]]) == 0
draw_icon($data_items[MNK_ABS_HUD::ITEM_IDS[3]].icon_index, 72, 0) unless $game_party.item_number($data_items[MNK_ABS_HUD::ITEM_IDS[3]]) == 0
draw_icon($data_items[MNK_ABS_HUD::ITEM_IDS[4]].icon_index, 96, 0) unless $game_party.item_number($data_items[MNK_ABS_HUD::ITEM_IDS[4]]) == 0
end
end
Skill Icons:
class Hud_Skill_Bar_Icons < Window_Base
def initialize
super(312, 407, 160, 100)
self.opacity = 0
self.z = 16
end
def update
contents.clear
draw_icon($data_skills[MNK_ABS_HUD::SKILL_IDS[0]].icon_index, 0, 0)
draw_icon($data_skills[MNK_ABS_HUD::SKILL_IDS[1]].icon_index, 24, 0)
draw_icon($data_skills[MNK_ABS_HUD::SKILL_IDS[2]].icon_index, 48, 0)
draw_icon($data_skills[MNK_ABS_HUD::SKILL_IDS[3]].icon_index, 72, 0)
draw_icon($data_skills[MNK_ABS_HUD::SKILL_IDS[4]].icon_index, 96, 0)
end
end
What am I missing?