HUD

HUD 스크립트 모음

by 아방스 posted Dec 11, 2010
?

단축키

Prev이전 문서

Next다음 문서

ESC닫기

크게 작게 위로 아래로 댓글로 가기 인쇄
hud(Head Up Display)

미리보기 스샷 확인하시구 스크립트 복사하시면 됩니다 ^^




################################################################################
#                                                                              #
#                      ~~~~~ Copyright 2009 SojaBird ~~~~~                     #
#                                                                              #
################################################################################
module HUD_ITEM_HP_MP
  HUD_SWITCH = 1 # Turn this ON to show HUD
  
  ITEM_ID = 1 # Id of item to show
  ACTOR_ID = 0 # Id of actor to show hp/mp (actor1=0, actor2=1...actorN=N-1)
  
  HIDE = true # Hide if player is beneath the hud (true/false)
  OPACITY = 100 # Opacity when hidden
end
################################################################################
class Window_HUD_Item_HP_MP < Window_Base
  include HUD_ITEM_HP_MP
  
  def initialize
    super(0, 0, 90, 104)
    self.opacity = OPACITY
    self.visible = $game_switches[HUD_SWITCH]
    hide_status
    refresh
  end
  
  def refresh
    contents.clear
    @actor = $game_party.members[ACTOR_ID]
    @hp = @actor.hp
    @mp = @actor.mp
    @item = $game_party.item_number($data_items[ITEM_ID])
    item_icon = $data_items[ITEM_ID].icon_index
    draw_icon(item_icon, 0, 0)
    contents.draw_text(24, 0, contents.width - 24, WLH, @item, 2)
    draw_actor_hp(@actor, 0, 24, self.width - 32)
    draw_actor_mp(@actor, 0, 48, self.width - 32)
  end
  
  def hide_status
    if HIDE == true
      if $game_player.screen_x + 16 > self.x and
      $game_player.screen_y + 4 > self.y and
      $game_player.screen_x - 16 < self.x + self.width and
      $game_player.screen_y - 28 < self.y + self.height
        self.opacity = OPACITY
        self.contents_opacity = OPACITY
      else
        self.opacity = 255
        self.contents_opacity = 255
      end
    end
  end
  
  def update
    self.visible = $game_switches[HUD_SWITCH]
    return if !self.visible
    if @icon != $game_party.item_number($data_items[ITEM_ID]) or
      @hp != @actor.hp or @mp != @actor.mp
      refresh
    end
    hide_status
  end
end

#------------------------------------------------------------
# * Scene_Map: Attach HUD to map
#------------------------------------------------------------
class Scene_Map < Scene_Base
  alias start_hud start
  alias terminate_hud terminate
  alias update_hud update
  def start
    start_hud
    @item_hp_mp_hud = Window_HUD_Item_HP_MP.new
  end
  def terminate
    @item_hp_mp_hud.dispose
    terminate_hud
  end
  def update
    update_hud
    @item_hp_mp_hud.update
  end
end
 
 
 

################################################################################
#                                                                              #
#                      ~~~~~ Copyright 2009 SojaBird ~~~~~                     #
#                                                                              #
################################################################################
module HUD_X_Y
  REAL_MAP = "MAP" # Real x/y co�rdinates or map position ("REAL", "MAP")
  VISIBLE = true # Visible or not (true/false)
end
################################################################################

class Hud_X_Y < Window_Base
  
  include HUD_X_Y
  
  def initialize
    super(0, 336, 90, 80)
    self.visible = VISIBLE
    refresh
  end
  
  def refresh
    contents.clear
    case REAL_MAP
    when "REAL"
      @x = $game_player.real_x
      @y = $game_player.real_y
    when "MAP"
      @x = $game_player.x
      @y = $game_player.y
    end
    contents.draw_text(0, 0, self.width - 32, WLH, "X: #{@x}", 1)
    contents.draw_text(0, 24, self.width - 32, WLH, "Y: #{@y}", 1)
  end

  def update
    case REAL_MAP
    when "REAL"
      if @x != $game_player.real_x or @y != $game_player.real_y
        refresh
      end
    when "MAP"
      if @x != $game_player.x or @y != $game_player.y
        refresh
      end
    end
  end
end

#------------------------------------------------------------
# * Scene_Map: Attach HUD to map
#------------------------------------------------------------
class Scene_Map < Scene_Base
  alias start_xy_hud start
  alias terminate_xy_hud terminate
  alias update_xy_hud update
  def start
    start_xy_hud
    @x_y = Hud_X_Y.new
  end
  def terminate
    @x_y.dispose
    terminate_xy_hud
  end
  def update
    update_xy_hud
    @x_y.update
  end
end




################################################################################
#                                                                              #
#                      ~~~~~ Copyright 2009 SojaBird ~~~~~                     #
#                                                                              #
################################################################################

# To toggle the hud's display, just do a callscript "hud"
# To set the hud's display, just do a callscript "hud(true)" or "hud(false)"

module HUD_HP_MP_EXP_NAME_FACE_LEVEL
  HUD_WIDTH = 126 # The width of the HUD (when 126, face will be drawn)
  FACE_OPACITY = 100 # The opacity of the background face (when HUD_WIDTH = 126)

  BG_DISPLAY = true # Show or hide the backgroundwindow [true/false]

  EXP_NAME = "E" # What should be displayed for the EXP
  
  ACTOR_ID = 0 # Id of actor to show data of (actor1=0, actor2=1...actorN=N-1)
  
  HIDE = true # Hide if player is beneath the HUD [true/false]
  OPACITY = 100 # Opacity when hidden [0-255]
  
  HUD_START_DISPLAY = true # Wheter to display the HUD at start [true/false]
  
  CYCLE = true # Wheter to enable to cyle through actors with L&R buttons
end

################################################################################
def hud(arg = nil)
  $game_system.hud_display = !$game_system.hud_display if arg == nil
  $game_system.hud_display = arg if arg != nil
end
################################################################################
class Window_HUD_HP_MP_EXP_NAME_FACE_LEVEL < Window_Base
  include HUD_HP_MP_EXP_NAME_FACE_LEVEL
  
  attr_reader :index
  
  def initialize(index)
    @index = index
    super(0, 0, HUD_WIDTH, WLH * 4 + 32)
    self.visible = $game_system.hud_display
    self.opacity = OPACITY
    self.opacity = 0 if !BG_DISPLAY
    @actor = $game_party.members[@index]
    @width = HUD_WIDTH - 32
    hide_status
    refresh
  end
  
  def refresh
    contents.clear
    @hp = @actor.hp
    @mp = @actor.mp
    @exp = @actor.exp
    @name = @actor.name
    @level = @actor.level
    @face = [@actor.face_name, @actor.face_index]
    draw_actor_face_picture(@actor, 0, 0, FACE_OPACITY) if HUD_WIDTH == 126
    draw_actor_name_and_level(@actor, 0, WLH * 0)
    draw_actor_hp(@actor, 0, WLH * 1, @width)
    draw_actor_mp(@actor, 0, WLH * 2, @width)
    draw_actor_exp(@actor, 0, WLH * 3, @width)
  end
  
  def hide_status
    if HIDE == true
      if $game_player.screen_x + 16 > self.x and
      $game_player.screen_y + 4 > self.y and
      $game_player.screen_x - 16 < self.x + self.width and
      $game_player.screen_y - 28 < self.y + self.height
        self.opacity = OPACITY if BG_DISPLAY
        self.contents_opacity = OPACITY
      else
        self.opacity = 255 if BG_DISPLAY
        self.contents_opacity = 255
      end
    end
  end
  
  def draw_actor_face_picture(actor, x, y, opacity, size = 94)
    bitmap = Cache.face(actor.face_name)
    rect = Rect.new(0, 0, 0, 0)
    rect.x = actor.face_index % 4 * 96 + (96 - size) / 2
    rect.y = actor.face_index / 4 * 96 + (96 - size) / 2
    rect.width = size
    rect.height = size
    self.contents.blt(x, y, bitmap, rect, opacity)
    bitmap.dispose
  end
  
  def draw_actor_name_and_level(actor, x, y)
    self.contents.font.color = hp_color(actor)
    self.contents.draw_text(x, y, @width - 32 - 24, WLH, actor.name)
    self.contents.font.color = system_color
    x = @width / 2
    width = (@width.to_f / 2) / (32 + 24)
    self.contents.draw_text(x, y, width * 32, WLH, Vocab::level_a)
    self.contents.font.color = normal_color
    self.contents.draw_text(x + width * 32, y, width * 24, WLH, actor.level, 2)
  end
  
  def draw_actor_exp(actor, x, y, width)
    s1 = actor.exp_s
    s2 = actor.next_rest_exp_s + s1
    if s1.is_a? String or s2.is_a? String
      s1 = actor.exp
      s2 = actor.exp
    end
    draw_actor_exp_gauge(actor, x, y, s1, s2, width)
    self.contents.font.color = system_color
    self.contents.draw_text(x, y, 30, WLH, EXP_NAME)
    self.contents.font.color = normal_color
    last_font_size = self.contents.font.size
    xr = x + width
    if width < 120
      self.contents.draw_text(xr - 44, y, 44, WLH, s1, 2)
    else
      self.contents.draw_text(xr - 99, y, 44, WLH, s1, 2)
      self.contents.font.color = normal_color
      self.contents.draw_text(xr - 55, y, 11, WLH, "/", 2)
      self.contents.draw_text(xr - 44, y, 44, WLH, s2, 2)
    end
  end
  
  def draw_actor_exp_gauge(actor, x, y, s1, s2, width)
    gw = width * s1 / s2
    gc1 = text_color(31)
    gc2 = text_color(27)
    self.contents.fill_rect(x, y + WLH - 8, width, 6, gauge_back_color)
    self.contents.gradient_fill_rect(x, y + WLH - 8, gw, 6, gc1, gc2)
  end
  
  def update
    self.visible = $game_system.hud_display
    return if !self.visible
    if @hp != @actor.hp or
      @mp != @actor.mp or
      @exp != @actor.exp or
      @name != @actor.name or
      @level != @actor.level or
      @face != [@actor.face_name, @actor.face_index]
      refresh
    end
    hide_status
  end
