==============================================================================
# Necro_100000 HUD Version 1.2
#
# BASE VERISON WAS BY: Crissagrim_HUD
# All I did was edit
#
#This code edit simply edits the bars and adds a new one that alowes you to
#Display EXP in real time on the HUD display. IS NOT PLUG AND PLAY and dose
#Take some player edits!
#
#Read the green code to find out what you have to edit.
#==============================================================================
module Crissaegrim_Hud
Â
Background = "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
EXTRA_Bar = "Extra-Bar" #(Necro_100000) Set this to the bar you wish to use for
            #the EXP display! This bar has to be moved...
Base = "Bars-Base" # Imagm do fundo das barras
OnOff_Hud_Switch = 1 # 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
  @actor = $game_party.members[0]
  self.contents.font.size = 16
  self.contents.clear
  skill_count = 0
  if Crissaegrim_ABS::Skill_Button[@actor.id] != nil
   for button in Crissaegrim_ABS::Skill_Button[@actor.id].keys
    next if button == nil
    x = 432
    skill = $data_skills[Crissaegrim_ABS::Skill_Button[@actor.id][button]]
    next if skill == nil
    show_icon(skill, (29 * skill_count) + x, 0)
    skill_count += 1
   end
  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
   show_icon(item, (29 * item_count) + x, 356)
   item_count += 1
   self.contents.font.size = 18
   self.contents.font.color = text_color(15)
   self.contents.draw_text((29 * item_count) + x-32, 364, 32, 28, $game_party.item_number(item),1)
   self.contents.font.size = 16
   self.contents.font.color = text_color(0)
   self.contents.draw_text((29 * item_count) + x-32, 365, 32, 28, $game_party.item_number(item),1)
  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)
  #EDIT )Necro_100000)
  #Set this to the EXP inflation of your caracter!
  #-----------------------------------------------
  inflation = 50
  basis = 25
  #-----------------------------------------------
  meter = Cache.system(Crissaegrim_Hud::EXTRA_Bar) Â
  cw = meter.width * (actor.exp_s - actor.current_lvl_exp) / actor.next_lvl_exp
  ch = meter.height
  src_rect = Rect.new(0, 0, cw, ch)
  #Edit this to move around the bar into the place that you wish to have it
  #To make the backing for the bar simply add the grafic to your hud.
  #If your using the bars that come with the game then open the HUD in paint or
  #Whatever and simply add the backing onto the HUD.
  self.contents.blt(x+19, y-ch+11, meter, src_rect)
  draw_hp(@actor, 0, 0)
  draw_mp(@actor, 0, 24)
  show_state(@actor, 130, 0)
  if Crissaegrim_ABS::Distance_Weapons.has_key?(@actor.weapon_id)
   if Crissaegrim_ABS::Distance_Weapons[@actor.weapon_id][5] > 0
    show_icon($data_items[Crissaegrim_ABS::Distance_Weapons[@actor.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[@actor.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[@actor.weapon_id][5]]),1)
   end
   if Crissaegrim_ABS::Distance_Weapons[@actor.weapon_id][6] > 0
    show_icon($data_items[Crissaegrim_ABS::Distance_Weapons[@actor.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[@actor.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[@actor.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, y + 24 * count)
   count += 1
   break if (24 * count > 76)
  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-ch+24, 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)
  self.contents.blt(x+5, y-ch+17, meter, src_rect)
 endÂ
 def draw_mp(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-ch+24, back, src_rect)
  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)
  self.contents.blt(x+5, y-ch+17, meter, src_rect)
 end
end
#------------------------------------------------------------------------------
class Scene_Map
 alias crissaegrim_abs_hud_start start
 alias crissaegrim_abs_hud_update update
 alias crissaegrim_abs_hud_terminate terminate
 def start
  crissaegrim_abs_hud_start
  if Crissaegrim_Hud::Background != ""
   @bg = Sprite.new
   @bg.bitmap = Cache.system(Crissaegrim_Hud::Background)
  end
  @hud = Window_CrissaegrimHud.new
  showing_hud
  @show = true
 end
 def update
  crissaegrim_abs_hud_update
  @bg.update if Crissaegrim_Hud::Background != ""
  @hud.update
  showing_hud
 end
 def terminate
  crissaegrim_abs_hud_terminate
  @bg.dispose if Crissaegrim_Hud::Background != ""
  @hud.dispose
 end
 def showing_hud
  if Input.trigger?(Crissaegrim_Hud::Show_Hide_Button)
   if @show == true
    @show = false
   else
    @show = true
   end
  end
  if Crissaegrim_Hud::OnOff_Hud_Switch == 0 or $game_switches[Crissaegrim_Hud::OnOff_Hud_Switch] == true
   if @show == true
    @hud.visible = true
    @bg.visible = true if Crissaegrim_Hud::Background != ""
   elsif @show == false
    @hud.visible = false
    @bg.visible = false if Crissaegrim_Hud::Background != ""
   end
  else
   @hud.visible = false
   @bg.visible = false if Crissaegrim_Hud::Background != ""
  end
 end
end