#=================================
# Window Hud
# Translation to English by Nathan5555
#=================================
module CrissaegrimHud
#----------------------------------------------------------
# Image of HUD
Picture_Base = "HUD-Base"
# Image of Skills HUD
Picture_Hot_Skills = "HUD-Skills"
# Image of Items HUD
Picture_Hot_Items = "HUD-Items"
# Activate or Deactivates HUD
# if = 0, the HUD will remain on
OnOff_Hud_Switch = 0
#----------------------------------------------------------
end
#----------------------------------------------------------
class Window_CrissaegrimHud < Window_Base
def initialize
super(-12,-12,190,117)
self.opacity = 0
self.visible = false
update
end
def update
if CrissaegrimHud::OnOff_Hud_Switch == 0
self.visible = true
self.active = true
else
if $game_switches[CrissaegrimHud::OnOff_Hud_Switch] == true
self.visible = true
self.active = true
else
self.visible = false
self.active = false
end
end
self.contents.clear
bitmap = Cache.system(CrissaegrimHud::Picture_Base)
self.contents.blt(0, 0, bitmap, Rect.new(0, 0, 148, 85))
refresh
end
def refresh
actor = $game_actors[1]
draw_actor_hp(actor, 16, 0, 96)
draw_actor_mp(actor, 16, 24, 96)
draw_actor_level(actor, 16, 48)
show_state(actor, 119, 2)
end
def show_state(actor, x, y, width = 32)
count = 0
for state in actor.states
draw_icon(state.icon_index, x, y + 28 * count)
count += 1
break if (24 * count > height - 24)
end
end
end
#----------------------------------------------------------
class Window_CrissaegrimHud2 < Window_Base
def initialize
super(40,347,296,80)
self.opacity = 0
self.visible = false
update
end
def update
if CrissaegrimHud::OnOff_Hud_Switch == 0
self.visible = true
self.active = true
else
if $game_switches[CrissaegrimHud::OnOff_Hud_Switch] == true
self.visible = true
self.active = true
else
self.visible = false
self.active = false
end
end
self.contents.clear
bitmap = Cache.system(CrissaegrimHud::Picture_Hot_Skills)
self.contents.blt(0, 0, bitmap, Rect.new(0, 0, 156, 48))
skill_count = 0
for button in Crissaegrim_ABS::Skill_Button.keys
next if button == nil
skill = $data_skills[Crissaegrim_ABS::Skill_Button[button]]
next if skill == nil
show_icon(skill, 10 + 28 * skill_count, 8)
self.contents.font.size = 16
# self.contents.draw_text(16 + 28 * skill_count, 26, 32, 18, "")
skill_count += 1
end
end
def show_icon(item, x, y, enabled = true)
if item != nil
draw_icon(item.icon_index, x, y, enabled)
self.contents.font.color = normal_color
self.contents.font.color.alpha = enabled ? 255 : 128
end
end
end
#----------------------------------------------------------
class Window_CrissaegrimHud3 < Window_Base
def initialize
super(-12,225,80,202)
self.opacity = 0
self.visible = false
update
end
def update
if CrissaegrimHud::OnOff_Hud_Switch == 0
self.visible = true
self.active = true
else
if $game_switches[CrissaegrimHud::OnOff_Hud_Switch] == true
self.visible = true
self.active = true
else
self.visible = false
self.active = false
end
end
self.contents.clear
bitmap = Cache.system(CrissaegrimHud::Picture_Hot_Items)
self.contents.blt(0, 0, bitmap, Rect.new(0, 0, 48, 170))
item_count = 0
for button in Crissaegrim_ABS::Item_Button.keys
next if button == nil
item = $data_items[Crissaegrim_ABS::Item_Button[button]]
next if item == nil
show_item_icon(item, 4, 8 + 30 * item_count)
self.contents.font.size = 16
self.contents.draw_text(28, 12 + 30 * item_count, 32, 18, $game_party.item_number(item))
item_count += 1
end
end
def show_item_icon(item, x, y, enabled = true)
if item != nil
draw_icon(item.icon_index, x, y, enabled)
self.contents.font.color = normal_color
self.contents.font.color.alpha = enabled ? 255 : 128
end
end
end
#----------------------------------------------------------
class Scene_Map
alias hud_start start
alias hud_update update
alias hud_terminate terminate
def start
super
@hud = Window_CrissaegrimHud.new
@hud2 = Window_CrissaegrimHud2.new
@hud3 = Window_CrissaegrimHud3.new
hud_start
end
def update
super
@hud.update
@hud2.update
@hud3.update
hud_update
end
def terminate
super
@hud.dispose
@hud2.dispose
@hud3.dispose
hud_terminate
end
end