end

#------------------------------------------------------------
# * Scene_Map: Attach HUD to map
#------------------------------------------------------------
class Scene_Map < Scene_Base
  alias start_hmexp_name_face_lvl start
  alias terminate_hmexp_name_face_lvl terminate
  alias update_hmexp_name_face_lvl update
  def start
    start_hmexp_name_face_lvl
    @index = HUD_HP_MP_EXP_NAME_FACE_LEVEL::ACTOR_ID
    new_hud
    
  end
  def terminate
    @hp_mp_exp_name_face_hud.dispose
    terminate_hmexp_name_face_lvl
  end
  def update
    update_hmexp_name_face_lvl
    @hp_mp_exp_name_face_hud.update
    return if !HUD_HP_MP_EXP_NAME_FACE_LEVEL::CYCLE
    return if !@hp_mp_exp_name_face_hud.visible
    if Input.trigger?(Input::R)
      if @index == $game_party.members.size - 1
        @index = 0
      else
        @index += 1
      end
    elsif Input.trigger?(Input::L)
      if @index == 0
        @index = $game_party.members.size - 1
      else
        @index -= 1
      end
    end
    new_hud if @index != @hp_mp_exp_name_face_hud.index
  end
  
  def new_hud
    @hp_mp_exp_name_face_hud.dispose if !@hp_mp_exp_name_face_hud.nil?
    @hp_mp_exp_name_face_hud = Window_HUD_HP_MP_EXP_NAME_FACE_LEVEL.new(@index)
  end
end

#------------------------------------------------------------
# * Game_System: Check for display
#------------------------------------------------------------
class Game_System
  alias hud_initialize initialize
  attr_accessor :hud_display
  def initialize
    hud_initialize
    @hud_display = HUD_HP_MP_EXP_NAME_FACE_LEVEL::HUD_START_DISPLAY
  end
end





################################################################################
#                                                                              #
#                      ~~~~~ Copyright 2010 SojaBird ~~~~~                     #
#                                                                              #
################################################################################

# To toggle the hud's display, just do a callscript "hud"
# To set the hud's display, just do a callscript "hud(true)" or "hud(false)"

module HUD_HP_MP_G_NAME_FACE_LEVEL
  HUD_WIDTH = 126 # The width of the HUD (when 126, face will be drawn)
  FACE_OPACITY = 100 # The opacity of the background face (when HUD_WIDTH = 126)

  BG_DISPLAY = true # Show or hide the backgroundwindow [true/false]
  
  ACTOR_ID = 0 # Id of actor to show data of (actor1=0, actor2=1...actorN=N-1)
  
  ICON_ID = 147 # Number of the gold icon
  
  HIDE = true # Hide if player is beneath the HUD [true/false]
  OPACITY = 100 # Opacity when hidden [0-255]
  
  HUD_START_DISPLAY = true # Wheter to display the HUD at start [true/false]
  
  CYCLE = true # Wheter to enable to cyle through actors with L&R buttons
end

################################################################################
def hud(arg = nil)
  $game_system.hud_display = !$game_system.hud_display if arg == nil
  $game_system.hud_display = arg if arg != nil
end
################################################################################
class Window_HUD_HP_MP_G_NAME_FACE_LEVEL < Window_Base
  include HUD_HP_MP_G_NAME_FACE_LEVEL
  
  attr_reader :index
  
  def initialize(index)
    @index = index
    super(0, 0, HUD_WIDTH, WLH * 4 + 32)
    self.visible = $game_system.hud_display
    self.opacity = OPACITY
    self.opacity = 0 if !BG_DISPLAY
    @actor = $game_party.members[@index]
    @width = HUD_WIDTH - 32
    hide_status
    refresh
  end
  
  def refresh
    contents.clear
    @hp = @actor.hp
    @mp = @actor.mp
    @gold = $game_party.gold
    @name = @actor.name
    @level = @actor.level
    @face = [@actor.face_name, @actor.face_index]
    draw_actor_face_picture(@actor, 0, 0, FACE_OPACITY) if HUD_WIDTH == 126
    draw_actor_name_and_level(@actor, 0, WLH * 0)
    draw_actor_hp(@actor, 0, WLH * 1, @width)
    draw_actor_mp(@actor, 0, WLH * 2, @width)
    draw_gold_amount(0, WLH * 3)
  end
  
  def hide_status
    if HIDE == true
      if $game_player.screen_x + 16 > self.x and
      $game_player.screen_y + 4 > self.y and
      $game_player.screen_x - 16 < self.x + self.width and
      $game_player.screen_y - 28 < self.y + self.height
        self.opacity = OPACITY if BG_DISPLAY
        self.contents_opacity = OPACITY
      else
        self.opacity = 255 if BG_DISPLAY
        self.contents_opacity = 255
      end
    end
  end
  
  def draw_actor_face_picture(actor, x, y, opacity, size = 94)
    bitmap = Cache.face(actor.face_name)
    rect = Rect.new(0, 0, 0, 0)
    rect.x = actor.face_index % 4 * 96 + (96 - size) / 2
    rect.y = actor.face_index / 4 * 96 + (96 - size) / 2
    rect.width = size
    rect.height = size
    self.contents.blt(x, y, bitmap, rect, opacity)
    bitmap.dispose
  end
  
  def draw_actor_name_and_level(actor, x, y)
    self.contents.font.color = hp_color(actor)
    self.contents.draw_text(x, y, @width - 32 - 24, WLH, actor.name)
    self.contents.font.color = system_color
    x = @width / 2
    width = (@width.to_f / 2) / (32 + 24)
    self.contents.draw_text(x, y, width * 32, WLH, Vocab::level_a)
    self.contents.font.color = normal_color
    self.contents.draw_text(x + width * 32, y, width * 24, WLH, actor.level, 2)
  end
  
   def draw_gold_amount(x, y)
    draw_icon(ICON_ID, x, y)
    draw_currency_value(@gold, x + 24, y, 94 - 24)
  end
  
  def update
    self.visible = $game_system.hud_display
    return if !self.visible
    if @hp != @actor.hp or
      @mp != @actor.mp or
      @name != @actor.name or
      @level != @actor.level or
      @face != [@actor.face_name, @actor.face_index] or
      @gold != $game_party.gold
      refresh
    end
    hide_status
  end
end

#------------------------------------------------------------
# * Scene_Map: Attach HUD to map
#------------------------------------------------------------
class Scene_Map < Scene_Base
  alias start_hmp_g_name_face_lvl start
  alias terminate_hmp_g_name_face_lvl terminate
  alias update_hmp_g_name_face_lvl update
  def start
    start_hmp_g_name_face_lvl
    @index = HUD_HP_MP_G_NAME_FACE_LEVEL::ACTOR_ID
    new_hud
  end
  def terminate
    @hp_mp_g_name_face_hud.dispose
    terminate_hmp_g_name_face_lvl
  end
  def update
    update_hmp_g_name_face_lvl
    @hp_mp_g_name_face_hud.update
    return if !HUD_HP_MP_G_NAME_FACE_LEVEL::CYCLE
    return if !@hp_mp_g_name_face_hud.visible
    if Input.trigger?(Input::R)
      if @index == $game_party.members.size - 1
        @index = 0
      else
        @index += 1
      end
    elsif Input.trigger?(Input::L)
      if @index == 0
        @index = $game_party.members.size - 1
      else
        @index -= 1
      end
    end
    new_hud if @index != @hp_mp_g_name_face_hud.index
  end
  
  def new_hud
    @hp_mp_g_name_face_hud.dispose if !@hp_mp_g_name_face_hud.nil?
    @hp_mp_g_name_face_hud = Window_HUD_HP_MP_G_NAME_FACE_LEVEL.new(@index)
  end
end

#------------------------------------------------------------
# * Game_System: Check for display
#------------------------------------------------------------
class Game_System
  alias hud_initialize initialize
  attr_accessor :hud_display
  def initialize
    hud_initialize
    @hud_display = HUD_HP_MP_G_NAME_FACE_LEVEL::HUD_START_DISPLAY
  end
end



