#Original HUD Script By Crissagrim
#
#H.U.D. Light by Necro_100000 (Matt K.)
#Version 1.0
#
#READ ME:
#If your bars do not line up press control + F and look for #EDIT THIS
#And edit this line
#Â self.contents.blt(x, y-ch+12, meter, src_rect)
#
# Edit the +12 to make the bar move up and down. A higher number the
#bar gose down the A lower number makes the bar go up.
#==============================================================================
# Window Hud
#==============================================================================
module Crissaegrim_Hud
Â
Background = "" # Imagem de fundo da hud
HP_Bar = "HP-Bar" # Imagem da barra de HP
MP_Bar = "MP-Bar" # Imagem da barra de MP
Base = "Bars-Base" # Imagm do fundo das barras
OnOff_Hud_Switch = 40 # Switch que ativa / desativa a HUD
Show_Hide_Button = Input::Tab # Tecla que mostra / esconde a HUD
end
#------------------------------------------------------------------------------
class Window_CrissaegrimHud < Window_Base
 def initialize
  super(0,0,544,416)
  self.opacity = 0
 end
  def update
   self.contents.font.size = 16
   self.contents.clear
skill_count = 0
for button in Crissaegrim_ABS::Skill_Button.keys
 next if button == nil
 x = 432
 skill = $data_skills[Crissaegrim_ABS::Skill_Button[button]]
 next if skill == nil
 skill_count += 1
end
item_count = 0
for btn in Crissaegrim_ABS::Item_Button.keys
 next if btn == nil
 item = $data_items[Crissaegrim_ABS::Item_Button[btn]]
 next if item == nil
 x = 432
end
refresh
end
def refresh
 actor = $game_party.members[0]
 draw_hp(actor, 0, 0)
 draw_mp(actor, 0, 24)
 show_state(actor, 130, 0)
if Crissaegrim_ABS::Distance_Weapons.has_key?($game_party.members[0].weapon_id)
if Crissaegrim_ABS::Distance_Weapons[$game_party.members[0].weapon_id][5] > 0
 show_icon($data_items[Crissaegrim_ABS::Distance_Weapons[$game_party.members[0].weapon_id][5]], 0, 356)
 self.contents.font.size = 18
 self.contents.font.color = text_color(15)
 self.contents.draw_text(-3, 364, 24, 28, $game_party.item_number($data_items[Crissaegrim_ABS::Distance_Weapons[$game_party.members[0].weapon_id][5]]),1)
 self.contents.font.size = 16
 self.contents.font.color = text_color(0)
 self.contents.draw_text(-2, 365, 24, 28, $game_party.item_number($data_items[Crissaegrim_ABS::Distance_Weapons[$game_party.members[0].weapon_id][5]]),1)
end
if Crissaegrim_ABS::Distance_Weapons[$game_party.members[0].weapon_id][6] > 0
 show_icon($data_items[Crissaegrim_ABS::Distance_Weapons[$game_party.members[0].weapon_id][6]], 44, 356)
 self.contents.font.size = 18
 self.contents.font.color = text_color(15)
 self.contents.draw_text(43, 364, 24, 28, $game_party.item_number($data_items[Crissaegrim_ABS::Distance_Weapons[$game_party.members[0].weapon_id][6]]),1)
 self.contents.font.size = 16
 self.contents.font.color = text_color(0)
 self.contents.draw_text(44, 365, 24, 28, $game_party.item_number($data_items[Crissaegrim_ABS::Distance_Weapons[$game_party.members[0].weapon_id][6]]),1)
end
end
end
def show_state(actor, x, y)
 count = 0
 for state in actor.states
  draw_icon(state.icon_index, x - 100, y + 110 + 32 * count)
  count += 1
  break if (32 * count > 160)
 end
end
def show_icon(item, x, y)
 if item != nil
  draw_icon(item.icon_index, x, y)
 end
end
def draw_hp(actor, x, y)
 back = Cache.system(Crissaegrim_Hud::Base)
 cw = back.width
 ch = back.height
 src_rect = Rect.new(0, 0, cw, ch)
 self.contents.blt(x, y, back, src_rect)
 meter = Cache.system(Crissaegrim_Hud::HP_Bar)
 cw = meter.width * actor.hp / actor.maxhp
 ch = meter.height
 src_rect = Rect.new(0, 0, cw, ch)
#EDIT THIS
 self.contents.blt(x, y-ch+12, meter, src_rect)
endÂ
def draw_mp(actor, x, y)
 meter = Cache.system(Crissaegrim_Hud::MP_Bar) Â
 cw = meter.width * actor.mp / actor.maxmp
 ch = meter.height
 src_rect = Rect.new(0, 0, cw, ch)
#EDIT THIS
 self.contents.blt(x, y-ch+12, meter, src_rect)
end
end
#------------------------------------------------------------------------------
class Scene_Map
 alias hud_start start
 alias hud_update update
 alias hud_terminate terminate
 def start
  super
  if Crissaegrim_Hud::Background != ""
  @bg = Sprite.new
  @bg.bitmap = Cache.system(Crissaegrim_Hud::Background)
  @bg.x = 1
  @bg.y = 1
  end
  @hud = Window_CrissaegrimHud.new
  @hud.x = 0
  @hud.y = 0
  hud_properties
  hud_start
 end
 def update
  super
  @bg.update if Crissaegrim_Hud::Background != ""
  @hud.update
  hud_properties
  hud_update
 end
 def hud_properties
  if Crissaegrim_Hud::OnOff_Hud_Switch == 0 or $game_switches[Crissaegrim_Hud::OnOff_Hud_Switch] == true
   if @hud.visible == true and Input.trigger?(Crissaegrim_Hud::Show_Hide_Button)
    @hud.visible = false
    @bg.visible = false if Crissaegrim_Hud::Background != ""
   elsif @hud.visible == false and Input.trigger?(Crissaegrim_Hud::Show_Hide_Button)
    @hud.visible = true
    @bg.visible = true if Crissaegrim_Hud::Background != ""
   end
   else
    @hud.visible = false
    @bg.visible = false if Crissaegrim_Hud::Background != ""
   end
  end
 def terminate
  super
  @bg.dispose if Crissaegrim_Hud::Background != ""
  @hud.dispose
  hud_terminate
 end
end