################################################################################
#                                                                              #
#                      ~~~~~ Copyright 2009 SojaBird ~~~~~                     #
#                                                                              #
################################################################################

# To toggle the hud's display, just do a callscript "hud"
# To set the hud's display, just do a callscript "hud(true)" or "hud(false)"

module Vertical_Bars
  EXP_NAME = "E" # What should be displayed for the EXP
  
  FILL_BOTTOM_UP = true # The way the bars fill (true = bottom up) [true/false]
  
  ACTOR_ID = 0 # Id of actor to show data of (actor1=0, actor2=1...actorN=N-1)
  
  ICON_ID = 147 # Number of the gold icon (use "" for no gold-display)
  
  HIDE = true # Hide if player is beneath the HUD [true/false]
  OPACITY = 100 # Opacity when hidden [0-255]
  
  HUD_START_DISPLAY = true # Wheter to display the HUD at start [true/false]
end

################################################################################
def hud(arg = nil)
  $game_system.hud_display = !$game_system.hud_display if arg == nil
  $game_system.hud_display = arg if arg != nil
end
################################################################################
class Vertical_Bars_HUD < Window_Base
  include Vertical_Bars
  
  def initialize
    @bw = 24
    height = 94 + WLH + 32
    height += WLH if Vertical_Bars::ICON_ID != ""
    super(0, 0, 94 + (@bw * 3) + 32, height)
    self.opacity = OPACITY
    self.visible = $game_system.hud_display
    @actor = $game_party.members[ACTOR_ID]
    hide_status
    refresh
  end
  
  def refresh
    contents.clear
    @hp = @actor.hp
    @mp = @actor.mp
    @exp = @actor.exp
    @name = @actor.name
    @face = [@actor.face_name, @actor.face_index]
    @gold = $game_party.gold if ICON_ID != ""
    draw_actor_face_picture(@actor, 0, 0)
    draw_actor_name(@actor, 0, 94)
    draw_actor_HUD_hp(@actor, 94 + (@bw * 0) + 5, 0, self.contents.height)
    draw_actor_HUD_mp(@actor, 94 + (@bw * 1) + 5, 0, self.contents.height)
    draw_actor_HUD_exp(@actor, 94 + (@bw * 2) + 5, 0, self.contents.height)
    draw_gold_amount(0, 94 + WLH) if ICON_ID != ""
  end
  
  def hide_status
    if HIDE == true
      if $game_player.screen_x + 16 > self.x and
      $game_player.screen_y + 4 > self.y and
      $game_player.screen_x - 16 < self.x + self.width and
      $game_player.screen_y - 28 < self.y + self.height
        self.opacity = OPACITY
        self.contents_opacity = OPACITY
      else
        self.opacity = 255
        self.contents_opacity = 255
      end
    end
  end
  
  def draw_actor_face_picture(actor, x, y, opacity = 255, size = 94)
    bitmap = Cache.face(actor.face_name)
    rect = Rect.new(0, 0, 0, 0)
    rect.x = actor.face_index % 4 * 96 + (96 - size) / 2
    rect.y = actor.face_index / 4 * 96 + (96 - size) / 2
    rect.width = size
    rect.height = size
    self.contents.blt(x, y, bitmap, rect, opacity)
    bitmap.dispose
  end
  
  def draw_actor_HUD_hp(actor, x, y, height)
    draw_actor_HUD_hp_gauge(actor, x + 2, y, height)
    self.contents.font.color = system_color
    self.contents.draw_text(x, y, @bw, WLH, Vocab::hp_a)
    self.contents.font.color = hp_color(actor)
    last_font_size = self.contents.font.size
    actor.hp.to_s.scan(/./).each do |i|
      y += 1
      self.contents.draw_text(x + 1, y * 14 + 10, 11, WLH, i, 1)
    end
  end
  
  def draw_actor_HUD_hp_gauge(actor, x, y, height)
    gh = (height - 16) * actor.hp / actor.maxhp
    gc1 = hp_gauge_color2
    gc2 = hp_gauge_color1
    self.contents.fill_rect(x, y + WLH - 8, 10, height, gauge_back_color)
    y += height - gh - 16 if FILL_BOTTOM_UP
    self.contents.gradient_fill_rect(x, y + 16, 10, gh, gc1, gc2, true)
  end
  
  def draw_actor_HUD_mp(actor, x, y, height)
    draw_actor_HUD_mp_gauge(actor, x + 2, y, height)
    self.contents.font.color = system_color
    self.contents.draw_text(x, y, @bw, WLH, Vocab::mp_a)
    self.contents.font.color = mp_color(actor)
    last_font_size = self.contents.font.size
    actor.mp.to_s.scan(/./).each do |i|
      y += 1
      self.contents.draw_text(x + 1, y * 14 + 10, 11, WLH, i, 1)
    end
  end
  
  def draw_actor_HUD_mp_gauge(actor, x, y, height)
    gh = (height - 16) * actor.mp / [actor.maxmp, 1].max
    gc1 = mp_gauge_color2
    gc2 = mp_gauge_color1
    self.contents.fill_rect(x, y + WLH - 8, 10, height, gauge_back_color)
    y += height - gh - 16 if FILL_BOTTOM_UP
    self.contents.gradient_fill_rect(x, y + 16, 10, gh, gc1, gc2, true)
  end
  
  def draw_actor_HUD_exp(actor, x, y, height)
    s1 = actor.exp_s
    s2 = actor.next_rest_exp_s + s1
    if s1.is_a? String or s2.is_a? String
      s1 = actor.exp
      s2 = actor.exp
    end
    draw_actor_HUD_exp_gauge(actor, x + 2, y, s1, s2, height)
    self.contents.font.color = system_color
    self.contents.draw_text(x, y, @bw, WLH, EXP_NAME)
    self.contents.font.color = normal_color
    last_font_size = self.contents.font.size
    actor.exp.to_s.scan(/./).each do |i|
      y += 1
      self.contents.draw_text(x + 1, y * 14 + 10, 11, WLH, i, 1)
    end
  end
  
  def draw_actor_HUD_exp_gauge(actor, x, y, s1, s2, height)
    gh = (height - 16) * s1 / s2
    gc1 = text_color(27)
    gc2 = text_color(31)
    self.contents.fill_rect(x, y + WLH - 8, 10, height, gauge_back_color)
    y += height - gh - 16 if FILL_BOTTOM_UP
    self.contents.gradient_fill_rect(x, y + 16, 10, gh, gc1, gc2, true)
  end
  
  def draw_gold_amount(x, y)
    draw_icon(ICON_ID, x, y)
    draw_currency_value(@gold, x + 24, y, 94 - 24)
  end
  
  def update
    self.visible = $game_system.hud_display
    return if !self.visible
    if @hp != @actor.hp or
    @mp != @actor.mp or
    @exp != @actor.exp or
    @name != @actor.name or
    @face != [@actor.face_name, @actor.face_index]
      refresh
    end
    if @gold != $game_party.gold and ICON_ID != ""
      refresh
    end
    hide_status
  end
end

#------------------------------------------------------------
# * Scene_Map: Attach HUD to map
#------------------------------------------------------------
class Scene_Map < Scene_Base
  alias start_hud start
  alias terminate_hud terminate
  alias update_hud update
  def start
    start_hud
    @vertical_bars_hud = Vertical_Bars_HUD.new
  end
  def terminate
    @vertical_bars_hud.dispose
    terminate_hud
  end
  def update
    update_hud
    @vertical_bars_hud.update
  end
end

#------------------------------------------------------------
# * Game_System: Check for display
#------------------------------------------------------------
class Game_System
  alias hud_initialize initialize
  attr_accessor :hud_display
  def initialize
    hud_initialize
    @hud_display = Vertical_Bars::HUD_START_DISPLAY
  end
end





################################################################################
#                                                                              #
#                      ~~~~~ Copyright 2009 SojaBird ~~~~~                     #
#                                                                              #
################################################################################
#------------------------------------------------------------
# * Game_MiniMap: Gets amount of enemies on the map
#------------------------------------------------------------
class Game_MiniMap
  attr_reader :enemies
  
  alias hud_initialize initialize
  alias draw_hud_object draw_object
  
  def initialize(tilemap)
    @enemies = 0
    hud_initialize(tilemap)
  end
  
  def draw_object
    @enemies = 0
    draw_hud_object
    @object_list.each do |key, events|
      color = MiniMap::OBJECT_COLOR[key]
      next if events.nil? or color.nil?
      events.each do |obj|
        if !obj.character_name.empty?
          @enemies += 1 if color == MiniMap::OBJECT_COLOR['enemy']
        end
      end
    end
  end
end

#------------------------------------------------------------
# * Woratana_MiniMap_Enemy_HUD: Creates the HUD
#------------------------------------------------------------
class Woratana_MiniMap_Enemy_HUD < Window_Base
  include MiniMap
  
  def initialize
    @x = MAP_RECT[0]
    @y = MAP_RECT[1] + MAP_RECT[3] - 16
    @width = MAP_RECT[2]
    @height = WLH + 32
    super(@x, @y, @width, @height)
    self.visible = $game_system.show_minimap
    self.opacity = 0
    self.z = MAP_Z + 1
    @enemies_total = $scene.spriteset.minimap.enemies
    @enemies = $scene.spriteset.minimap.enemies
    refresh
  end
  
  def color
    return knockout_color if @enemies >= (@enemies_total.to_f / 2)
    return crisis_color if @enemies > 0
    return power_up_color
  end
  
  def draw_border
    @border = Sprite.new
    @border.x = @x - MINIMAP_BORDER_SIZE
    @border.y = @y + 16
    b_width = @width + (MINIMAP_BORDER_SIZE * 2)
    b_height = @height + (MINIMAP_BORDER_SIZE * 2) - 32
    @border.bitmap = Bitmap.new(b_width, b_height)
    @border.bitmap.fill_rect(@border.bitmap.rect, MINIMAP_BORDER_COLOR)
    @border.bitmap.clear_rect(MINIMAP_BORDER_SIZE, MINIMAP_BORDER_SIZE,
    @border.bitmap.width - (MINIMAP_BORDER_SIZE * 2),
    @border.bitmap.height - (MINIMAP_BORDER_SIZE * 2))
    @border.z = MAP_Z
  end
  
  def draw_background
    @background = Sprite.new
    @background.x = @x
    @background.y = @y + MINIMAP_BORDER_SIZE + 16
    b_width = @width
    b_height = @height - 32
    @background.bitmap = Bitmap.new(b_width, b_height)
    @background.bitmap.fill_rect(@background.bitmap.rect, BACKGROUND_COLOR)
    @background.z = MAP_Z
  end
  
  def refresh
    contents.clear
    draw_border if @border.nil?
    draw_background if @background.nil?
    @enemies = $scene.spriteset.minimap.enemies
    self.contents.font.color = color
    @string = "#{@enemies}/#{@enemies_total}"
    self.contents.draw_text(0, 0, self.width - 32, WLH, @string, 1)
  end
  
  def dispose
    @border.dispose if !@border.nil?
    @background.dispose if !@background.nil?
  end
  
  def update
    self.visible = $game_system.show_minimap
    return if !self.visible
    if $scene.is_a?(Scene_Map) and @enemies != $scene.spriteset.minimap.enemies
      refresh
    end
  end
end

#------------------------------------------------------------
# * Scene_Map: Attach HUD to map
#------------------------------------------------------------
class Scene_Map < Scene_Base
  alias start_hud start
  alias terminate_hud terminate
  alias update_hud update
  def start
    start_hud
    @woratana_minimap_enemy_hud = Woratana_MiniMap_Enemy_HUD.new
  end
  def terminate
    @woratana_minimap_enemy_hud.dispose
    terminate_hud
  end
  def update
    update_hud
    @woratana_minimap_enemy_hud.update
  end
end







################################################################################
#                                                                              #
#                      ~~~~~ Copyright 2009 SojaBird ~~~~~                     #
#                                                                              #
################################################################################

# To toggle the hud's display, just do a callscript "hud"
# To set the hud's display, just do a callscript "hud(true)" or "hud(false)"

module ALL_NAME_HP_MP
  HUD_SWITCH = 1 # Turn this ON to show HUD
  
  ITEM_ID = 1 # Id of item to show
  ACTOR_ID = 0 # Id of actor to show hp/mp (actor1=0, actor2=1...actorN=N-1)
  
  HIDE = true # Hide if player is beneath the hud (true/false)
  OPACITY = 100 # Opacity when hidden
  
  WIDTH = 150 # The width of the HUD [>32-544]
  NAME_WIDTH = 50 # The width the name uses
  
  BG_DISPLAY = true # Wheter to display the HUD's borderwindow [true/false]
  
  HUD_START_DISPLAY = true # Wheter to display the HUD at start [true/false]
end
################################################################################
def hud(arg = nil)
  $game_system.hud_display = !$game_system.hud_display if arg == nil
  $game_system.hud_display = arg if arg != nil
end
################################################################################
class All_Name_Hp_Mp < Window_Base
  include ALL_NAME_HP_MP
  
  def initialize
    @m = $game_party.members
    @as = @m.size
    @w = WIDTH
    @h = @as * 24 + 32
    @x = 544 - @w
    @y = 416 - @h
    super(@x, @y, @w, @h)
    @bw = self.contents.width - NAME_WIDTH
    @bh = 6
    self.visible = $game_system.hud_display
    self.opacity = OPACITY
    self.opacity = 0 if !BG_DISPLAY
    hide_status
    refresh
  end
  
  def refresh
    @y = 0
    @a_list = []
    contents.clear
    @m.each do |i|
      @name = i.name
      @hp = i.hp
      @mp = i.mp
      @lvl = i.level
      @act = [@name, @hp, @mp, @lvl]
      @a_list.push(@act)
      
      draw_actor_info(i, "name", 0, @y, NAME_WIDTH)
      draw_actor_info(i, "hp", NAME_WIDTH, @y + (WLH / 2) - @bh, @bw, @bh)
      @y += 12
      draw_actor_info(i, "mp", NAME_WIDTH, @y, @bw, @bh)
      @y += 12
    end
  end

  def draw_actor_info(actor, info, x, y, width, height = WLH)
    case info
    when "name"
      self.contents.font.color = hp_color(actor)
      self.contents.draw_text(x, y, width, height, actor.name)
    when "hp"
      draw_actor_gauge(actor, info, x, y, width, height)
    when "mp"
      draw_actor_gauge(actor, info, x, y, width, height)
    end
  end
  
  def draw_actor_gauge(actor, info, x, y, width, height)
    case info
    when "hp"
      gw = width * actor.hp / [actor.maxhp, 1].max
      gc1 = hp_gauge_color1
      gc2 = hp_gauge_color2
    when "mp"
      gw = width * actor.mp / [actor.maxmp, 1].max
      gc1 = mp_gauge_color1
      gc2 = mp_gauge_color2
    end
    self.contents.fill_rect(x, y, width, height, gauge_back_color)
    self.contents.gradient_fill_rect(x, y, gw, height, gc1, gc2)
  end

  def draw_actor_mp(actor, x, y, width = 120)
    draw_actor_mp_gauge(actor, x, y, width)
    self.contents.font.color = system_color
    self.contents.draw_text(x, y, 30, WLH, Vocab::mp_a)
    self.contents.font.color = mp_color(actor)
    last_font_size = self.contents.font.size
    xr = x + width
    if width < 120
      self.contents.draw_text(xr - 44, y, 44, WLH, actor.mp, 2)
    else
      self.contents.draw_text(xr - 99, y, 44, WLH, actor.mp, 2)
      self.contents.font.color = normal_color
      self.contents.draw_text(xr - 55, y, 11, WLH, "/", 2)
      self.contents.draw_text(xr - 44, y, 44, WLH, actor.maxmp, 2)
    end
  end
  
  def draw_actor_mp_gauge(actor, x, y, width = 120)
    gw = width * actor.mp / [actor.maxmp, 1].max
    gc1 = mp_gauge_color1
    gc2 = mp_gauge_color2
    self.contents.fill_rect(x, y + WLH - 8, width, 6, gauge_back_color)
    self.contents.gradient_fill_rect(x, y + WLH - 8, gw, 6, gc1, gc2)
  end
  
  
  def hide_status
    if HIDE == true
      if $game_player.screen_x + 16 > self.x and
      $game_player.screen_y + 4 > self.y and
      $game_player.screen_x - 16 < self.x + self.width and
      $game_player.screen_y - 28 < self.y + self.height
        self.opacity = OPACITY if BG_DISPLAY
        self.contents_opacity = OPACITY
      else
        self.opacity = 255 if BG_DISPLAY
        self.contents_opacity = 255
      end
    end
  end
  
  def update
    self.visible = $game_system.hud_display
    return if !self.visible
    hide_status
    @m.each do |i|
      if @a_list[i.index][0] != i.name or
      @a_list[i.index][1] != i.hp or
      @a_list[i.index][2] != i.mp or
      @a_list[i.index][3] != i.level
        refresh
      end
    end
  end
end

#------------------------------------------------------------
# * Scene_Map: Attach HUD to map
#------------------------------------------------------------
class Scene_Map < Scene_Base
  alias start_hud start
  alias terminate_hud terminate
  alias update_hud update
  def start
    start_hud
    @all_name_hp_mp = All_Name_Hp_Mp.new
  end
  def terminate
    @all_name_hp_mp.dispose
    terminate_hud
  end
  def update
    update_hud
    @all_name_hp_mp.update
  end
end

#------------------------------------------------------------
# * Game_System: Check for display
#------------------------------------------------------------
class Game_System
  alias hud_initialize initialize
  attr_accessor :hud_display
  def initialize
    hud_initialize
    @hud_display = ALL_NAME_HP_MP::HUD_START_DISPLAY
  end
end






################################################################################
#                                                                              #
#                      ~~~~~ Copyright 2009 SojaBird ~~~~~                     #
#                                                                              #
################################################################################

class Hud_Tile_ID < Window_Base
  
  def initialize
    super(0, 416-(WLH+32), 544, WLH+32)
    self.visible = false
    refresh
  end
  
  def refresh
    contents.clear
    contents.draw_text(0, 0, self.width - 32, WLH, map_data, 1)
  end
  
  def map_data
    @x = $game_player.x
    @y = $game_player.y
    @map_id = $game_map.map_id
    @map = load_data(sprintf("Data/Map%03d.rvdata", @map_id))
    @tile_id = []
    for i in [2, 1, 0]
      tile_id = @map.data[@x, @y, i]
      @tile_id.push(tile_id)
    end
    return "#{@tile_id[2]} | #{@tile_id[1]} | #{@tile_id[0]}"
  end
  
  def update
    self.visible = Input.press?(Input::F5) if $TEST
    if @x != $game_player.x or @y != $game_player.y
      refresh
    end
  end
end

#------------------------------------------------------------
# * Scene_Map: Attach HUD to map
#------------------------------------------------------------
class Scene_Map < Scene_Base
  alias start_Hud_Tile_ID start
  alias terminate_Hud_Tile_ID terminate
  alias update_Hud_Tile_ID update
  def start
    start_Hud_Tile_ID
    @Hud_Tile_ID = Hud_Tile_ID.new
  end
  def terminate
    @Hud_Tile_ID.dispose
    terminate_Hud_Tile_ID
  end
  def update
    update_Hud_Tile_ID
    @Hud_Tile_ID.update
  end
end






################################################################################
#                                                                              #
#                      ~~~~~ Copyright 2009 SojaBird ~~~~~                     #
#                               HUD BluePrint v3.0                             #
#                                                                              #
################################################################################

# To toggle the hud's display, just do a callscript "hud"
# To set the hud's display, just do a callscript "hud(true)" or "hud(false)"

module Tile_ID_Shower; WLH = Window_Base::WLH
################################################################################
# User Customazation
  Start_Display = true #true/false
  Opacity = 100 #0-255
  BG_Display = false #true/false
  Hide = false #true/false
################################################################################
# Don't touch below (if ure're not a scripter)
################################################################################
=begin #########################################################################
Some standard value's you might want to use are allready pre-defiend so that you
don't have to write the whole function for your self anymore.
Here follows a list: (just copy+past and fill in the value's to let it work)
  * draw_actor_graphic(actor, x, y)
  * draw_actor_face(actor, x, y, size = 96)
  * draw_actor_name(actor, x, y)
  * draw_actor_class(actor, x, y)
  * draw_actor_level(actor, x, y)
  * draw_actor_state(actor, x, y, width = 96)
  * draw_actor_hp(actor, x, y, width = 120)
  * draw_actor_mp(actor, x, y, width = 120)
  * draw_actor_parameter(actor, x, y, type)
      FOR TYPE: 0=atk, 1=def, 2=spi, 3=agi
  * draw_item_name(item, x, y, enabled = true)
  * draw_currency_value(value, x, y, width)
=end ###########################################################################
################################################################################
  def xywh
    @x = -16 #Set the x-position
    @y = -16 #Set the y-position
    @w = 544+32 #Set the width
    @h = 416+32 #Set the height
    return[@x, @y, @w, @h]
  end; def hud_values #Set the value's that you're using (also used at refresh)
    @display_x = $game_map.display_x/256
    @display_y = $game_map.display_y/256
    @map_id = $game_map.map_id
    @map = load_data(sprintf("Data/Map%03d.rvdata",@map_id))
    #Example: @actor = $game_party.members[0]
  end; def hud_contents #Set the things you want to draw
    x = 0
    y = 0
    for i in @display_x..@display_x+17
      for j in @display_y..@display_y+14
        @tile_id = @map.data[i,j,1]
        @tile_id = @map.data[i,j,2] if @tile_id == 0
        self.contents.draw_text(x*32,y*32,32,32,@tile_id,1)
        y += 1
      end
      x += 1
      y = 0
    end
    #Example: draw_actor_hp(@actor, x, y)
  end; def hud_refresh?; if #Set wich value's make the HUD to refresh
    @display_x != $game_map.display_x/256 or
    @display_y != $game_map.display_y/256 or
    @map_id != $game_map.map_id
    #Example: if @actor != $game_party.members[0]
    return true; end
  end
end
################################################################################
# Don't touch below
################################################################################

################################################################################
# Call script function
################################################################################
def hud(arg = nil)
  $game_system.hud_display = !$game_system.hud_display if arg == nil
  $game_system.hud_display = arg if arg != nil
end
################################################################################
#------------------------------------------------------------
# * Hud_Name: Create Hud window
#------------------------------------------------------------
class Hud_Tile_ID_Shower < Window_Base
  include Tile_ID_Shower
  
  def initialize
    super(xywh[0],xywh[1],xywh[2],xywh[3])
    self.visible = $game_system.hud_display
    self.opacity = Opacity
    self.opacity = 0 if !BG_Display
    hide_status if Hide
    hud_values
    refresh
  end
  
  def refresh
    contents.clear
    hud_values
    hud_contents
  end
  
  def hide_status
    if Hide
      if $game_player.screen_x + 16 > self.x and
      $game_player.screen_y + 4 > self.y and
      $game_player.screen_x - 16 < self.x + self.width and
      $game_player.screen_y - 28 < self.y + self.height
        self.opacity = Opacity if BG_Display
        self.contents_opacity = Opacity
      else
        self.opacity = 255 if BG_Display
        self.contents_opacity = 255
      end
    end
  end
  
  def update
    self.visible = $game_system.hud_display
    return if !self.visible
    refresh if hud_refresh?
    hide_status if Hide
  end
end

#------------------------------------------------------------
# * Scene_Map: Attach HUD to map
#------------------------------------------------------------
class Scene_Map < Scene_Base
  alias start_hud_name start
  alias terminate_hud_name terminate
  alias update_hud_name update
  def start
    start_hud_name
    @hud_tile_id_shower = Hud_Tile_ID_Shower.new if $TEST
  end
  def terminate
    @hud_tile_id_shower.dispose if !@hud_tile_id_shower.nil?
    terminate_hud_name
  end
  def update
    update_hud_name
    @hud_tile_id_shower.update if !@hud_tile_id_shower.nil?
  end
end

#------------------------------------------------------------
# * Game_System: Check for display
#------------------------------------------------------------
class Game_System
  alias hud_initialize initialize
  attr_accessor :hud_display
  def initialize
    hud_initialize
    @hud_display = Tile_ID_Shower::Start_Display
  end
end





################################################################################
#                                                                              #
#                      ~~~~~ Copyright 2009 SojaBird ~~~~~                     #
#                               HUD BluePrint v3.1                             #
#                                                                              #
################################################################################

# To toggle the hud's display, just do a callscript "hud"
# To set the hud's display, just do a callscript "hud(true)" or "hud(false)"

module Hp_Mp_Exp_VarPic_Module; WLH = Window_Base::WLH
################################################################################
# User Customazation
  Start_Display = true #true/false
  Opacity = 100 #0-255
  BG_Display = true #true/false
  Hide = true #true/false
  
  Picture_Variable = 1 #Number of the variable to use for the picture
  Picture_Name = "" #Name of the picture, in front of the variable value
  #Example:
  # Picture_Name = "hud"
  # Picture_Variable it's value = 1
  # Picture that will be shown on the HUD = "hud1"
  
  Actor_ID = 0 #The ID of the actor of wich the value's are displayed
  
  Exp_Name = "E" #Name that will be displayed as Exp
################################################################################
# Don't touch below (if ure're not a scripter)
################################################################################
=begin #########################################################################
Some standard value's you might want to use are allready pre-defiend so that you
don't have to write the whole function for your self anymore.
Here follows a list: (just copy+past and fill in the value's to let it work)
  * draw_actor_graphic(actor, x, y)
  * draw_actor_face(actor, x, y, size = 96)
  * draw_actor_name(actor, x, y)
  * draw_actor_class(actor, x, y)
  * draw_actor_level(actor, x, y)
  * draw_actor_state(actor, x, y, width = 96)
  * draw_actor_hp(actor, x, y, width = 120)
  * draw_actor_mp(actor, x, y, width = 120)
  * draw_actor_parameter(actor, x, y, type)
      FOR TYPE: 0=atk, 1=def, 2=spi, 3=agi
  * draw_item_name(item, x, y, enabled = true)
  * draw_currency_value(value, x, y, width)
  
  Custom new standard functions:
  * draw_actor_exp(actor, x, y, width = 120)
=end ###########################################################################
################################################################################
  def xywh
    @x = 0 #Set the x-position
    @y = 0 #Set the y-position
    @w = 120+32 #Set the width
    @h = 3*WLH+32 #Set the height
    return[@x, @y, @w, @h]
  end; def hud_values #Set the value's that you're using (also used at refresh)
    @var = $game_variables[Picture_Variable]
    @actor = $game_party.members[Actor_ID]
    @hp = @actor.hp
    @mp = @actor.mp
    @exp = @actor.exp
    #Example: @actor = $game_party.members[0]
  end; def hud_contents #Set the things you want to draw
    draw_variable_picture(@var, 0, 0*WLH)
    draw_actor_hp(@actor, 0, 0*WLH)
    draw_actor_mp(@actor, 0, 1*WLH)
    draw_actor_exp(@actor, 0, 2*WLH)
    #Example: draw_actor_hp(@actor, x, y)
  end; def hud_refresh?; if #Set wich value's make the HUD to refresh
    @var != $game_variables[Picture_Variable] or
    @actor != $game_party.members[Actor_ID] or
    @hp != @actor.hp or
    @mp != @actor.mp or
    @exp != @actor.exp
    #Example: if @actor != $game_party.members[0]
    return true; end
  end
end
################################################################################
# Don't touch below
################################################################################

################################################################################
# Call script function
################################################################################
def hud(arg = nil)
  $game_system.hud_display = !$game_system.hud_display if arg == nil
  $game_system.hud_display = arg if arg != nil
end
################################################################################
#------------------------------------------------------------
# * Hp_Mp_Exp_VarPic: Create Hud window
#------------------------------------------------------------
class Hp_Mp_Exp_VarPic < Window_Base
  include Hp_Mp_Exp_VarPic_Module
  
  def initialize
    super(xywh[0],xywh[1],xywh[2],xywh[3])
    self.visible = $game_system.hud_display
    self.opacity = Opacity
    self.opacity = 0 if !BG_Display
    hide_status if Hide
    hud_values
    refresh
  end
  
  def refresh
    contents.clear
    hud_values
    hud_contents
  end
  
  def draw_variable_picture(var, x, y)
    @bm = Cache.picture(Picture_Name + var.to_s)
    @cw = self.contents.width
    @ch = self.contents.height
    @rect = Rect.new(@bm.width/2 - @cw/2, @bm.height/2 - @ch/2, @cw, @ch)
    self.contents.blt(x, y, @bm, @rect)
  end
  
  def hide_status
    if Hide
      if $game_player.screen_x + 16 > self.x and
      $game_player.screen_y + 4 > self.y and
      $game_player.screen_x - 16 < self.x + self.width and
      $game_player.screen_y - 28 < self.y + self.height
        self.opacity = Opacity if BG_Display
        self.contents_opacity = Opacity
      else
        self.opacity = 255 if BG_Display
        self.contents_opacity = 255
      end
    end
  end
  
  def update
    self.visible = $game_system.hud_display
    return if !self.visible
    refresh if hud_refresh?
    hide_status if Hide
  end
end

#------------------------------------------------------------
# * Scene_Map: Attach HUD to map
#------------------------------------------------------------
class Scene_Map < Scene_Base
  alias start_hp_mp_exp_varpic start
  alias terminate_hp_mp_exp_varpic terminate
  alias update_hp_mp_exp_varpic update
  def start
    start_hp_mp_exp_varpic
    @hp_mp_exp_varpic = Hp_Mp_Exp_VarPic.new
  end
  def terminate
    @hp_mp_exp_varpic.dispose
    terminate_hp_mp_exp_varpic
  end
  def update
    update_hp_mp_exp_varpic
    @hp_mp_exp_varpic.update
  end
end

#------------------------------------------------------------
# * Game_System: Check for display
#------------------------------------------------------------
class Game_System
  alias hud_initialize initialize
  attr_accessor :hud_display
  def initialize
    hud_initialize
    @hud_display = Hp_Mp_Exp_VarPic_Module::Start_Display
  end
end

#------------------------------------------------------------
# * Window_Base: Some new standard function
#------------------------------------------------------------
class Window_Base < Window
  
  def draw_actor_exp(actor, x, y, width = 120)
    s1 = actor.exp_s
    s2 = actor.next_rest_exp_s + s1
    if s1.is_a? String or s2.is_a? String
      s1 = actor.exp
      s2 = actor.exp
    end
    draw_actor_exp_gauge(actor, x, y, s1, s2, width)
    self.contents.font.color = system_color
    self.contents.draw_text(x, y, 30, WLH, Hp_Mp_Exp_VarPic_Module::Exp_Name)
    self.contents.font.color = normal_color
    last_font_size = self.contents.font.size
    xr = x + width
    if width < 120
      self.contents.draw_text(xr - 44, y, 44, WLH, s1, 2)
    else
      self.contents.draw_text(xr - 99, y, 44, WLH, s1, 2)
      self.contents.font.color = normal_color
      self.contents.draw_text(xr - 55, y, 11, WLH, "/", 2)
      self.contents.draw_text(xr - 44, y, 44, WLH, s2, 2)
    end
  end
  
  def draw_actor_exp_gauge(actor, x, y, s1, s2, width = 120)
    gw = width * s1 / s2
    gc1 = text_color(31)
    gc2 = text_color(27)
    self.contents.fill_rect(x, y + WLH - 8, width, 6, gauge_back_color)
    self.contents.gradient_fill_rect(x, y + WLH - 8, gw, 6, gc1, gc2)
  end
end






################################################################################
#                                                                              #
#                      ~~~~~ Copyright 2009 SojaBird ~~~~~                     #
#                               HUD BluePrint v3.2                             #
#                                                                              #
################################################################################

# To toggle the hud's display, just do a callscript "hud"
# To set the hud's display, just do a callscript "hud(true)" or "hud(false)"

module Actor_Selector_HUD_Module; WLH = Window_Base::WLH
################################################################################
# User Customazation
  Start_Display = true #true/false
  Opacity = 100 #0-255
  BG_Display = true #true/false
  Hide = true #true/false
  
  #Put nil if you don't want to use it
  Visible_Key = Input::F5 #Input::__
  
  EXP_NAME = "E"
################################################################################
# Don't touch below (if ure're not a scripter)
################################################################################
=begin #########################################################################
Some standard value's you might want to use are allready pre-defiend so that you
don't have to write the whole function for your self anymore.
Here follows a list: (just copy+past and fill in the value's to let it work)
  * draw_actor_graphic(actor, x, y)
  * draw_actor_face(actor, x, y, size = 96)
  * draw_actor_name(actor, x, y)
  * draw_actor_class(actor, x, y)
  * draw_actor_level(actor, x, y)
  * draw_actor_state(actor, x, y, width = 96)
  * draw_actor_hp(actor, x, y, width = 120)
  * draw_actor_mp(actor, x, y, width = 120)
  * draw_actor_parameter(actor, x, y, type)
      FOR TYPE: 0=atk, 1=def, 2=spi, 3=agi
  * draw_item_name(item, x, y, enabled = true)
  * draw_currency_value(value, x, y, width)
  
  Custom new standard functions:
  * draw_actor_exp(actor, x, y, width = 120)
=end ###########################################################################
################################################################################
  def xywh
    @x = 0 #Set the x-position
    @y = 0 #Set the y-position
    @w = 108+120+32 #Set the width
    @h = 7*WLH+32 #Set the height
    return[@x, @y, @w, @h]
  end; def hud_values #Set the value's that you're using (also used at refresh)
    @actor = $game_party.members[@index]
    @hp = @actor.hp
    @mp = @actor.mp
    @exp = @actor.exp
    @name = @actor.name
    @face = [@actor.face_name, @actor.face_index]
    @gold = $game_party.gold
    #Example: @actor = $game_party.members[0]
  end; def hud_contents #Set the things you want to draw
    draw_actor_face(@actor, 0, 0*WLH)
    draw_actor_hp(@actor, 108, 0*WLH)
    draw_actor_mp(@actor, 108, 1*WLH)
    draw_actor_exp(@actor, 108, 2*WLH)
    draw_actor_name(@actor, 0, 4*WLH)
    draw_actor_level(@actor, 108, 4*WLH)
    draw_index(@index, 108, 5*WLH)
    draw_actor_class(@actor, 0, 5*WLH)
    draw_currency_value(@gold, 0, 6*WLH, 108)
    #Example: draw_actor_hp(@actor, x, y)
  end; def hud_refresh?; if #Set wich value's make the HUD to refresh
    @hp != @actor.hp or
    @mp != @actor.mp or
    @exp != @actor.exp or
    @name != @actor.name or
    @face != [@actor.face_name, @actor.face_index] or
    @gold != $game_party.gold
    #Example: if @actor != $game_party.members[0]
    return true; end
  end
end
################################################################################
# Don't touch below
################################################################################

################################################################################
# Call script function
################################################################################
def hud(arg = nil)
  $game_system.hud_display = !$game_system.hud_display if arg == nil
  $game_system.hud_display = arg if arg != nil
end
################################################################################
#------------------------------------------------------------
# * Hud_Name: Create Hud window
#------------------------------------------------------------
class Actor_Selector_HUD < Window_Base
  include Actor_Selector_HUD_Module
  
  attr_reader :index
  
  def initialize(index)
    @index = index
    super(xywh[0],xywh[1],xywh[2],xywh[3])
    self.visible = $game_system.hud_display
    self.opacity = Opacity
    self.opacity = 0 if !BG_Display
    self.visible = Input.press?(Visible_Key) if !Visible_Key.nil?
    hide_status if Hide
    hud_values
    refresh
  end
  
  def refresh
    contents.clear
    hud_values
    hud_contents
  end
  
  def draw_index(index, x, y)
    count = 0
    for i in 0..$game_party.members.size - 1
      count = 0 if count == 5
      @x = x + count * 24 if (i/5).ceil
      @y = (i/5).floor * WLH + y
      self.contents.font.color = normal_color
      self.contents.font.color = text_color(14) if i == @index
      self.contents.draw_text(@x, @y, WLH, 24, i+1, 1)
      count += 1
    end
  end
  
  def hide_status
    if Hide
      if $game_player.screen_x + 16 > self.x and
      $game_player.screen_y + 4 > self.y and
      $game_player.screen_x - 16 < self.x + self.width and
      $game_player.screen_y - 28 < self.y + self.height
        self.opacity = Opacity if BG_Display
        self.contents_opacity = Opacity
      else
        self.opacity = 255 if BG_Display
        self.contents_opacity = 255
      end
    end
  end
  
  def update
    self.visible = Input.press?(Visible_Key) if !Visible_Key.nil?
    self.visible = $game_system.hud_display if Visible_Key.nil?
    return if !self.visible
    refresh if hud_refresh?
    hide_status if Hide
  end
end

#------------------------------------------------------------
# * Scene_Map: Attach HUD to map
#------------------------------------------------------------
class Scene_Map < Scene_Base
  alias start_actor_selector_hud start
  alias terminate_actor_selector_hud terminate
  alias update_actor_selector_hud update
  def start
    start_actor_selector_hud
    @index = 0
    new_hud
  end
  def terminate
    @actor_selector_hud.dispose
    terminate_actor_selector_hud
  end
  def update
    update_actor_selector_hud
    @actor_selector_hud.update
    return if !@actor_selector_hud.visible
    if Input.trigger?(Input::R)
      if @index == $game_party.members.size - 1
        @index = 0
      else
        @index += 1
      end
    elsif Input.trigger?(Input::L)
      if @index == 0
        @index = $game_party.members.size - 1
      else
        @index -= 1
      end
    end
    new_hud if @index != @actor_selector_hud.index
  end
  def new_hud
    @actor_selector_hud.dispose if !@actor_selector_hud.nil?
    @actor_selector_hud = Actor_Selector_HUD.new(@index)
  end
end

#------------------------------------------------------------
# * Game_System: Check for display
#------------------------------------------------------------
class Game_System
  alias hud_initialize initialize
  attr_accessor :hud_display
  def initialize
    hud_initialize
    @hud_display = Actor_Selector_HUD_Module::Start_Display
  end
end

#------------------------------------------------------------
# * Window_Base: Some new standard function
#------------------------------------------------------------
class Window_Base < Window
  
  def draw_actor_exp(actor, x, y, width = 120)
    s1 = actor.exp_s
    s2 = actor.next_rest_exp_s + s1
    if s1.is_a? String or s2.is_a? String
      s1 = actor.exp
      s2 = actor.exp
    end
    draw_actor_exp_gauge(actor, x, y, s1, s2, width)
    self.contents.font.color = system_color
    self.contents.draw_text(x, y, 30, WLH, Actor_Selector_HUD_Module::EXP_NAME)
    self.contents.font.color = normal_color
    last_font_size = self.contents.font.size
    xr = x + width
    if width < 120
      self.contents.draw_text(xr - 44, y, 44, WLH, s1, 2)
    else
      self.contents.draw_text(xr - 99, y, 44, WLH, s1, 2)
      self.contents.font.color = normal_color
      self.contents.draw_text(xr - 55, y, 11, WLH, "/", 2)
      self.contents.draw_text(xr - 44, y, 44, WLH, s2, 2)
    end
  end
  
  def draw_actor_exp_gauge(actor, x, y, s1, s2, width = 120)
    gw = width * s1 / s2
    gc1 = text_color(31)
    gc2 = text_color(27)
    self.contents.fill_rect(x, y + WLH - 8, width, 6, gauge_back_color)
    self.contents.gradient_fill_rect(x, y + WLH - 8, gw, 6, gc1, gc2)
  end
end






################################################################################
#                                                                              #
#                      ~~~~~ Copyright 2009 SojaBird ~~~~~                     #
#                               HUD BluePrint v3.2                             #
#                                                                              #
################################################################################

# To toggle the hud's display, just do a callscript "hud"
# To set the hud's display, just do a callscript "hud(true)" or "hud(false)"

module Module_Name; WLH = Window_Base::WLH
################################################################################
# User Customazation
  Start_Display = true #true/false
  Opacity = 100 #0-255
  BG_Display = true #true/false
  Hide = true #true/false
  EXP_NAME = "E"
################################################################################
# Don't touch below (if ure're not a scripter)
################################################################################
=begin #########################################################################
Some standard value's you might want to use are allready pre-defiend so that you
don't have to write the whole function for your self anymore.
Here follows a list: (just copy+past and fill in the value's to let it work)
  * draw_actor_graphic(actor, x, y)
  * draw_actor_face(actor, x, y, size = 96)
  * draw_actor_name(actor, x, y)
  * draw_actor_class(actor, x, y)
  * draw_actor_level(actor, x, y)
  * draw_actor_state(actor, x, y, width = 96)
  * draw_actor_hp(actor, x, y, width = 120)
  * draw_actor_mp(actor, x, y, width = 120)
  * draw_actor_parameter(actor, x, y, type)
      FOR TYPE: 0=atk, 1=def, 2=spi, 3=agi
  * draw_item_name(item, x, y, enabled = true)
  * draw_currency_value(value, x, y, width)
  
  Custom new standard functions:
  * draw_actor_exp(actor, x, y, width = 120)
=end ###########################################################################
################################################################################
  def xywh
    @x = 0 #Set the x-position
    @y = 0 #Set the y-position
    @w = 96+32 #Set the width
    @h = 72+24+32 #Set the height
    return[@x, @y, @w, @h]
  end; def hud_values #Set the value's that you're using (also used at refresh)
    @actor = $game_party.members[@index]
    @temp_states = @actor.states
    #Example: @actor = $game_party.members[0]
  end; def hud_contents #Set the things you want to draw
    draw_actor_graphic(@actor, 14, 42)
    draw_actor_hp(@actor, 32, 0, 93-32)
    draw_actor_mp(@actor, 32, 24, 96-32)
    draw_actor_exp(@actor, 0, 48, 96)
    draw_actor_state(@actor, 0, 72, 96)
    #Example: draw_actor_hp(@actor, x, y)
  end; def hud_refresh?
    if @temp_actor != @actor or
    @temp_actor.character_name != @actor.character_name or
    @temp_actor.character_index != @actor.character_index or
    @temp_actor.hp != @actor.hp or
    @temp_actor.mp != @actor.mp or
    @temp_actor.exp != @actor.exp or
    @temp_states != @actor.states
    @temp_states = @actor.states
    #Example: if @actor != $game_party.members[0]
    return true; end
  end
end
################################################################################
# Don't touch below
################################################################################

################################################################################
# Call script function
################################################################################
def hud(arg = nil)
  $game_system.hud_display = !$game_system.hud_display if arg == nil
  $game_system.hud_display = arg if arg != nil
end
################################################################################
#------------------------------------------------------------
# * Hud_Name: Create Hud window
#------------------------------------------------------------
class Hud_Name < Window_Base
  include Module_Name
  
  attr_reader :index
  
  def initialize(index)
    @index = index
    super(xywh[0],xywh[1],xywh[2],xywh[3])
    self.visible = $game_system.hud_display
    self.opacity = Opacity
    self.opacity = 0 if !BG_Display
    hide_status if Hide
    hud_values
    refresh
  end
  
  def refresh
    contents.clear
    hud_values
    hud_contents
  end
  
  def hide_status
    if Hide
      if $game_player.screen_x + 16 > self.x and
      $game_player.screen_y + 4 > self.y and
      $game_player.screen_x - 16 < self.x + self.width and
      $game_player.screen_y - 28 < self.y + self.height
        self.opacity = Opacity if BG_Display
        self.contents_opacity = Opacity
      else
        self.opacity = 255 if BG_Display
        self.contents_opacity = 255
      end
    end
  end
  
  def update
    self.visible = $game_system.hud_display
    return if !self.visible
    refresh if hud_refresh?
    hide_status if Hide
  end
end

#------------------------------------------------------------
# * Scene_Map: Attach HUD to map
#------------------------------------------------------------
class Scene_Map < Scene_Base
  alias start_hud_name start
  alias terminate_hud_name terminate
  alias update_hud_name update
  def start
    start_hud_name
    @index = 0
    new_hud
  end
  def terminate
    @hud_name.dispose
    terminate_hud_name
  end
  def update
    update_hud_name
    @hud_name.update
    return if !@hud_name.visible
    if Input.trigger?(Input::R)
      if @index == $game_party.members.size - 1
        @index = 0
      else
        @index += 1
      end
    elsif Input.trigger?(Input::L)
      if @index == 0
        @index = $game_party.members.size - 1
      else
        @index -= 1
      end
    end
    new_hud if @index != @hud_name.index
  end
  def new_hud
    @hud_name.dispose if !@hud_name.nil?
    @hud_name = Hud_Name.new(@index)
  end
end

#------------------------------------------------------------
# * Game_System: Check for display
#------------------------------------------------------------
class Game_System
  alias hud_initialize initialize
  attr_accessor :hud_display
  def initialize
    hud_initialize
    @hud_display = Module_Name::Start_Display
  end
end

#------------------------------------------------------------
# * Window_Base: Some new standard function
#------------------------------------------------------------
class Window_Base < Window
  include Module_Name
  
  def draw_actor_exp(actor, x, y, width = 120)
    s1 = actor.exp_s
    s2 = actor.next_rest_exp_s + s1
    if s1.is_a? String or s2.is_a? String
      s1 = actor.exp
      s2 = actor.exp
    end
    draw_actor_exp_gauge(actor, x, y, s1, s2, width)
    self.contents.font.color = system_color
    self.contents.draw_text(x, y, 30, WLH, EXP_NAME)
    self.contents.font.color = normal_color
    last_font_size = self.contents.font.size
    xr = x + width
    if width < 120
      self.contents.draw_text(xr - 44, y, 44, WLH, s1, 2)
    else
      self.contents.draw_text(xr - 99, y, 44, WLH, s1, 2)
      self.contents.font.color = normal_color
      self.contents.draw_text(xr - 55, y, 11, WLH, "/", 2)
      self.contents.draw_text(xr - 44, y, 44, WLH, s2, 2)
    end
  end
  
  def draw_actor_exp_gauge(actor, x, y, s1, s2, width = 120)
    gw = width * s1 / s2
    gc1 = text_color(31)
    gc2 = text_color(27)
    self.contents.fill_rect(x, y + WLH - 8, width, 6, gauge_back_color)
    self.contents.gradient_fill_rect(x, y + WLH - 8, gw, 6, gc1, gc2)
  end
end






################################################################################
#                                                                              #
#                      ~~~~~ Copyright 2009 SojaBird ~~~~~                     #
#                               HUD BluePrint v3.2                             #
#                                                                              #
################################################################################

# To toggle the hud's display, just do a callscript "hud"
# To set the hud's display, just do a callscript "hud(true)" or "hud(false)"

module Map_Name; WLH = Window_Base::WLH
################################################################################
# User Customazation
  Start_Display = true #true/false
  Opacity = 100 #0-255
  BG_Display = true #true/false
  Hide = true #true/false
  
  #Choose:
  #         TopLeft
  #         TopCenter
  #         TopRight
  #         BottomLeft
  #         BottomCenter
  #         BottomRight
  Location = "TopRight"
  
  Exclude_Map_IDs = []
  Exclude_Display = "???" #Put "" to hide the window
################################################################################
# Don't touch below (if ure're not a scripter)
################################################################################
=begin #########################################################################
Some standard value's you might want to use are allready pre-defiend so that you
don't have to write the whole function for your self anymore.
Here follows a list: (just copy+past and fill in the value's to let it work)
  * draw_actor_graphic(actor, x, y)
  * draw_actor_face(actor, x, y, size = 96)
  * draw_actor_name(actor, x, y)
  * draw_actor_class(actor, x, y)
  * draw_actor_level(actor, x, y)
  * draw_actor_state(actor, x, y, width = 96)
  * draw_actor_hp(actor, x, y, width = 120)
  * draw_actor_mp(actor, x, y, width = 120)
  * draw_actor_parameter(actor, x, y, type)
      FOR TYPE: 0=atk, 1=def, 2=spi, 3=agi
  * draw_item_name(item, x, y, enabled = true)
  * draw_currency_value(value, x, y, width)
  
  Custom new standard functions:
  * draw_actor_exp(actor, x, y, width = 120)
=end ###########################################################################
################################################################################
  def xywh
    @w = 200 #Set the width
    @h = 24+32 #Set the height
    case Map_Name::Location
    when "TopLeft"
      @x = 0 #Set the x-position
      @y = 0 #Set the y-position
    when "TopCenter"
      @x = 544/2-@w/2 #Set the x-position
      @y = 0 #Set the y-position
    when "TopRight"
      @x = 544-@w #Set the x-position
      @y = 0 #Set the y-position
    when "BottomLeft"
      @x = 0 #Set the x-position
      @y = 416-32-24 #Set the y-position
    when "BottomCenter"
      @x = 544/2-@w/2 #Set the x-position
      @y = 416-32-24 #Set the y-position
    when "BottomRight"
      @x = 544-@w #Set the x-position
      @y = 416-32-24 #Set the y-position
    end
    return[@x, @y, @w, @h]
  end; def hud_values #Set the value's that you're using (also used at refresh)
    @map_info ||= load_data("Data/MapInfos.rvdata")
    @map_name = @map_info[$game_map.map_id].name
    @map_id = $game_map.map_id
    #Example: @actor = $game_party.members[0]
  end; def hud_contents #Set the things you want to draw
    draw_map_name(@map_name)
    #Example: draw_actor_hp(@actor, x, y)
  end; def hud_refresh?; if @map_id != @map_info[@map_id].name
    #Example: if @actor != $game_party.members[0]
    return true; end
  end
  
  def draw_map_name(map_name)
    text = map_name
    text = Exclude_Display if Exclude_Map_IDs.include?($game_map.map_id)
    self.contents.draw_text(0, 0, self.width - 32, WLH, text, 1)
    self.visible = !(Exclude_Map_IDs.include?($game_map.map_id) and text == "")
  end
end

################################################################################
# Don't touch below
################################################################################

################################################################################
# Call script function
################################################################################
def hud(arg = nil)
  $game_system.hud_display = !$game_system.hud_display if arg == nil
  $game_system.hud_display = arg if arg != nil
end
################################################################################
#------------------------------------------------------------
# * Hud_Name: Create Hud window
#------------------------------------------------------------
class Map_Name_Hud < Window_Base
  include Map_Name
  
  def initialize
    super(xywh[0],xywh[1],xywh[2],xywh[3])
    self.visible = $game_system.hud_display
    self.opacity = Opacity
    self.opacity = 0 if !BG_Display
    hide_status if Hide
    hud_values
    refresh
  end
  
  def refresh
    contents.clear
    hud_values
    hud_contents
  end
  
  def hide_status
    if Hide
      if $game_player.screen_x + 16 > self.x and
      $game_player.screen_y + 4 > self.y and
      $game_player.screen_x - 16 < self.x + self.width and
      $game_player.screen_y - 28 < self.y + self.height
        self.opacity = Opacity if BG_Display
        self.contents_opacity = Opacity
      else
        self.opacity = 255 if BG_Display
        self.contents_opacity = 255
      end
    end
  end
  
  def update
    self.visible = $game_system.hud_display
    return if !self.visible
    refresh if hud_refresh?
    hide_status if Hide
  end
end

#------------------------------------------------------------
# * Scene_Map: Attach HUD to map
#------------------------------------------------------------
class Scene_Map < Scene_Base
  alias start_map_name_hud start
  alias terminate_map_name_hud terminate
  alias update_map_name_hud update
  alias fadein_map_name_hud fadein
  def start
    start_map_name_hud
    @map_name_hud = Map_Name_Hud.new
  end
  def terminate
    @map_name_hud.dispose
    terminate_map_name_hud
  end
  def update
    update_map_name_hud
    @map_name_hud.update
  end
  def fadein(duration)
    @map_name_hud.refresh
    fadein_map_name_hud(duration)
  end
end

#------------------------------------------------------------
# * Game_System: Check for display
#------------------------------------------------------------
class Game_System
  alias hud_initialize initialize
  attr_accessor :hud_display
  def initialize
    hud_initialize
    @hud_display = Map_Name::Start_Display
  end
end

#------------------------------------------------------------
# * Window_Base: Some new standard function
#------------------------------------------------------------
class Window_Base < Window
  include Map_Name
  
  def draw_actor_exp(actor, x, y, width = 120)
    s1 = actor.exp_s
    s2 = actor.next_rest_exp_s + s1
    if s1.is_a? String or s2.is_a? String
      s1 = actor.exp
      s2 = actor.exp
    end
    draw_actor_exp_gauge(actor, x, y, s1, s2, width)
    self.contents.font.color = system_color
    self.contents.draw_text(x, y, 30, WLH, EXP_NAME)
    self.contents.font.color = normal_color
    last_font_size = self.contents.font.size
    xr = x + width
    if width < 120
      self.contents.draw_text(xr - 44, y, 44, WLH, s1, 2)
    else
      self.contents.draw_text(xr - 99, y, 44, WLH, s1, 2)
      self.contents.font.color = normal_color
      self.contents.draw_text(xr - 55, y, 11, WLH, "/", 2)
      self.contents.draw_text(xr - 44, y, 44, WLH, s2, 2)
    end
  end
  
  def draw_actor_exp_gauge(actor, x, y, s1, s2, width = 120)
    gw = width * s1 / s2
    gc1 = text_color(31)
    gc2 = text_color(27)
    self.contents.fill_rect(x, y + WLH - 8, width, 6, gauge_back_color)
    self.contents.gradient_fill_rect(x, y + WLH - 8, gw, 6, gc1, gc2)
  end
  
end





원본 게시물 주소 - http://www.rpgrevolution.com/forums/index.php?showtopic=26347