Chaos Project

RPG Maker => RPG Maker Scripts => RMXP Script Database => Topic started by: winkio on November 23, 2008, 02:38:38 pm

Title: [XP] Custom Blizz-ABS HUD
Post by: winkio on November 23, 2008, 02:38:38 pm
Winkio's Blizz-ABS Party HUD
Authors: winkio
Version: 1.25
Type: Custom HUD Add-on
Key Term: Blizz-ABS Plugin



Introduction

This script modifies the original Blizz-ABS HUD to give more information in a different layout.


Features




Screenshots

Spoiler: ShowHide

(http://winkio.atbhost.net/hud1.jpg)
(http://winkio.atbhost.net/hud2.jpg)
(http://i2.photobucket.com/albums/y18/TokyoAngel/example.jpg)
(http://i2.photobucket.com/albums/y18/TokyoAngel/example2.jpg)



Script

Goes below all parts of Blizz-ABS
Spoiler: ShowHide
#|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|
# Blizz-ABS Party HUD by Winkio
# Version: 1.25
#|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|
#
#
#|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|
# This script modifies the Blizz-ABS HUD to display the HP/SP of up to ,six
# party members at once.  It also moves the hud and skill bar to the bottom and
# scales down the minimap.
#
# If you find any bugs, please report them here:
# http://forum.chaos-project.com
#|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|

#==============================================================================
# PARHUD_CONFIG
#------------------------------------------------------------------------------
#  This module is the configuration section
#==============================================================================
module PARHUD_CONFIG
 
 # Keeps health bar same color no matter what hp
 COLOR_FIX = true
 # Centers the hud display
 CENTER_DISPLAY =  true
 # shows facesets.  If set to true, must have a max party size of 4 or less.
 # If set to false, must have a max party size of 6 or less.
 FACESETS = true
 # display map name in hud
 MAPNAME = true
 # background picture for top hud.  If you have one, put it in Pictures.
 # Set this variable to the file name, for example, "mybg.png"
 # It should be 640 pixels wide and 50+TOPSPACE pixels tall.
 BGTOP = ""
 # space between top of HUD and top of screen.  must be between 0 and 14
 TOPSPACE = 5
 # allow minimap to be fullscreen
 MINIMAP_FULLSCREEN = true
end

#==============================================================================
# Game_System
#------------------------------------------------------------------------------
#  This class was modified to support the party hud
#==============================================================================
class Game_System
 attr_accessor :parhud
 alias initialize_parhud_later initialize
 def initialize
   @parhud = true
   initialize_parhud_later
 end
end

#==============================================================================
# Scene_Title
#==============================================================================

class Scene_Title

 alias main_parhud_later main
 def main
   $map_infos = load_data('Data/MapInfos.rxdata')
   $map_infos.keys.each {|key| $map_infos[key] = $map_infos[key].name}
   main_parhud_later
 end
 
end

#==============================================================================
# Game_Map
#==============================================================================

class Game_Map
       
 def name
   return $map_infos[@map_id]
 end
 
end


#==============================================================================
# ParHud
#------------------------------------------------------------------------------
#  This class creates the top hud that shows the hp/sp of all party members and
#  their names.
#==============================================================================

class ParHud < Sprite
 
 #----------------------------------------------------------------------------
 # Initialization
 #  viewport - the viewport for the sprite
 #----------------------------------------------------------------------------
 def initialize(viewport = nil)
   # call superclass method
   super
   # create positions
   create_positions
   # create bitmap
   self.bitmap = Bitmap.new(640, 50+PARHUD_CONFIG::TOPSPACE)
   # set font
   self.bitmap.font.name = 'Arial'
   # set font size
   self.bitmap.font.size = 16
   # set font to bold
   self.bitmap.font.bold = true
   # set z coordinate
   self.z = 1000
   # set party size
   @psize = $game_party.actors.size
   @poffset = 0
   test_offset
   @hp, @maxhp = [0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0]
   @sp, @maxsp = [0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0]
   # draw basic HUD
   draw_basic
   # update
   update
 end
 #----------------------------------------------------------------------------
 # create_positions
 #  Sets drawing positions. This method can be aliased and the positions
 #  modified to create a different HUD.
 #----------------------------------------------------------------------------
 def create_positions
   @name_x, @name_y, @hp_x, @hp_y, @sp_x, @sp_y = [], [], [], [], [], []
   if PARHUD_CONFIG::FACESETS
     @face_x, @face_y = [], []
   end
   if !PARHUD_CONFIG::CENTER_DISPLAY
     @maxpsize = BlizzABS::Config::MAX_PARTY
     @name_x, @name_y, @hp_x, @hp_y, @sp_x, @sp_y = [], [], [], [], [], []
     @face_x, @face_y = [], []
     (0...@maxpsize).each {|i|
       if PARHUD_CONFIG::FACESETS
         xdat = i*640/@maxpsize + 320/@maxpsize-25
         @face_x.push(xdat-52)
         @face_y.push(PARHUD_CONFIG::TOPSPACE)
       else
         xdat = i*640/@maxpsize + 320/@maxpsize-50
       end
       @name_x.push(xdat)
       @name_y.push(PARHUD_CONFIG::TOPSPACE)
       @hp_x.push(xdat)
       @hp_y.push(16+PARHUD_CONFIG::TOPSPACE)
       @sp_x.push(xdat)
       @sp_y.push(33+PARHUD_CONFIG::TOPSPACE)}
   else
     if (@psize == nil)
       #@psize = 1
       @psize = $game_party.actors.size
     end
     (0...@psize).each {|i|
       if PARHUD_CONFIG::FACESETS
         xdat = i*640/@psize + 320/@psize-25
         @face_x.push(xdat-52)
         @face_y.push(PARHUD_CONFIG::TOPSPACE)
       else
         xdat = i*640/@psize + 320/@psize-50
       end
       @name_x.push(xdat)
       @name_y.push(PARHUD_CONFIG::TOPSPACE)
       @hp_x.push(xdat)
       @hp_y.push(16+PARHUD_CONFIG::TOPSPACE)
       @sp_x.push(xdat)
       @sp_y.push(33+PARHUD_CONFIG::TOPSPACE)}
   end
 end
 #----------------------------------------------------------------------------
 # draw_basic
 #  Draws the HUD template.
 #----------------------------------------------------------------------------
 def draw_basic
   self.bitmap.font.size = 16
   color = Color.new(255, 255, 255, 127)
   if PARHUD_CONFIG::BGTOP != ""
     # load bitmap
     bitmap = RPG::Cache.picture(PARHUD_CONFIG::BGTOP)
     # draw bitmap
     self.bitmap.blt(0, 0, bitmap, Rect.new(0, 0, 640, 50+PARHUD_CONFIG::TOPSPACE))
   end
   self.bitmap.font.color = Color.new(255, 255, 255)
   # if color exists
   if color.is_a?(Color)
     (0...@psize).each {|i|
       # draw outlines in color
       self.bitmap.fill_rect(@hp_x[i], @hp_y[i], 102, 14, color)
       self.bitmap.fill_rect(@sp_x[i], @sp_y[i], 102, 14, color)
       # draw actor's names and faces
       self.bitmap.draw_text_full(@name_x[i], @name_y[i], 104, 20, actor(i).name, 1)
       if PARHUD_CONFIG::FACESETS
         self.bitmap.fill_rect(@face_x[i], @face_y[i], 50, 50, color)
         # load bitmap
         bitmap = RPG::Cache.picture("actor"+actor(i).id.to_s+".png")
         # draw bitmap
         self.bitmap.blt(@face_x[i]+1, @face_y[i]+1, bitmap, Rect.new(0, 0, 48, 48))
       end
       }
   end
   self.bitmap.font.size = 14
 end
 #----------------------------------------------------------------------------
 # draw_empty
 #  Draws the HP and SP display when actor doesn't exist.
 #----------------------------------------------------------------------------
 def draw_empty
   # set font color
   self.bitmap.font.color = disabled_color
   (0...@psize).each {|i|
     # draw empty bars
     self.bitmap.gradient_bar_hud(@hp_x[i], @hp_y[i], 100, 0, 'hud_green_bar')
     self.bitmap.gradient_bar_hud(@sp_x[i], @sp_y[i], 100, 0, 'hud_blue_bar')
     # draw empty HP/SP
     self.bitmap.draw_text_full(@hp_x[i]+48, @hp_y[i]-3, 48, 20, '0', 2)
     self.bitmap.draw_text_full(@sp_x[i]+48, @sp_y[i]-3, 48, 20, '0', 2)
     }
   # reset all flag variables
   @hp = @sp = @maxhp = @maxsp = nil
 end
 #----------------------------------------------------------------------------
 # draw_hp
 #  Draws the HP display.
 #----------------------------------------------------------------------------
 def draw_hp
   @hp, @maxhp = [], []
   self.bitmap.font.color = normal_color
   (0...@psize).each {|i|
     # set current variables
     @hp.push(actor(i).hp)
     @maxhp.push(actor(i).maxhp)
     rate = (@maxhp[i] > 0 ? @hp[i].to_f / @maxhp[i] : 0)
     if PARHUD_CONFIG::COLOR_FIX
       # draw gradient bar
       self.bitmap.gradient_bar_hud(@hp_x[i], @hp_y[i], 100, rate, 'hud_green_bar', 0)
       # draw HP
       self.bitmap.draw_text_full(@hp_x[i]+1, @hp_y[i], 100, 11, @hp[i].to_s, 1)
     else
       # draw gradient bar
       self.bitmap.gradient_bar_hud(@hp_x[i], @hp_y[i], 100, rate, 'hud_green_bar', 1)
       # set font color depending on how many HP left
       self.bitmap.font.color = @hp[i] == 0 ? knockout_color :
           @hp[i] <= @maxhp[i] / 4 ? crisis_color : normal_color
       # draw HP
       self.bitmap.draw_text_full(@hp_x[i]+1, @hp_y[i], 100, 11, @hp[i].to_s, 1)
       self.bitmap.font.color = normal_color
     end
     }
 end
 #----------------------------------------------------------------------------
 # draw_sp
 #  Draws the SP display.
 #----------------------------------------------------------------------------
 def draw_sp
   @sp, @maxsp = [], []
   self.bitmap.font.color = normal_color
   (0...@psize).each {|i|
     # set current variables
     @sp.push(actor(i).sp)
     @maxsp.push(actor(i).maxsp)
     rate = (@maxsp[i] > 0 ? @sp[i].to_f / @maxsp[i] : 0)
     # draw gradient bar
     self.bitmap.gradient_bar_hud(@sp_x[i], @sp_y[i], 100, rate, 'hud_blue_bar', 0)
     # draw HP
     self.bitmap.draw_text_full(@sp_x[i]+1, @sp_y[i], 100, 11, @sp[i].to_s, 1)
     }
 end
 #----------------------------------------------------------------------------
 # update
 #  Checks if HUD needs refreshing.
 #----------------------------------------------------------------------------
 def update
   # if actor doesn't exist
   if actor == nil
     # unless already drawn empty HUD
     unless @empty_hud_drawn
       # draw HUD template
       draw_basic
       # draw empty HP, SP and EXP bars
       draw_empty
       # empty HUD was drawn
       @empty_hud_drawn = true
     end
   else
     if @psize != $game_party.actors.size
       @psize = $game_party.actors.size
       self.bitmap.clear
       create_positions
       test_offset
       draw_basic
     end
     # if HUD needs refresh
     if $game_temp.hud_refresh
       # draw all data about actors
       draw_hp
       draw_sp
       # remove flag
       $game_temp.hud_refresh = nil
     else
       # draw data that needs to be updated
       test_offset
       test_hp
       test_sp
     end
     # empty HUD wasn't drawn
     @empty_hud_drawn = false
   end
 end
 #----------------------------------------------------------------------------
 # test_hp
 #  Tests and draws the HP.
 #----------------------------------------------------------------------------
 def test_hp
   (0...@psize).each {|i|
     # draw new HP if HP or max HP have changed
     if actor(i).hp != @hp[i] || actor(i).maxhp != @maxhp[i]
       draw_hp
       return
     end}
 end
 #----------------------------------------------------------------------------
 # test_sp
 #  Tests and draws the SP.
 #----------------------------------------------------------------------------
 def test_sp
   (0...@psize).each {|i|
     # draw new HP if HP or max HP have changed
     if actor(i).sp != @sp[i] || actor(i).maxsp != @maxsp[i]
       draw_sp
       return
     end}
 end
 #----------------------------------------------------------------------------
 # test_offset
 #  Tests and draws the SP.
 #----------------------------------------------------------------------------
 def test_offset
   (0...@psize).each {|i|
   if actor(0).name != $game_actors[1].name
     @poffset = (@poffset + 1) % @psize
   else
     return
   end}
 end
 #----------------------------------------------------------------------------
 # actor
 #  Returns the party leader's battler for easier reference.
 #----------------------------------------------------------------------------
 def actor(id = 0)
   return $game_party.actors[(id + @poffset)%@psize]
 end  
 #----------------------------------------------------------------------------
 # dispose
 #  disposes of the sprite.
 #----------------------------------------------------------------------------
 def dispose
   super
 end  
 
end

#==============================================================================
# Hud
#------------------------------------------------------------------------------
#  This class was modified to support SR display and modify the number of
#  skills left to use.
#  Displays HUD window and exp/level bar
#==============================================================================

class Hud < Sprite
 
 #----------------------------------------------------------------------------
 # Initialization
 #  viewport - the viewport for the sprite
 #----------------------------------------------------------------------------
 def initialize(viewport = nil)
   # call superclass method
   super
   # create positions
   create_positions
   # create bitmap
   self.bitmap = Bitmap.new(120, 90)
   # set font
   self.bitmap.font.name = 'Arial'
   # set font size
   self.bitmap.font.size = 16
   # set font to bold
   self.bitmap.font.bold = true
   # set x and y coordinates
   self.x, self.y = @hud_x, @hud_y
   # set z coordinate
   self.z = 1000
   # draw basic HUD
   draw_basic
   # update
   update
 end
 #----------------------------------------------------------------------------
 # create_positions
 #  Sets drawing positions. This method can be aliased and the positions
 #  modified to create a different HUD.
 #----------------------------------------------------------------------------
 def create_positions
   @hud_height, @hud_width, @hud_x, @hud_y = 90, 120, 0, 390
   @level_x, @level_y = 0, 0
   @gold_x, @gold_y, @loc_x, @loc_y = 10, 20, 10, 40
   @sbar_x, @sbar_y = 65, 60
   if !BlizzABS::Config::DIRECT_HOTKEYS
     @hot_x, @hot_y, @left_x, @left_y = 4, 60, 4, 74
   end
 end
 #----------------------------------------------------------------------------
 # draw_basic
 #  Draws the HUD template.
 #----------------------------------------------------------------------------
 def draw_basic
   # fill with grey rectangle
   self.bitmap.fill_rect(0, 0, @hud_width, @hud_height,
       Color.new(0, 0, 0, 127))
   color = Color.new(255, 255, 255, 127)
   # if color exists
   if color.is_a?(Color)
     # draw outlines in color
     self.bitmap.fill_rect(@level_x, @level_y, 120, 14, color)
   end
   if !BlizzABS::Config::DIRECT_HOTKEYS
     # draw "Skill:"
     self.bitmap.draw_text_full(@hot_x, @hot_y, 48, 20, 'S')
     # draw "Item:"
     self.bitmap.draw_text_full(@hot_x+60, @hot_y, 48, 20, 'I')
   end
   # set font color
   self.bitmap.font.color = system_color
   # draw "ER"
   self.bitmap.draw_text_full(@gold_x + 80, @gold_y, 20, 20, 'G')
 end
 #----------------------------------------------------------------------------
 # draw_empty
 #  Draws the HP and SP display when actor doesn't exist.
 #----------------------------------------------------------------------------
 def draw_empty
   self.bitmap.gradient_bar_hud(@level_x+1, @level_y+1, 118, 'hud_white_bar', 1)
   # set font color
   self.bitmap.font.color = disabled_color
   # draw empty HP
   self.bitmap.draw_text_full(@level_x, @level_y, 118, 11, '0', 1)
   # reset all flag variables
   @name = @level = @hp = @sp = @maxhp = @maxsp = @exp = @states = @skill =
       @skills_left = @item = @items_left = @gold = nil
 end
 #----------------------------------------------------------------------------
 # draw_exp
 #  Draws the EXP display.
 #----------------------------------------------------------------------------
 def draw_exp
   # set current variables
   @exp, @level = actor.exp, actor.level
   # set fill rate
   rate = (actor.next_exp != 0 ? actor.now_exp.to_f / actor.next_exp  : 1)
   # draw gradient bar
   self.bitmap.gradient_bar_hud(@level_x, @level_y, 118, rate, 'hud_white_bar', 2)
   # set font color depending on how many HP left
   self.bitmap.font.color = normal_color
   self.bitmap.font.size = 14
   # draw EXP
   self.bitmap.draw_text_full(@level_x, @level_y-3, 118, 20, 'Level ' + @level.to_s, 1)
   self.bitmap.font.size = 16
 end
 #----------------------------------------------------------------------------
 # draw_gold
 #  Draws the gold display.
 #----------------------------------------------------------------------------
 def draw_gold
   # set current variable
   @gold = $game_party.gold
   # remove old display
   self.bitmap.fill_rect(@gold_x, @gold_y, 80, 20, Color.new(0, 0, 0, 127))
   # set font color
   self.bitmap.font.color = normal_color
   # draw party's gold  
   self.bitmap.draw_text_full(@gold_x, @gold_y, 80, 20, $game_party.gold.to_s, 2)
 end
 #----------------------------------------------------------------------------
 # draw_loc
 #  Draws the map location display.
 #----------------------------------------------------------------------------
 def draw_loc
   # set current variable
   @loc = $game_map.name
   # remove old display
   self.bitmap.fill_rect(@loc_x, @loc_y, 100, 20, Color.new(0, 0, 0, 127))
   # set font color
   self.bitmap.font.color = normal_color
   # draw party's gold  
   self.bitmap.draw_text_full(@loc_x, @loc_y, 100, 20, $game_map.name, 1)
 end
 #----------------------------------------------------------------------------
 # draw_hskill
 #  Draws the hot skill display.
 #----------------------------------------------------------------------------
 def draw_hskill
   # set current variable
   @skill = actor.skill
   # remove old display
   self.bitmap.fill_rect(@hot_x+28, @hot_y+4, 24, 24, Color.new(0, 0, 0, 128))
   # if skill hot skill exists
   if @skill != 0
     # load bitmap
     bitmap = RPG::Cache.icon($data_skills[@skill].icon_name)
     # draw bitmap
     self.bitmap.blt(@hot_x+28, @hot_y+4, bitmap, Rect.new(0, 0, 24, 24))
   end
   # removes skills left to use display
   draw_lskill
 end
 #----------------------------------------------------------------------------
 # draw_lskill
 #  Draws the skills left to use display.
 #----------------------------------------------------------------------------
 def draw_lskill
   # remove old display
   self.bitmap.fill_rect(@left_x, @left_y+4, 24, 16, Color.new(0, 0, 0, 128))
   # get the number of skills left
   @skills_left = get_skills_left
   # if hot skill exists
   if @skill != nil && @skill > 0
     # if normal SP cost
     if @skills_left >= 0
       # if not enough sp to use
       if @skills_left == 0
         # set font color
         self.bitmap.font.color = Color.new(255, 0, 0)
       # if enough SP for 5 or less skill uses
       elsif @skills_left <= 5
         # set font color
         self.bitmap.font.color = Color.new(255, 255, 0)
       else
         # set font color
         self.bitmap.font.color = normal_color
       end
       # decrease font color
       self.bitmap.font.size -= 2
       # draw number how many skills left to use
       self.bitmap.draw_text_full(@left_x, @left_y, 24, 20, @skills_left.to_s, 1)
       # increase font size
       self.bitmap.font.size += 2
     # if infinite skills left
     elsif @skills_left == -1
       # set font color
       self.bitmap.font.color = Color.new(0, 255, 0)
       # increase font size
       self.bitmap.font.size += 4
       # draw "∞" skill uses left
       self.bitmap.draw_text_full(@left_x, @left_y, 24, 20, '∞', 1)
       # decrease font size
       self.bitmap.font.size -= 4
     end
   end
 end
 #----------------------------------------------------------------------------
 # get_skills_left
 #  Gets the number of skill usages left.
 #----------------------------------------------------------------------------
 def get_skills_left
   # if skill hot skill exists
   if @skill != nil && @skill > 0
     # if SP cost is zero
     if $data_skills[@skill].sp_cost > 0
       # get basic SP cost
       sp_cost = $data_skills[@skill].sp_cost
       # if using SP Cost Mod Status
       if $tons_version != nil && $tons_version >= 6.54 &&
           $game_system.SP_COST_MOD
         # get modified cost
         sp_cost = BlizzCFG.get_cost_mod(actor.states, sp_cost)
       end
       # infinite
       return -1 if sp_cost == 0
       # calculate skills left to use
       return actor.sp / sp_cost
     end
     # set flag
     return -1
   end
   # set flag
   return -2
 end
 #----------------------------------------------------------------------------
 # draw_hitem
 #  Draws the hot item display.
 #----------------------------------------------------------------------------
 def draw_hitem
   # set current variable
   @item = actor.item
   # remove old display
   self.bitmap.fill_rect(@hot_x+88, @hot_y+4, 24, 24, Color.new(0, 0, 0, 128))
   # if hot item exists
   if @item != 0
     # load bitmap
     bitmap = RPG::Cache.icon($data_items[@item].icon_name)
     # draw bitmap
     self.bitmap.blt(@hot_x+88, @hot_y+4, bitmap, Rect.new(0, 0, 24, 24))
   end
   # removes items left to use display
   draw_litem
 end
 #----------------------------------------------------------------------------
 # draw_litem
 #  Draws the items left to use display.
 #----------------------------------------------------------------------------
 def draw_litem
   # set current variable
   @items_left = $game_party.item_number(@item)
   # remove old display
   self.bitmap.fill_rect(@left_x+60, @left_y+4, 24, 16, Color.new(0, 0, 0, 128))
   # if hot item exists
   if @item != nil && @item > 0
     # if item exists and cannot be consumed
     if $data_items[@item] != nil && !$data_items[@item].consumable
       # set font color
       self.bitmap.font.color = Color.new(0, 255, 0)
       # increase font size
       self.bitmap.font.size += 4
       # draw "∞" items left
       self.bitmap.draw_text_full(@left_x+60, @left_y, 24, 20, '∞', 1)
       # decrease font size
       self.bitmap.font.size -= 4
     else
       # if no items left
       if @items_left == 0
         # set font color
         self.bitmap.font.color = Color.new(255, 0, 0)
       # if equal or less items left
       elsif @items_left <= 10
         # set font color
         self.bitmap.font.color = Color.new(255, 255, 0)
       else
         # set font color
         self.bitmap.font.color = normal_color
       end
       # decrease font color
       self.bitmap.font.size -= 2
       # draw number how many items left to use
       self.bitmap.draw_text_full(@left_x+60, @left_y, 24, 20, @items_left.to_s, 1)
       # increase font size
       self.bitmap.font.size += 2
     end
   end
 end
 #----------------------------------------------------------------------------
 # update
 #  Checks if HUD needs refreshing.
 #----------------------------------------------------------------------------
 def update
   # if actor doesn't exist
   if actor == nil
     # unless already drawn empty HUD
     unless @empty_hud_drawn
       # draw HUD template
       draw_basic
       # draw empty HP, SP and EXP bars
       draw_empty
       # empty HUD was drawn
       @empty_hud_drawn = true
     end
   else
     # if HUD needs refresh
     if $game_temp.hud_refresh
       # draw all data about actors
       draw_exp
       draw_gold
       if PARHUD_CONFIG::MAPNAME
         draw_loc
       end
       unless BlizzABS::Config::DIRECT_HOTKEYS
         draw_hskill
         draw_lskill
         draw_hitem
         draw_litem
       end
       # remove flag
       $game_temp.hud_refresh = nil
     else
       # draw data that needs to be updated
       test_exp
       test_gold
       if PARHUD_CONFIG::MAPNAME
         test_loc
       end
       unless BlizzABS::Config::DIRECT_HOTKEYS
         test_hskill
         test_lskill
         test_hitem
         test_litem
       end
     end
     # empty HUD wasn't drawn
     @empty_hud_drawn = false
   end
 end
 #----------------------------------------------------------------------------
 # test_exp
 #  Tests and draws the EXP.
 #----------------------------------------------------------------------------
 def test_exp
   # draw new HP if HP or max HP have changed
   draw_exp if actor.exp != @exp
 end
 #----------------------------------------------------------------------------
 # test_gold
 #  Tests and draws the gold.
 #----------------------------------------------------------------------------
 def test_gold
   # draw new er if er has changed
   draw_gold if $game_party.gold != @gold
 end
 #----------------------------------------------------------------------------
 # test_loc
 #  Tests and draws the loc.
 #----------------------------------------------------------------------------
 def test_loc
   # draw new er if er has changed
   draw_loc if $game_map.name != @loc
 end
 
 #----------------------------------------------------------------------------
 # actor
 #  Returns the party leader's battler for easier reference.
 #----------------------------------------------------------------------------
 def actor
   return $game_player.battler
 end
 #----------------------------------------------------------------------------
 # dispose
 #  Removes PARHUD from screen and memory.
 #----------------------------------------------------------------------------
 def dispose
   @parhud = nil
   super
 end
 
end

#==============================================================================
# Hotkey_Assignment
#------------------------------------------------------------------------------
#  This class creates and display currently assigned hotkeys and is more
#  effiecient than the Window class.
#  Changed to display at bottom of screen with new graphics.
#==============================================================================

class Hotkey_Assignment < Sprite
 
 #----------------------------------------------------------------------------
 # Initialization
 #  viewport - the viewport for the sprite
 #----------------------------------------------------------------------------
 def initialize(viewport = nil)
   # call superclass
   super
   # create bitmap
   self.bitmap = Bitmap.new(320, 32)
   # set font to bold
   self.bitmap.font.bold = true
   # decrease font size
   self.bitmap.font.size -= 8
   # set font color
   self.bitmap.font.color = system_color
   # set x and y position
   self.x, self.y, self.z = 160, 448, 1100
   @page = 1
   # skill IDs on hotkeys
   @skills = BlizzABS::Cache::EmptyKeys
   # item IDs on hotkeys
   @items = BlizzABS::Cache::EmptyKeys
   # update display
   update
 end
 #----------------------------------------------------------------------------
 # draw
 #  Draws the hotkey display.
 #----------------------------------------------------------------------------
 def draw(index = nil)
   # iterate through all hotkeys
   (index == nil ? BlizzABS::Cache::HotkeyRange : [index]).each {|i|
       # if hotkey is skill hotkey
       if $game_player.skill_hotkeys[i%10] != 0
         # temporary object
         object = $data_skills[$game_player.skill_hotkeys[i%10]]
       # if hotkey is item hotkey
       elsif $game_player.item_hotkeys[i%10] != 0
         # temporary object
         object = $data_items[$game_player.item_hotkeys[i%10]]
       end
       # if any change applied (10 is used for 0)
       if @items[i%10] != $game_player.item_hotkeys[i%10] ||
           @skills[i%10] != $game_player.skill_hotkeys[i%10]
         # remove this icon
         self.bitmap.fill_rect(32*(i-1), 0, 32, 32, Color.new(0, 0, 0, 0))
         # fill icon bachground
         self.bitmap.fill_rect(32*(i-1)+4, 4, 24, 24, Color.new(0, 0, 0, 128))
         # if object exists
         if object != nil
           # load bitmap
           bitmap = RPG::Cache.icon(object.icon_name)
           # draw bitmap
           self.bitmap.blt(32*(i-1)+4, 4, bitmap, Rect.new(0, 0, 24, 24))
         end
         # draw hotkey number
         self.bitmap.draw_text_full(32*(i-1), 10, 30, 32, (i%10).to_s, 2)
       end}
   # set new items
   @items = $game_player.item_hotkeys.clone
   # set new skills
   @skills = $game_player.skill_hotkeys.clone
 end
end

#==============================================================================
# Minimap
#------------------------------------------------------------------------------
#  This class creates and handels the minimap/fullscreen map display and is
#  more efficient than the Window class.
#  Changed to 6x6 tiles with rounded edges
#==============================================================================

class Minimap < Sprite
 
 # setting all accessible variables
 attr_reader :map_id
 #----------------------------------------------------------------------------
 # Initialization
 #----------------------------------------------------------------------------
 def initialize
   # call superclass method
   super(Viewport.new(520, 390, 120, 90))
   # get autotile image from Blizz-ABS Cache
   @autotile = minimap_autotile
   # creates the passable floor map
   create_passable_floor
   # set x and y position
   self.x, self.y = 0, 0
   # set z position
   viewport.z = 5000
   # store events
   @events, @names = check_events
   # create sprites for events
   create_sevents
   # set all sprites visible
   self.visible = true
 end
 #--------------------------------------------------------------------------
   # minimap_autotile
   #  Creates the minimap autotile for passability.
   #--------------------------------------------------------------------------
   def minimap_autotile
     b = Bitmap.new(18, 24)
     c1 = Color.new(191, 191, 191)
     c2 = Color.new(255, 255, 255)
     b.fill_rect(0, 0, 6, 6, c1)
     b.fill_rect(12, 0, 6, 6, c1)
     #bottom 3x3 square
     b.fill_rect(2, 8, 14, 14, c1)
     b.fill_rect(1, 10, 1, 10, c1)
     b.fill_rect(4, 7, 10, 1, c1)
     b.fill_rect(16, 10, 1, 10, c1)
     b.fill_rect(4, 22, 10, 1, c1)
     #highlight pixels
     b.fill_rect(4, 6, 10, 1, c2)
     b.fill_rect(14, 7, 2, 1, c2)
     b.fill_rect(16, 8, 1, 2, c2)
     b.fill_rect(17, 10, 1, 10, c2)
     b.fill_rect(16, 20, 1, 2, c2)
     b.fill_rect(14, 22, 2, 1, c2)
     b.fill_rect(4, 23, 10, 1, c2)
     b.fill_rect(2, 22, 2, 1, c2)
     b.fill_rect(1, 20, 1, 2, c2)
     b.fill_rect(0, 10, 1, 10, c2)
     b.fill_rect(1, 8, 1, 2, c2)
     b.fill_rect(2, 7, 2, 1, c2)
     return b
   end
 #----------------------------------------------------------------------------
 # create_passable_floor
 #  Creates the passable floor map on the bitmap.
 #----------------------------------------------------------------------------
 def create_passable_floor
   # delete bitmap if bitmap exists
   self.bitmap.dispose if self.bitmap != nil
   # store new map ID
   @map_id = $game_map.map_id
   # temporary width and height
   w, h = $game_map.width, $game_map.height
   # create bitmap
   self.bitmap = Bitmap.new(6*w, 6*h)
   # fill rectangle
   self.bitmap.fill_rect(0, 0, 6*w, 6*h, Color.new(0, 0, 0, 128))
   # get passability data
   v_map = $game_map.virtual_passability
   # iterate through all tiles
   (0...v_map.xsize).each {|x| (0...v_map.ysize).each {|y|
       # depending on passable direction, draw the path using the autotile
       case v_map[x, y]
       when 0x01 #    D
         self.bitmap.blt(x*6, y*6+3, @autotile, Rect.new(0, 0, 6, 3), 128)
       when 0x02 #   L
         self.bitmap.blt(x*6, y*6, @autotile, Rect.new(3, 0, 3, 6), 128)
       when 0x03 #   LD
         self.bitmap.blt(x*6, y*6, @autotile, Rect.new(12, 6, 6, 6), 128)
       when 0x04 #  R
         self.bitmap.blt(x*6+3, y*6, @autotile, Rect.new(0, 0, 3, 6), 128)
       when 0x05 #  R D
         self.bitmap.blt(x*6, y*6, @autotile, Rect.new(0, 6, 6, 6), 128)
       when 0x06 #  RL
         self.bitmap.blt(x*6, y*6, @autotile, Rect.new(6, 6, 6, 3), 128)
         self.bitmap.blt(x*6, y*6+3, @autotile, Rect.new(6, 21, 6, 3), 128)
       when 0x07 #  RLD
         self.bitmap.blt(x*6, y*6, @autotile, Rect.new(6, 6, 6, 6), 128)
       when 0x08 # U
         self.bitmap.blt(x*6, y*6, @autotile, Rect.new(0, 3, 6, 3), 128)
       when 0x09 # U  D
         self.bitmap.blt(x*6, y*6, @autotile, Rect.new(0, 12, 3, 6), 128)
         self.bitmap.blt(x*6+3, y*6, @autotile, Rect.new(15, 12, 3, 6), 128)
       when 0x0A # U L
         self.bitmap.blt(x*6, y*6, @autotile, Rect.new(12, 18, 6, 6), 128)
       when 0x0B # U LD
         self.bitmap.blt(x*6, y*6, @autotile, Rect.new(12, 12, 6, 6), 128)
       when 0x0C # UR
         self.bitmap.blt(x*6, y*6, @autotile, Rect.new(0, 18, 6, 6), 128)
       when 0x0D # UR D
         self.bitmap.blt(x*6, y*6, @autotile, Rect.new(0, 12, 6, 6), 128)
       when 0x0E # URL
         self.bitmap.blt(x*6, y*6, @autotile, Rect.new(6, 18, 6, 6), 128)
       when 0x0F # URLD
         self.bitmap.blt(x*6, y*6, @autotile, Rect.new(6, 12, 6, 6), 128)
       end}}
 end
 #----------------------------------------------------------------------------
 # update
 #  Updates the minimap and sprite movement on the minimap.
 #----------------------------------------------------------------------------
 def update(override = false)
   # creates the passable floor map if new map entered
   create_passable_floor if @map_id != $game_map.map_id
   # get events
   ev = check_events
   # if events or names changed
   if [@events, @names] != ev
     # store new events and names
     @events, @names = ev
     # delete sprites of events
     destroy_sevents
     # create sprites of events
     create_sevents
   end
   # if minimap not in fullscreen mode
   if $game_system.minimap < 2
     # set offset display
     self.ox, self.oy = $game_map.display_x * 6 / 128, $game_map.display_y * 6 / 128
   # if not pressed the turn button to scroll map around
   elsif !($game_system.turn_button && Input.press?(Input::Turn)) || override
     # if map can be scrolled horizontally
     if self.bitmap.width > 640
       # coordinate
       border = $game_player.real_x * 6 / 128 - 320
       # get right border
       border_x = self.bitmap.width - 640
       # set offset
       if border < 0
         self.ox = 0
       elsif border > border_x
         self.ox = border_x
       else
         self.ox = border
       end
     else
       # center map display horizontally
       self.ox = self.bitmap.width/2 - 320
     end
     # if map can be scrolled vertically
     if self.bitmap.height > 480
       # coordinate
       border = $game_player.real_y * 6 / 128 - 240
       # get lower border
       border_y = self.bitmap.height - 480
       # set offset
       if border < 0
         self.oy = 0
       elsif border > border_y
         self.oy = border_y
       else
         self.oy = border
       end
     else
       # center map display vertically
       self.oy = self.bitmap.height/2 - 240
     end
   end
   # iterate through all sprites
   @sevents.each_index {|i|
       # if minimap is not in fullscreen mode and within the range of ABSEAL
       if $game_system.minimap == 2 || @events[i].update?
         # set new coordinates
         @sevents[i].x = self.x + @events[i].real_x * 6 / 128
         @sevents[i].y = self.y + @events[i].real_y * 6 / 128
         # set offsets
         @sevents[i].ox, @sevents[i].oy = self.ox, self.oy
         # if event has a spriteset
         if @names[i] != '' && !@events[i].dropped &&
             (@events[i].is_a?(Map_Actor) ||
             !@events[i].name.clone.gsub!('\box') {''})
           # depending on the facing direction of the event
           @sevents[i].src_rect.set((@events[i].direction-2)*7, 0, 14, 14)
           # change offsets
           @sevents[i].ox += 3
           @sevents[i].oy += 3
         end
       end}
 end
 #----------------------------------------------------------------------------
 # create_sevents
 #  Creates for each event on the map a sprite on the minimap.
 #----------------------------------------------------------------------------
 def create_sevents
   # set empty array
   @sevents = []
   # ierate through all events on the minimap
   @events.each_index {|i|
       # create sprite
       sprite = Sprite.new(viewport)
       # temporary variable
       rect = Rect.new(0, 0, 56, 14)
       # if event is player
       if @events[i] == $game_player
         # if player has spriteset
         if @names[i] != ''
           # create bitmap
           sprite.bitmap = Bitmap.new(56, 14)
           # get green arrow
           sprite.bitmap.blt(0, 0, $BlizzABS.cache.image('green_arrow'), rect, 128)
         end
         # highest sprite
         sprite.z = 100
       # if event is actor
       elsif @events[i].is_a?(Map_Actor)
         # if actor has spriteset
         if @names[i] != ''
           # create bitmap
           sprite.bitmap = Bitmap.new(56, 14)
           # get blue arrow
           sprite.bitmap.blt(0, 0, $BlizzABS.cache.image('blue_arrow'), rect, 128)
         end
         # 2nd highest sprite
         sprite.z = 80
       # if event is enemy
       elsif @events[i].class == Map_Enemy
         # if event without spriteset or "boxdraw" enforcing
         if @names[i] == '' || @events[i].name.clone.gsub!('\box') {''}
           # create bitmap
           sprite.bitmap = Bitmap.new(6, 6)
           # fill rectangle with black color
           sprite.bitmap.fill_rect(0, 0, 6, 6, Color.new(0, 0, 0, 128))
           # fill rectangle with red color
           sprite.bitmap.fill_rect(1, 1, 4, 4, Color.new(255, 0, 0, 128))
         else
           # create bitmap
           sprite.bitmap = Bitmap.new(56, 14)
           # get red arrow
           sprite.bitmap.blt(0, 0, $BlizzABS.cache.image('red_arrow'), rect, 128)
         end
         # 5th highest sprite
         sprite.z = 50
       # if event is dropped item
       elsif @events[i].dropped
         # create bitmap
         sprite.bitmap = Bitmap.new(8, 8)
         # fill rectangle with black color
         sprite.bitmap.fill_rect(0, 0, 8, 8, Color.new(0, 0, 0, 128))
         # fill rectangle with cyan color
         sprite.bitmap.fill_rect(1, 1, 6, 6, Color.new(0, 255, 255, 128))
         # 3rd highest sprite
         sprite.z = 70
       # if event is normal event
       elsif @events[i].class == Game_Event
         # if event has spc command
         if @events[i].name.clone.gsub!('\spc') {''}
           # temporary variables, 4th highest sprite
           color, arrow, sprite.z = Color.new(255, 255, 0, 128), 'yellow_arrow', 60
         # if event code exists and te
         elsif @events[i].teleport
           # temporary variables, 6th highest sprite
           color, arrow, sprite.z = Color.new(128, 0, 255, 128), 'violet_arrow', 40
         end
         # if event without spriteset or "boxdraw" enforcing
         if @names[i] == '' || @events[i].name.clone.gsub!('\box') {''}
           # create bitmap
           sprite.bitmap = Bitmap.new(6, 6)
           # fill rectangle with black color
           sprite.bitmap.fill_rect(0, 0, 6, 6, Color.new(0, 0, 0, 128))
           # fill rectangle with yellow color
           sprite.bitmap.fill_rect(1, 1, 4, 4, color)
         else
           # create bitmap
           sprite.bitmap = Bitmap.new(56, 14)
           # get yellow or violet arrow
           sprite.bitmap.blt(0, 0, $BlizzABS.cache.image(arrow), rect, 128)
         end
       # if event without spriteset or "boxdraw" enforcing
       elsif @names[i] == '' || @events[i].name.clone.gsub!('\box') {''}
         # create bitmap
         sprite.bitmap = Bitmap.new(6, 6)
         # fill rectangle with black color
         sprite.bitmap.fill_rect(0, 0, 6, 6, Color.new(0, 0, 0, 128))
         # fill rectangle with default white color
         sprite.bitmap.fill_rect(1, 1, 4, 4, Color.new(255, 255, 255, 128))
       else
         # create bitmap
         sprite.bitmap = Bitmap.new(56, 14)
         # get white arrow
         sprite.bitmap.blt(0, 0, $BlizzABS.cache.image('white_arrow'), Rect.new(0, 0, 56, 14), 128)
       end
       # create a little dummy bitmap in case no bitmap was created before
       sprite.bitmap = Bitmap.new(1, 1) if sprite.bitmap == nil
       # get sprite out of map screen so ABSEAL can work correctly
       sprite.ox = sprite.oy = 64
       # if event has a spriteset
       if sprite.bitmap.width != 6
         # depending on the facing direction of the event
         sprite.src_rect.set((@events[i].direction-2)*7, 0, 14, 14)
       end
       # add sprite to array
       @sevents.push(sprite)}
     end
     
end


#==============================================================================
# Scene_Map
#------------------------------------------------------------------------------
#  This class was enhanced to support HUD control and creation system and
#  Blizz-ABS battle handling and level up text display.
#  Changed to enable the party hud
#==============================================================================

class Scene_Map
 
 #----------------------------------------------------------------------------
 # override main
 #----------------------------------------------------------------------------
 alias main_blizzabs_later_winkio main
 def main
   # create HUD if HUD is turned on and HUD active
   @hud = Hud.new if $game_system.hud
   @parhud = ParHud.new if $game_system.parhud
   # if HOTKEYS is turned on and assignment display active
   if $game_system.hotkeys
     # create assignment display
     @hotkeys = Hotkey_Assignment.new
   end
   # if MINIMAP is turned on and minimap active
   if $game_system.minimap > 0
     # create HUD
     @minimap = Minimap.new
   end
   # tests and sets the in_battle flag
   test_in_battle
   # call original method
   main_blizzabs_later
   # set in_battle flag
   $game_temp.in_battle = false
   # delete HUD elements that exist
   [@hud, @parhud, @hotkeys, @minimap].each {|s| s.dispose if s != nil}
 end
 #----------------------------------------------------------------------------
 # hud_update
 #  This method contains a couple of routine calls to handle with the HUD.
 #----------------------------------------------------------------------------
 def hud_update
   # check activation of HUD parts
   check_huds
   # update minimap
   update_minimap
   # update hotkey assignment display
   update_hotkeys
   # iterate through all the HUD sprites
   [@hud, @parhud, @minimap, @hotkeys].each {|s|
       # if sprite exists
       if s != nil
         # update sprite
         s.update
         # if player is on the same position as one of the sprites on the screen
         if $game_player.screen_x < s.vx + s.vw + 16 &&
             $game_player.screen_y < s.vy + s.vh + 48 &&
             $game_player.screen_x > s.vx && $game_player.screen_y > s.vy &&
             ((s == @minimap) ? ($game_system.minimap < 2) : true)
           # decrease opacity quickly if critical opacity not reached
           s.opacity -= 25 if s.opacity > 80
         # if not full opacity
         elsif s.opacity <= 255
           # increase opacity quickly if critical opacity not reached
           s.opacity += 25
         end
       end}
 end
 #----------------------------------------------------------------------------
 # check_huds
 #  This method handles enabling and disabling the HUD parts on the map.
 #----------------------------------------------------------------------------
 def check_huds
   # if minimap button is enabled and pressed
   if $game_system.minimap_button && Input.trigger?(Input::Minimap)
     # trigger minimap active
     $game_system.minimap = ($game_system.minimap + 1) %
        ((PARHUD_CONFIG::MINIMAP_FULLSCREEN) ? 3 : 2)  #change123
   end
   # if hotkey display button is enabled and pressed
   if $game_system.hotkey_button && Input.trigger?(Input::Hotkey)
     # trigger hotkey display active
     $game_system.hotkeys = (!$game_system.hotkeys)
   end
   # if HUD button is enabled and pressed
   if $game_system.hud_button && Input.trigger?(Input::Hud)
     # trigger it active
     $game_system.hud = (!$game_system.hud)
     $game_system.parhud = (!$game_system.parhud)
   end
   # if minimap not active and minimap exists
   if $game_system.minimap == 0 && @minimap != nil
     # delete it
     @minimap.dispose
     @minimap = nil
   # if minimap is turned on and active and doesn't exist
   elsif BlizzABS::Config::MINIMAP && $game_system.minimap > 0
     # create it
     @minimap = Minimap.new if @minimap == nil
   end
   # if assignment display not active and exists
   if !$game_system.hotkeys && @hotkeys != nil
     # delete it
     @hotkeys.dispose
     @hotkeys = nil
   # if HOTKEYS is turned on and active and doesn't exist
   elsif BlizzABS::Config::HOTKEYS && $game_system.hotkeys
     # create it
     @hotkeys = Hotkey_Assignment.new if @hotkeys == nil
   end
   # if HUD not active and HUD exists
   if !$game_system.hud && @hud != nil
     # delete it
     @hud.dispose
     @hud = nil
     @parhud.dispose
     @parhud = nil
   # if HUD is turned on and HUD active and HUD doesn't exist
   elsif BlizzABS::Config::HUD_ENABLED && $game_system.hud
     # create it
     @hud = Hud.new if @hud == nil
     @parhud = ParHud.new if @parhud == nil
   end
 end
 
end
#==============================================================================
# Window_Skill_Hotkey
#------------------------------------------------------------------------------
#  This class serves as display for skills that can be hotkeyed.
#  Changed position to top of screen
#==============================================================================

class Window_Skill_Hotkey < Window_Skill
 
 #----------------------------------------------------------------------------
 # Initialization
 #  actor - actor
 #----------------------------------------------------------------------------
 def initialize(actor)
   # call superclass method
   super
   # set max column number
   @column_max = 1
   # set width and height
   self.width, self.height = 320, 416
   # set y and z position
   self.y, self.z = 0, 21000
   # remove cursor display
   self.cursor_rect.empty
   # set to not active
   self.active = false
   # refresh display
   refresh
 end
 
end

#==============================================================================
# Window_Item_Hotkey
#------------------------------------------------------------------------------
#  This class serves as display for items that can be hotkeyed.
#  Changed position to top of screen
#==============================================================================

class Window_Item_Hotkey < Window_Item
 
 #----------------------------------------------------------------------------
 # Initialization
 #  actor - actor
 #----------------------------------------------------------------------------
 def initialize
   # call superclass method
   super
   # set max column number
   @column_max = 1
   # set width and height
   self.width, self.height = 320, 416
   # set x, y and z position
   self.x, self.y, self.z = 320, 0, 21000
   # remove cursor display
   self.cursor_rect.empty
   # set to not active
   self.active = false
   # refresh display
   refresh
 end
 
end

#==============================================================================
# Scene_Hotkeys
#------------------------------------------------------------------------------
#  This class handles the skill/item hotkey processing.
#  The position of the arrow has been changed to the bottom of the screen.
#  Also included the upside down arrow.
#==============================================================================

class Scene_Hotkeys
 
 #----------------------------------------------------------------------------
 # main
 #  The main processing method.
 #----------------------------------------------------------------------------
 def main
   # create spriteset
   @spriteset = Spriteset_Map.new
   # create viewport
   @view = Viewport.new(0, 0, 640, 480)
   # set tone to current screen tone
   @view.tone = @tone.clone
   # create HUD if HUD is turned on and HUD active
   @hud = Hud.new if BlizzABS::Config::HUD_ENABLED && $game_system.hud
   # if ASSIGNMENT is turned
   if BlizzABS::Config::HOTKEYS
     # create assignment display
     @hotkeys = Hotkey_Assignment.new
     # set z position
     @hotkeys.z = 5000
   end
   # if MINIMAP is turned on and minimap active
   if BlizzABS::Config::MINIMAP && $game_system.minimap > 0
     # create HUD
     @minimap = Minimap.new
   end
   # create sprite
   @choice = Sprite.new
   # create bitmap
   @choice.bitmap = menu_arrow
   # set x, y and z positions
   @choice.x, @choice.y, @choice.z, @choice.opacity = 160, 440, 500, 128
   # set x position offset
   @choice.ox = -8
   # set active flag
   @active = true
   # set index
   @index = 0
   # set up mode flag
   @up_mode = true
   # create modified skill window
   @skill_window = Window_Skill_Hotkey.new($game_player.battler)
   # create modified item window
   @item_window = Window_Item_Hotkey.new
   # set last active
   @last_active = true
   # transtition
   Graphics.transition
   # loop
   loop do
     # update game screen
     Graphics.update
     # update input
     Input.update
     # frame update
     update
     # stop if chosen an option
     break if $scene != self
   end
   # freeze screen
   Graphics.freeze
   # delet spriteset
   @spriteset.dispose
   # delete HUD elements that exist
   [@hud, @hotkeys, @minimap].each {|s| s.dispose if s != nil}
   # delete choice sprite
   @choice.dispose
   # delete skill window
   @skill_window.dispose
   # delete item window
   @item_window.dispose
   # delete viewport
   @view.dispose
 end
 #--------------------------------------------------------------------------
 # menu_arrow
 #  Creates the arrow displayed in the hotkey assignment menu.  Upside down
 #--------------------------------------------------------------------------
 def menu_arrow
   b = Bitmap.new(16, 9)
   c1 = Color.new(0, 0, 0)
   c2 = Color.new(255, 255, 255)
   c3 = Color.new(127, 127, 127)
   b.fill_rect(7, 8, 2, 1, c2)
   b.set_pixel(6, 7, c2)
   b.fill_rect(7, 7, 1, 7, c3)
   b.fill_rect(8, 7, 1, 7, c1)
   b.set_pixel(9, 7, c2)
   b.set_pixel(5, 6, c2)
   b.fill_rect(6, 6, 1, 6, c3)
   b.fill_rect(9, 6, 1, 6, c1)
   b.set_pixel(10, 6, c2)
   b.set_pixel(4, 5, c2)
   b.fill_rect(5, 5, 1, 5, c3)
   b.fill_rect(10, 5, 1, 5, c1)
   b.set_pixel(11, 5, c2)
   b.set_pixel(3, 4, c2)
   b.fill_rect(4, 4, 1, 4, c3)
   b.fill_rect(11, 4, 1, 4, c1)
   b.set_pixel(12, 4, c2)
   b.set_pixel(2, 3, c2)
   b.fill_rect(3, 3, 1, 3, c3)
   b.fill_rect(12, 3, 1, 3, c1)
   b.set_pixel(13, 3, c2)
   b.set_pixel(1, 2, c2)
   b.fill_rect(2, 2, 1, 2, c3)
   b.fill_rect(13, 2, 1, 2, c1)
   b.set_pixel(14, 2, c2)
   b.set_pixel(0, 1, c2)
   b.set_pixel(1, 1, c3)
   b.set_pixel(14, 1, c1)
   b.set_pixel(15, 1, c2)
   b.fill_rect(1, 0, 14, 1, c2)
   return b
 end
 
end



Instructions

Put below all parts of Blizz-ABS.  Works for up to 6 party members, and actor with ID 1 in the database should always be in the party.


Compatibility
Use Blizz-ABS 2.x


Credits and Thanks




Author's Notes

If you need a slight edit for your use, just ask here.
use
$game_system.parhud = false
to turn off the party HUD for cutscenes.
Title: Re: How much would this HUD lag?
Post by: cstb on November 23, 2008, 03:33:47 pm
I don't see alot of lag there :P.It might work :haha:
Title: Re: How much would this HUD lag?
Post by: Blizzard on November 24, 2008, 05:18:13 am
If you code it that way to extend Blizz-ABS's HUD, it should increase the lag insignificantly.
Title: Re: How much would this HUD lag?
Post by: winkio on November 24, 2008, 11:33:37 am
ok thanks blizz.  I actually think I might just make one exp bar, because that is really all I need because all exp in my game goes to the whole party.

Also, are you changing the HUD in 2.0?  I assume not, but if you are, I should probably wait.
Title: Re: How much would this HUD lag?
Post by: Blizzard on November 24, 2008, 12:37:56 pm
No, I am not changing it. It will stay the same. I think it's pretty much the optimum that can be done.
Title: Re: How much would this HUD lag?
Post by: winkio on November 24, 2008, 01:11:12 pm
great, then it's already most of the way done! :)

EDIT:  I've gotten the layout and everything done except the hotkey bars and the hp/sp bars.  I assume that this is changing in 2.0, but how will I be able to access the different party members' stats, and how can i keep them in order (as in, they will be the same no matter who I am controlling or do I have to make an offset)?
Title: Re: How much would this HUD lag?
Post by: Punn on November 27, 2008, 01:39:19 pm
What if you have the option to change the image, like load from \graphic\picture, and maybe the option to show the image too.. that would be full customization.

Although I do like your HUD, but instead of the gray bar, it should be the bar (SR).
And show the faceset of the actor
Title: Re: How much would this HUD lag?
Post by: winkio on November 29, 2008, 10:51:27 pm
That HUD up there is going to be for personal use in my game.  After I make that one, I'll probably add some further customization options to it and release it publicly. 
BTW, this is done except for resizing the minimap arrows and getting info for all 4 party members at once.

I have done:

Created the top HP/SP/XP HUD for the player controlled character
Created the down-left HUD box, except for the bar #
modified the skill bar and hotkey assigning window for a new position
Resized the minimap tiles and drawing mechanisms to 5x5 instead of 8x8.

I still need to do:

Create and manage the HP/SP/XP HUD for all actors besides the player-controlled one.
resize the minimap arrows
Create multiple hotkey bars that can be cycled through.
------------------------------------------
So most of the big stuff is done.
Once my personal version is done, I'll post up a screen shot of it, and then I'll probably start trying to clean it up for everyone else.  Oh, and the multiple skill bar thing I'll probably release seperately, unless it's in BABS 2.0, just because I think it is needed.

EDIT:  Blizz, what does your cached bitmap of greenarrow and whitearrow look like?  for the minimap...
Title: Re: Custom Blizz-ABS HUD
Post by: Blizzard on December 01, 2008, 09:35:36 am
Basically an arrow pointing in each direction. BTW, I posted a plugin that adds an EXP bar into the HUD.
Title: Re: Custom Blizz-ABS HUD
Post by: winkio on December 01, 2008, 05:28:16 pm
Don't worry, I already stole that from your old HUD  :ninja:

Now I have to recode this for 2.0 because of a few slight changes.
And I think I can manage the rest on my own now, thanks for your help.
Title: Re: Custom Blizz-ABS HUD
Post by: Blizzard on December 01, 2008, 06:44:49 pm
Or you can just use the plugin with the new HUD. xD
Title: Re: Custom Blizz-ABS HUD
Post by: winkio on December 01, 2008, 08:27:30 pm
It's basically the same thing.  Except I modded mine to display the level instead of the xp.  And I redid it easily enough.  Now, to to the multiple hotkey bars...

EDIT:  Ok, how can I access the party members in a set order?

Example:  i have Four actors that I want to display in order 1,2,3,4 regardless of which one is the current leader.  do I have to make a counter variable each time I switch leaders in the caterpillar or is there an easier way to do it based on the actors' info?
Title: Re: Custom Blizz-ABS HUD
Post by: Blizzard on December 02, 2008, 07:16:30 am
Yes. $game_party.actors is an array with all Game_Actor instances currently in the party. Simply iteratre through it. I suggest iterating with an index since you can use the index itself to calculate the drawing position. Something similar was done in Window_BattleStatus#refresh, just take a look if you're unsure what I mean.
Title: Re: Custom Blizz-ABS HUD
Post by: winkio on December 02, 2008, 06:08:34 pm
I got it.  Wow, that wasn't really so hard.  Just have to fix the offests for events on the minimap and its done!

EDIT: YAY! done.  I'll post up screenies soon...

EDIT2:  Dang, it does cause small but noticeable lag, just because it has to check each party member's hp and sp every time.  Any way to avoid that?
Title: Re: Custom Blizz-ABS HUD
Post by: Blizzard on December 03, 2008, 05:45:16 am
Actually that is what reduces the lag as it prevents refreshing of the HUD unless the values have changed. Comparisons are really not creating any lag, trust me.
Title: Re: Custom Blizz-ABS HUD
Post by: winkio on December 03, 2008, 09:09:01 am
yep, it was just the map I was testing in.  It works great now.

Now to fix it up for public release and customization.
Title: Re: Custom Blizz-ABS HUD
Post by: Blizzard on December 03, 2008, 09:52:47 am
Will you post the HUD script?
Title: Re: Custom Blizz-ABS HUD
Post by: winkio on December 03, 2008, 05:27:20 pm
Quote from: winkio on December 03, 2008, 09:09:01 am
Now to fix it up for public release and customization.


It's kinda messy and really will only work for my game right now.  Need to clean it up and make is usable.

EDIT: posted up screenshots of it.  The minimap jumps to a different location during the hotkey assignment part, so that's why its different in the second image.  It jumps right back after you are done.

EDIT2:  ok, i put the completed public version of the script up.  It onlly works for a max party size of 4, and they must in the the first 4 slots of the database in order.
Title: Re: Custom Blizz-ABS HUD
Post by: Fantasist on December 09, 2008, 02:09:12 am
How about you apply the script template ;)
Title: Re: Custom Blizz-ABS HUD
Post by: Blizzard on December 09, 2008, 02:44:17 am
Yeah, just apply the template to your first post and it can be database'd.
Title: Re: Custom Blizz-ABS HUD
Post by: winkio on December 09, 2008, 06:11:38 pm
Template applied.

ATTENTION ALL BITS AND BYTES!  PREPARE FOR FORUM SECTION HYPERJUMP!  SECURE ALL LAUNCH DOORS!  PROCEED TO YOUR SEATS AND FASTEN YOUR SEATBELTS.  THANK YOU.
Title: Re: [XP]Custom Blizz-ABS HUD
Post by: Landith on December 09, 2008, 07:49:00 pm
I have a suggestion..

You could make it where you can choose the option to have the actor's hp and sp centered or not, to make it look better if you have less than 4 actors.

Just a small suggestion lol
Title: Nice script...
Post by: diablosbud on December 11, 2008, 07:57:15 am
This is a good script, excellent for cooperative games. I have a quick error I would like to share, my order of scripts is:
Blizz-ABS Part1
Blizz-ABS Part2
Blizz-ABS Part3
Custom Blizz-ABS HUD (this script)
Chaos Project Debug Menu.

All the scripts are at their latest updates. But, upon new game startup (I didn't have anything to load, so I didn't test that) I got an error that states "Script 'Custom Blizz-ABS HUD' line 561: NoMethodError occurred. undefined method 'name' for #<Game_Map:0x8049020>". Could someone please help me solve this error.
Title: Re: [XP] Custom Blizz-ABS HUD
Post by: winkio on December 11, 2008, 09:16:05 am
That error is caused because you don't have the map name addon.  I though I forgot to include something :^_^':!  That new version should work

UPDATED TO v1.10

What's new:
Optimized code - for those of you that wish to make your own edits, and to decrease lag
Max party size from 1 to 6 - works with any party size from 1 to 6.
Title: Re: [XP] Custom Blizz-ABS HUD
Post by: Fantasist on December 24, 2008, 11:04:51 pm
I was gonna suggest that: use arrays, but you already did. And why is it limited to 6 party members? Technically, when you use arrays, you can go with as many as possible. I'm guessing it's the size of the HUD, right?
Title: Re: [XP] Custom Blizz-ABS HUD
Post by: winkio on December 25, 2008, 12:18:40 am
exactly.  6 is the max party members with a sizeable hp/sp bar width.  I'll soon add the option to always center the displays based on the party size, as it won't take more than a few minutes.  But it's christmas in 2 hours, and I just ate 40 raviolis and won big in a poker game, so I'm done for a little while.
Title: Re: [XP] Custom Blizz-ABS HUD
Post by: Fantasist on December 25, 2008, 12:27:53 am
Merry Christmas then :)
Title: Re: [XP] Custom Blizz-ABS HUD
Post by: RoseSkye on March 22, 2009, 03:34:23 pm
This script is good for more than one character parties but there is no hotkey display in the HUD.
Can anyone point me to a way I can display which skill is currently selected for this HUD?
Title: Re: [XP] Custom Blizz-ABS HUD
Post by: Landith on March 31, 2009, 07:36:21 pm
I made it work but I had to take out the Gold display in the bottom left thing for it to work.
You want it..?
Title: Re: [XP] Custom Blizz-ABS HUD
Post by: RoseSkye on March 31, 2009, 07:38:13 pm
Sure do.
Title: Re: [XP] Custom Blizz-ABS HUD
Post by: Landith on March 31, 2009, 07:39:22 pm
Okay, give me a minute to add the EXP Bar back on.

Here ya go... Tell me if I messed anything up >.<
Spoiler: ShowHide

#|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|
# Blizz-ABS Party HUD by Winkio
# Version: 1.10
#|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|
#
#
#|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|
# This script modifies the Blizz-ABS HUD to display the HP/SP of up to four
# party members at once.  It also moves the hud and skill bar to the bottom and
# scales down the minimap.
#
# If you find any bugs, please report them here:
# http://forum.chaos-project.com
#|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|

#==============================================================================
# Game_System
#------------------------------------------------------------------------------
#  This class was modified to support the party hud
#==============================================================================
class Game_System
  attr_accessor :parhud
end

#==============================================================================
# Scene_Title
#==============================================================================

class Scene_Title

  alias main_parhud_later main
  def main
    $map_infos = load_data('Data/MapInfos.rxdata')
    $map_infos.keys.each {|key| $map_infos[key] = $map_infos[key].name}
    main_parhud_later
  end
 
end

#==============================================================================
# Game_Map
#==============================================================================

class Game_Map
       
  def name
    return $map_infos[@map_id]
  end
   
end

#==============================================================================
# ParHud
#------------------------------------------------------------------------------
#  This class creates the top hud that shows the hp/sp of all party members and
#  their names.
#==============================================================================

class ParHud < Sprite
 
  #----------------------------------------------------------------------------
  # Initialization
  #  viewport - the viewport for the sprite
  #----------------------------------------------------------------------------
  def initialize(viewport = nil)
    # call superclass method
    super
    # create positions
    create_positions
    # create bitmap
    self.bitmap = Bitmap.new(640, 80)
    # set font
    self.bitmap.font.name = 'Arial'
    # set font size
    self.bitmap.font.size = 16
    # set font to bold
    self.bitmap.font.bold = true
    # set z coordinate
    self.z = 1000
    # set party size
    @psize = $game_party.actors.size
    @poffset = 0
    @hp, @maxhp = [0, 0, 0, 0], [0, 0, 0, 0]
    @sp, @maxsp = [0, 0, 0, 0], [0, 0, 0, 0]
    # draw basic HUD
    draw_basic
    # update
    update
  end
  #----------------------------------------------------------------------------
  # create_positions
  #  Sets drawing positions. This method can be aliased and the positions
  #  modified to create a different HUD.
  #----------------------------------------------------------------------------
  def create_positions
    @maxpsize = BlizzABS::Config::MAX_PARTY
    @name_x, @name_y, @hp_x, @hp_y, @sp_x, @sp_y = [], [], [], [], [], []
    (0...@maxpsize).each {|i|
      xdat = i*640/@maxpsize + 320/@maxpsize-50
      @name_x.push(xdat)
      @name_y.push(0)
      @hp_x.push(xdat)
      @hp_y.push(16)
      @sp_x.push(xdat)
      @sp_y.push(33)}
  end
  #----------------------------------------------------------------------------
  # draw_basic
  #  Draws the HUD template.
  #----------------------------------------------------------------------------
  def draw_basic
    self.bitmap.font.size = 16
    color = Color.new(255, 255, 255, 127)
    self.bitmap.font.color = Color.new(255, 255, 255)
    # if color exists
    if color.is_a?(Color)
      (0...@psize).each {|i|
        # draw outlines in color
        self.bitmap.fill_rect(@hp_x[i], @hp_y[i], 102, 14, color)
        self.bitmap.fill_rect(@sp_x[i], @sp_y[i], 102, 14, color)
        # draw actor's names
        self.bitmap.draw_text_full(@name_x[i], @name_y[i], 104, 20, actor(i).name, 1)
        }
    end
    self.bitmap.font.size = 14
  end
  #----------------------------------------------------------------------------
  # draw_empty
  #  Draws the HP and SP display when actor doesn't exist.
  #----------------------------------------------------------------------------
  def draw_empty
    # set font color
    self.bitmap.font.color = disabled_color
    (0...@psize).each {|i|
      # draw empty bars
      self.bitmap.gradient_bar_hud(@hp_x[i], @hp_y[i], 100, 0, 'hud_green_bar')
      self.bitmap.gradient_bar_hud(@sp_x[i], @sp_y[i], 100, 0, 'hud_blue_bar')
      # draw empty HP/SP
      self.bitmap.draw_text_full(@hp_x[i]+48, @hp_y[i]-3, 48, 20, '0', 2)
      self.bitmap.draw_text_full(@sp_x[i]+48, @sp_y[i]-3, 48, 20, '0', 2)
      }
    # reset all flag variables
    @hp = @sp = @maxhp = @maxsp = nil
  end
  #----------------------------------------------------------------------------
  # draw_hp
  #  Draws the HP display.
  #----------------------------------------------------------------------------
  def draw_hp
    @hp, @maxhp = [], []
    self.bitmap.font.color = normal_color
    (0...@psize).each {|i|
      # set current variables
      @hp.push(actor(i).hp)
      @maxhp.push(actor(i).maxhp)
      rate = (@maxhp[i] > 0 ? @hp[i].to_f / @maxhp[i] : 0)
      # draw gradient bar
      self.bitmap.gradient_bar_hud(@hp_x[i], @hp_y[i], 100, rate, 'hud_green_bar', 0)
      # draw HP
      self.bitmap.draw_text_full(@hp_x[i]+1, @hp_y[i], 100, 11, @hp[i].to_s, 1)
      }
  end
  #----------------------------------------------------------------------------
  # draw_sp
  #  Draws the SP display.
  #----------------------------------------------------------------------------
  def draw_sp
    @sp, @maxsp = [], []
    self.bitmap.font.color = normal_color
    (0...@psize).each {|i|
      # set current variables
      @sp.push(actor(i).sp)
      @maxsp.push(actor(i).maxsp)
      rate = (@maxsp[i] > 0 ? @sp[i].to_f / @maxsp[i] : 0)
      # draw gradient bar
      self.bitmap.gradient_bar_hud(@sp_x[i], @sp_y[i], 100, rate, 'hud_blue_bar', 0)
      # draw HP
      self.bitmap.draw_text_full(@sp_x[i]+1, @sp_y[i], 100, 11, @sp[i].to_s, 1)
      }
  end
  #----------------------------------------------------------------------------
  # update
  #  Checks if HUD needs refreshing.
  #----------------------------------------------------------------------------
  def update
    # if actor doesn't exist
    if actor == nil
      # unless already drawn empty HUD
      unless @empty_hud_drawn
        # draw HUD template
        draw_basic
        # draw empty HP, SP and EXP bars
        draw_empty
        # empty HUD was drawn
        @empty_hud_drawn = true
      end
    else
      if @psize != $game_party.actors.size
        @psize = $game_party.actors.size
        draw_basic
      end
      # if HUD needs refresh
      if $game_temp.hud_refresh
        # draw all data about actors
        draw_hp
        draw_sp
        # remove flag
        $game_temp.hud_refresh = nil
      else
        # draw data that needs to be updated
        test_offset
        test_hp
        test_sp
      end
      # empty HUD wasn't drawn
      @empty_hud_drawn = false
    end
  end
  #----------------------------------------------------------------------------
  # test_hp
  #  Tests and draws the HP.
  #----------------------------------------------------------------------------
  def test_hp
    (0...@psize).each {|i|
      # draw new HP if HP or max HP have changed
      if actor(i).hp != @hp[i] || actor(i).maxhp != @maxhp[i]
        draw_hp
        return
      end}
  end
  #----------------------------------------------------------------------------
  # test_sp
  #  Tests and draws the SP.
  #----------------------------------------------------------------------------
  def test_sp
    (0...@psize).each {|i|
      # draw new HP if HP or max HP have changed
      if actor(i).sp != @sp[i] || actor(i).maxsp != @maxsp[i]
        draw_sp
        return
      end}
  end
  #----------------------------------------------------------------------------
  # test_offset
  #  Tests and draws the SP.
  #----------------------------------------------------------------------------
  def test_offset
    (0...@psize).each {|i|
    if $game_party.actors[(i + @poffset)%@psize].name != $game_actors[1].name
      @poffset += 1
    else
      return
    end}
    @poffset %= @psize
  end
  #----------------------------------------------------------------------------
  # actor
  #  Returns the party leader's battler for easier reference.
  #----------------------------------------------------------------------------
  def actor(id = 0)
    return $game_party.actors[id + @poffset]
  end 
 
end

#==============================================================================
# Hud
#------------------------------------------------------------------------------
#  This class was modified to support SR display and modify the number of
#  skills left to use.
#  Displays HUD window and exp/level bar
#==============================================================================

class Hud < Sprite
 
  #----------------------------------------------------------------------------
  # Initialization
  #  viewport - the viewport for the sprite
  #----------------------------------------------------------------------------
  def initialize(viewport = nil)
    # call superclass method
    super
    # create positions
    create_positions
    # create bitmap
    self.bitmap = Bitmap.new(120, 90)
    # set font
    self.bitmap.font.name = 'Tahoma'
    # set font size
    self.bitmap.font.size = 16
    # set font to bold
    self.bitmap.font.bold = true
    # set x and y coordinates
    self.x, self.y = @hud_x, @hud_y
    # set z coordinate
    self.z = 1000
    # draw basic HUD
    draw_basic
    # update
    update
  end
  #----------------------------------------------------------------------------
  # create_positions
  #  Sets drawing positions. This method can be aliased and the positions
  #  modified to create a different HUD.
  #----------------------------------------------------------------------------
  def create_positions
    @hud_height, @hud_width, @hud_x, @hud_y = 130, 120, 0, 390
    @level_x, @level_y = 0, 0
    @er_x, @er_y, @loc_x, @loc_y = 10, 40, 10, 10
    @sbar_x, @sbar_y = 65, 60
    @hot_x, @hot_y, @left_x, @left_y = 14, 50, 14, 74
  end
  #----------------------------------------------------------------------------
  # draw_basic
  #  Draws the HUD template.
  #----------------------------------------------------------------------------
  def draw_basic
    # fill with grey rectangle
    self.bitmap.fill_rect(0, 0, @hud_width, @hud_height,
        Color.new(0, 0, 0, 127))
    color = Color.new(255, 255, 255, 127)
    # if color exists
    if color.is_a?(Color)
      # draw outlines in color
      self.bitmap.fill_rect(@level_x, @level_y-15, 120, 14, color)
    end
    # set font color
    self.bitmap.font.color = system_color
  end
  #----------------------------------------------------------------------------
  # draw_empty
  #  Draws the HP and SP display when actor doesn't exist.
  #----------------------------------------------------------------------------
  def draw_empty
    self.bitmap.gradient_bar_hud(@level_x+1, @level_y-14, 118, 'hud_white_bar', 1)
    # set font color
    self.bitmap.font.color = disabled_color
    # draw empty HP
    self.bitmap.draw_text_full(@level_x, @level_y-14, 118, 11, '0', 1)
    # reset all flag variables
    @name = @level = @hp = @sp = @maxhp = @maxsp = @exp = @states = @skill =
        @skills_left = @item = @items_left = @gold = nil
  end
  #----------------------------------------------------------------------------
  # draw_exp
  #  Draws the EXP display.
  #----------------------------------------------------------------------------
  def draw_exp
    # set current variables
    @exp, @level = actor.exp, actor.level
    # set fill rate
    rate = (actor.next_exp != 0 ? actor.now_exp.to_f / actor.next_exp  : 1)
    # draw gradient bar
    self.bitmap.gradient_bar_hud(@level_x, @level_y, 118, rate, 'hud_white_bar', 2)
    # set font color depending on how many HP left
    self.bitmap.font.color = normal_color
    self.bitmap.font.size = 14
    # draw EXP
    self.bitmap.draw_text_full(@level_x, @level_y-3, 118, 20, 'Level ' + @level.to_s, 1)
  end
  #----------------------------------------------------------------------------
  # draw_er
  #  Draws the er display.
  #----------------------------------------------------------------------------
  def draw_er
    self.bitmap.fill_rect(@loc_x-10, @loc_y+20, 100, 20, Color.new(0, 0, 0, 127))
    self.bitmap.font.color, self.bitmap.font.size = normal_color, 12
    self.bitmap.draw_text_full(@loc_x-30, @loc_y+20, 100, 20, "Skills", 1)
    self.bitmap.draw_text_full(@loc_x+30, @loc_y+20, 100, 20, "Items", 1)
  end
  #----------------------------------------------------------------------------
  # draw_loc
  #  Draws the map location display.
  #----------------------------------------------------------------------------
  def draw_loc
    # set current variable
    @loc = $game_map.name
    # remove old display
    self.bitmap.fill_rect(@loc_x, @loc_y+4, 100, 20, Color.new(0, 0, 0, 127))
    # set font color
    self.bitmap.font.color, self.bitmap.font.size = normal_color, 16
    # draw party's gold   
    self.bitmap.draw_text_full(@loc_x, @loc_y, 100, 20, $game_map.name, 1)
    self.bitmap.font.size = 12
  end
  #----------------------------------------------------------------------------
  # draw_hskill
  #  Draws the hot skill display.
  #----------------------------------------------------------------------------
  def draw_hskill
    # set current variable
    @skill = actor.skill
    # remove old display
    self.bitmap.fill_rect(@hot_x+5, @hot_y, 24, 24, Color.new(0, 0, 0, 128))
    # if skill hot skill exists
    if @skill != 0
      # load bitmap
      bitmap = RPG::Cache.icon($data_skills[@skill].icon_name)
      # draw bitmap
      self.bitmap.blt(@hot_x+5, @hot_y, bitmap, Rect.new(0, 0, 24, 24))
    end
    # removes skills left to use display
    draw_lskill
  end
  #----------------------------------------------------------------------------
  # draw_lskill
  #  Draws the skills left to use display.
  #----------------------------------------------------------------------------
  def draw_lskill
    # remove old display
    self.bitmap.fill_rect(@left_x+5, @left_y, 24, 16, Color.new(0, 0, 0, 128))
    # get the number of skills left
    @skills_left = get_skills_left
    # if hot skill exists
    if @skill != nil && @skill > 0
      # if normal SP cost
      if @skills_left >= 0
        # if not enough sp to use
        if @skills_left == 0
          # set font color
          self.bitmap.font.color = Color.new(255, 0, 0)
        # if enough SP for 5 or less skill uses
        elsif @skills_left <= 5
          # set font color
          self.bitmap.font.color = Color.new(255, 255, 0)
        else
          # set font color
          self.bitmap.font.color = normal_color
        end
        # decrease font color
        self.bitmap.font.size -= 2
        # draw number how many skills left to use
        self.bitmap.draw_text_full(@left_x+5, @left_y, 24, 20, @skills_left.to_s, 1)
        # increase font size
        self.bitmap.font.size += 2
      # if infinite skills left
      elsif @skills_left == -1
        # set font color
        self.bitmap.font.color = Color.new(0, 255, 0)
        # increase font size
        self.bitmap.font.size += 4
        # draw "∞" skill uses left
        self.bitmap.draw_text_full(@left_x+5, @left_y, 24, 20, '∞', 1)
        # decrease font size
        self.bitmap.font.size -= 4
      end
    end
  end
  #----------------------------------------------------------------------------
  # get_skills_left
  #  Gets the number of skill usages left.
  #----------------------------------------------------------------------------
  def get_skills_left
    # if skill hot skill exists
    if @skill != nil && @skill > 0
      # if SP cost is zero
      if $data_skills[@skill].sp_cost > 0
        # get basic SP cost
        sp_cost = $data_skills[@skill].sp_cost
        # if using SP Cost Mod Status
        if $tons_version != nil && $tons_version >= 6.54 &&
            $game_system.SP_COST_MOD
          # get modified cost
          sp_cost = BlizzCFG.get_cost_mod(actor.states, sp_cost)
        end
        # infinite
        return -1 if sp_cost == 0
        # calculate skills left to use
        return @sp / sp_cost
      end
      # set flag
      return -1
    end
    # set flag
    return -2
  end
  #----------------------------------------------------------------------------
  # draw_hitem
  #  Draws the hot item display.
  #----------------------------------------------------------------------------
  def draw_hitem
    # set current variable
    @item = actor.item
    # remove old display
    self.bitmap.fill_rect(@hot_x+60, @hot_y, 24, 24, Color.new(0, 0, 0, 128))
    # if hot item exists
    if @item != 0
      # load bitmap
      bitmap = RPG::Cache.icon($data_items[@item].icon_name)
      # draw bitmap
      self.bitmap.blt(@hot_x+60, @hot_y, bitmap, Rect.new(0, 0, 24, 24))
    end
    # removes items left to use display
    draw_litem
  end
  #----------------------------------------------------------------------------
  # draw_litem
  #  Draws the items left to use display.
  #----------------------------------------------------------------------------
  def draw_litem
    # set current variable
    @items_left = $game_party.item_number(@item)
    # remove old display
    self.bitmap.fill_rect(@left_x+60, @left_y, 24, 16, Color.new(0, 0, 0, 128))
    # if hot item exists
    if @item != nil && @item > 0
      # if item exists and cannot be consumed
      if $data_items[@item] != nil && !$data_items[@item].consumable
        # set font color
        self.bitmap.font.color = Color.new(0, 255, 0)
        # increase font size
        self.bitmap.font.size += 4
        # draw "∞" items left
        self.bitmap.draw_text_full(@left_x+60, @left_y, 24, 20, '∞', 1)
        # decrease font size
        self.bitmap.font.size -= 4
      else
        # if no items left
        if @items_left == 0
          # set font color
          self.bitmap.font.color = Color.new(255, 0, 0)
        # if equal or less items left
        elsif @items_left <= 10
          # set font color
          self.bitmap.font.color = Color.new(255, 255, 0)
        else
          # set font color
          self.bitmap.font.color = normal_color
        end
        # decrease font color
        self.bitmap.font.size -= 2
        # draw number how many items left to use
        self.bitmap.draw_text_full(@left_x+60, @left_y, 24, 20, @items_left.to_s, 1)
        # increase font size
        self.bitmap.font.size += 2
      end
    end
  end
  #----------------------------------------------------------------------------
  # update
  #  Checks if HUD needs refreshing.
  #----------------------------------------------------------------------------
  def update
    # if actor doesn't exist
    if actor == nil
      # unless already drawn empty HUD
      unless @empty_hud_drawn
        # draw HUD template
        draw_basic
        # draw empty HP, SP and EXP bars
        draw_empty
        # empty HUD was drawn
        @empty_hud_drawn = true
      end
    else
      # if HUD needs refresh
      if $game_temp.hud_refresh
        # draw all data about actors
        draw_exp
        draw_er
        draw_loc
        unless BlizzABS::Config::DIRECT_HOTKEYS
          draw_hskill
          draw_lskill
          draw_hitem
          draw_litem
        end
        # remove flag
        $game_temp.hud_refresh = nil
      else
        # draw data that needs to be updated
        test_exp
        test_er
        test_loc
        unless BlizzABS::Config::DIRECT_HOTKEYS
          test_hskill
          test_lskill
          test_hitem
          test_litem
        end
      end
      # empty HUD wasn't drawn
      @empty_hud_drawn = false
    end
  end
  #----------------------------------------------------------------------------
  # test_exp
  #  Tests and draws the EXP.
  #----------------------------------------------------------------------------
  def test_exp
    # draw new HP if HP or max HP have changed
    draw_exp if actor.exp != @exp
  end
  #----------------------------------------------------------------------------
  # test_er
  #  Tests and draws the er.
  #----------------------------------------------------------------------------
  def test_er
    # draw new er if er has changed
    draw_er if $game_party.gold != @er
  end
  #----------------------------------------------------------------------------
  # test_loc
  #  Tests and draws the loc.
  #----------------------------------------------------------------------------
  def test_loc
    # draw new er if er has changed
    draw_loc if $game_map.name != @loc
  end
  #----------------------------------------------------------------------------
  # actor
  #  Returns the party leader's battler for easier reference.
  #----------------------------------------------------------------------------
  def actor
    return $game_player.battler
  end
  #----------------------------------------------------------------------------
  # dispose
  #  Removes PARHUD from screen and memory.
  #----------------------------------------------------------------------------
  def dispose
    @parhud = nil
    # call superclass method
    super
  end
 
end

#==============================================================================
# Hotkey_Assignment
#------------------------------------------------------------------------------
#  This class creates and display currently assigned hotkeys and is more
#  effiecient than the Window class.
#  Changed to display at bottom of screen with new graphics.
#==============================================================================

class Hotkey_Assignment < Sprite
 
  #----------------------------------------------------------------------------
  # Initialization
  #  viewport - the viewport for the sprite
  #----------------------------------------------------------------------------
  def initialize(viewport = nil)
    # call superclass
    super
    # create bitmap
    self.bitmap = Bitmap.new(320, 32)
    # set font to bold
    self.bitmap.font.bold = true
    # decrease font size
    self.bitmap.font.size -= 8
    # set font color
    self.bitmap.font.color = system_color
    # set x and y position
    self.x, self.y, self.z = 160, 448, 1100
    @page = 1
    # skill IDs on hotkeys
    @skills = BlizzABS::Cache::EmptyKeys
    # item IDs on hotkeys
    @items = BlizzABS::Cache::EmptyKeys
    # update display
    update
  end
  #----------------------------------------------------------------------------
  # draw
  #  Draws the hotkey display.
  #----------------------------------------------------------------------------
  def draw(index = nil)
    # iterate through all hotkeys
    (index == nil ? BlizzABS::Cache::HotkeyRange : [index]).each {|i|
        # if hotkey is skill hotkey
        if $game_player.skill_hotkeys[i%10] != 0
          # temporary object
          object = $data_skills[$game_player.skill_hotkeys[i%10]]
        # if hotkey is item hotkey
        elsif $game_player.item_hotkeys[i%10] != 0
          # temporary object
          object = $data_items[$game_player.item_hotkeys[i%10]]
        end
        # if any change applied (10 is used for 0)
        if @items[i%10] != $game_player.item_hotkeys[i%10] ||
            @skills[i%10] != $game_player.skill_hotkeys[i%10]
          # remove this icon
          self.bitmap.fill_rect(32*(i-1), 0, 32, 32, Color.new(0, 0, 0, 0))
          # fill icon bachground
          self.bitmap.fill_rect(32*(i-1)+4, 4, 24, 24, Color.new(0, 0, 0, 128))
          # if object exists
          if object != nil
            # load bitmap
            bitmap = RPG::Cache.icon(object.icon_name)
            # draw bitmap
            self.bitmap.blt(32*(i-1)+4, 4, bitmap, Rect.new(0, 0, 24, 24))
          end
          # draw hotkey number
          self.bitmap.draw_text_full(32*(i-1), 10, 30, 32, (i%10).to_s, 2)
        end}
    # set new items
    @items = $game_player.item_hotkeys.clone
    # set new skills
    @skills = $game_player.skill_hotkeys.clone
  end
end

#==============================================================================
# Minimap
#------------------------------------------------------------------------------
#  This class creates and handels the minimap/fullscreen map display and is
#  more efficient than the Window class.
#  Changed to 6x6 tiles with rounded edges
#==============================================================================

class Minimap < Sprite
 
  # setting all accessible variables
  attr_reader :map_id
  #----------------------------------------------------------------------------
  # Initialization
  #----------------------------------------------------------------------------
  def initialize
    # call superclass method
    super(Viewport.new(520, 390, 120, 90))
    # get autotile image from Blizz-ABS Cache
    @autotile = minimap_autotile
    # creates the passable floor map
    create_passable_floor
    # set x and y position
    self.x, self.y = 0, 0
    # set z position
    viewport.z = 5000
    # store events
    @events, @names = check_events
    # create sprites for events
    create_sevents
    # set all sprites visible
    self.visible = true
  end
  #--------------------------------------------------------------------------
    # minimap_autotile
    #  Creates the minimap autotile for passability.
    #--------------------------------------------------------------------------
    def minimap_autotile
      b = Bitmap.new(18, 24)
      c1 = Color.new(191, 191, 191)
      c2 = Color.new(255, 255, 255)
      b.fill_rect(0, 0, 6, 6, c1)
      b.fill_rect(12, 0, 6, 6, c1)
      #bottom 3x3 square
      b.fill_rect(2, 8, 14, 14, c1)
      b.fill_rect(1, 10, 1, 10, c1)
      b.fill_rect(4, 7, 10, 1, c1)
      b.fill_rect(16, 10, 1, 10, c1)
      b.fill_rect(4, 22, 10, 1, c1)
      #highlight pixels
      b.fill_rect(4, 6, 10, 1, c2)
      b.fill_rect(14, 7, 2, 1, c2)
      b.fill_rect(16, 8, 1, 2, c2)
      b.fill_rect(17, 10, 1, 10, c2)
      b.fill_rect(16, 20, 1, 2, c2)
      b.fill_rect(14, 22, 2, 1, c2)
      b.fill_rect(4, 23, 10, 1, c2)
      b.fill_rect(2, 22, 2, 1, c2)
      b.fill_rect(1, 20, 1, 2, c2)
      b.fill_rect(0, 10, 1, 10, c2)
      b.fill_rect(1, 8, 1, 2, c2)
      b.fill_rect(2, 7, 2, 1, c2)
      return b
    end
  #----------------------------------------------------------------------------
  # create_passable_floor
  #  Creates the passable floor map on the bitmap.
  #----------------------------------------------------------------------------
  def create_passable_floor
    # delete bitmap if bitmap exists
    self.bitmap.dispose if self.bitmap != nil
    # store new map ID
    @map_id = $game_map.map_id
    # temporary width and height
    w, h = $game_map.width, $game_map.height
    # create bitmap
    self.bitmap = Bitmap.new(6*w, 6*h)
    # fill rectangle
    self.bitmap.fill_rect(0, 0, 6*w, 6*h, Color.new(0, 0, 0, 128))
    # get passability data
    v_map = $game_map.virtual_passability
    # iterate through all tiles
    (0...v_map.xsize).each {|x| (0...v_map.ysize).each {|y|
        # depending on passable direction, draw the path using the autotile
        case v_map[x, y]
        when 0x01 #    D
          self.bitmap.blt(x*6, y*6+3, @autotile, Rect.new(0, 0, 6, 3), 128)
        when 0x02 #   L
          self.bitmap.blt(x*6, y*6, @autotile, Rect.new(3, 0, 3, 6), 128)
        when 0x03 #   LD
          self.bitmap.blt(x*6, y*6, @autotile, Rect.new(12, 6, 6, 6), 128)
        when 0x04 #  R
          self.bitmap.blt(x*6+3, y*6, @autotile, Rect.new(0, 0, 3, 6), 128)
        when 0x05 #  R D
          self.bitmap.blt(x*6, y*6, @autotile, Rect.new(0, 6, 6, 6), 128)
        when 0x06 #  RL
          self.bitmap.blt(x*6, y*6, @autotile, Rect.new(6, 6, 6, 3), 128)
          self.bitmap.blt(x*6, y*6+3, @autotile, Rect.new(6, 21, 6, 3), 128)
        when 0x07 #  RLD
          self.bitmap.blt(x*6, y*6, @autotile, Rect.new(6, 6, 6, 6), 128)
        when 0x08 # U
          self.bitmap.blt(x*6, y*6, @autotile, Rect.new(0, 3, 6, 3), 128)
        when 0x09 # U  D
          self.bitmap.blt(x*6, y*6, @autotile, Rect.new(0, 12, 3, 6), 128)
          self.bitmap.blt(x*6+3, y*6, @autotile, Rect.new(15, 12, 3, 6), 128)
        when 0x0A # U L
          self.bitmap.blt(x*6, y*6, @autotile, Rect.new(12, 18, 6, 6), 128)
        when 0x0B # U LD
          self.bitmap.blt(x*6, y*6, @autotile, Rect.new(12, 12, 6, 6), 128)
        when 0x0C # UR
          self.bitmap.blt(x*6, y*6, @autotile, Rect.new(0, 18, 6, 6), 128)
        when 0x0D # UR D
          self.bitmap.blt(x*6, y*6, @autotile, Rect.new(0, 12, 6, 6), 128)
        when 0x0E # URL
          self.bitmap.blt(x*6, y*6, @autotile, Rect.new(6, 18, 6, 6), 128)
        when 0x0F # URLD
          self.bitmap.blt(x*6, y*6, @autotile, Rect.new(6, 12, 6, 6), 128)
        end}}
  end
  #----------------------------------------------------------------------------
  # update
  #  Updates the minimap and sprite movement on the minimap.
  #----------------------------------------------------------------------------
  def update(override = false)
    # creates the passable floor map if new map entered
    create_passable_floor if @map_id != $game_map.map_id
    # get events
    ev = check_events
    # if events or names changed
    if [@events, @names] != ev
      # store new events and names
      @events, @names = ev
      # delete sprites of events
      destroy_sevents
      # create sprites of events
      create_sevents
    end
    # if minimap not in fullscreen mode
    if $game_system.minimap < 2
      # set offset display
      self.ox, self.oy = $game_map.display_x * 6 / 128, $game_map.display_y * 6 / 128
    # if not pressed the turn button to scroll map around
    elsif !($game_system.turn_button && Input.press?(Input::Turn)) || override
      # if map can be scrolled horizontally
      if self.bitmap.width > 640
        # coordinate
        border = $game_player.real_x * 6 / 128 - 320
        # get right border
        border_x = self.bitmap.width - 640
        # set offset
        if border < 0
          self.ox = 0
        elsif border > border_x
          self.ox = border_x
        else
          self.ox = border
        end
      else
        # center map display horizontally
        self.ox = self.bitmap.width/2 - 320
      end
      # if map can be scrolled vertically
      if self.bitmap.height > 480
        # coordinate
        border = $game_player.real_y * 6 / 128 - 240
        # get lower border
        border_y = self.bitmap.height - 480
        # set offset
        if border < 0
          self.oy = 0
        elsif border > border_y
          self.oy = border_y
        else
          self.oy = border
        end
      else
        # center map display vertically
        self.oy = self.bitmap.height/2 - 240
      end
    end
    # iterate through all sprites
    @sevents.each_index {|i|
        # if minimap is not in fullscreen mode and within the range of ABSEAL
        if $game_system.minimap == 2 || @events[i].update?
          # set new coordinates
          @sevents[i].x = self.x + @events[i].real_x * 6 / 128
          @sevents[i].y = self.y + @events[i].real_y * 6 / 128
          # set offsets
          @sevents[i].ox, @sevents[i].oy = self.ox, self.oy
          # if event has a spriteset
          if @names[i] != '' && !@events[i].dropped &&
              (@events[i].is_a?(Map_Actor) ||
              !@events[i].name.clone.gsub!('\box') {''})
            # depending on the facing direction of the event
            @sevents[i].src_rect.set((@events[i].direction-2)*7, 0, 14, 14)
            # change offsets
            @sevents[i].ox += 3
            @sevents[i].oy += 3
          end
        end}
  end
  #----------------------------------------------------------------------------
  # create_sevents
  #  Creates for each event on the map a sprite on the minimap.
  #----------------------------------------------------------------------------
  def create_sevents
    # set empty array
    @sevents = []
    # ierate through all events on the minimap
    @events.each_index {|i|
        # create sprite
        sprite = Sprite.new(viewport)
        # temporary variable
        rect = Rect.new(0, 0, 56, 14)
        # if event is player
        if @events[i] == $game_player
          # if player has spriteset
          if @names[i] != ''
            # create bitmap
            sprite.bitmap = Bitmap.new(56, 14)
            # get green arrow
            sprite.bitmap.blt(0, 0, $BlizzABS.cache.image('green_arrow'), rect, 128)
          end
          # highest sprite
          sprite.z = 100
        # if event is actor
        elsif @events[i].is_a?(Map_Actor)
          # if actor has spriteset
          if @names[i] != ''
            # create bitmap
            sprite.bitmap = Bitmap.new(56, 14)
            # get blue arrow
            sprite.bitmap.blt(0, 0, $BlizzABS.cache.image('blue_arrow'), rect, 128)
          end
          # 2nd highest sprite
          sprite.z = 80
        # if event is enemy
        elsif @events[i].class == Map_Enemy
          # if event without spriteset or "boxdraw" enforcing
          if @names[i] == '' || @events[i].name.clone.gsub!('\box') {''}
            # create bitmap
            sprite.bitmap = Bitmap.new(6, 6)
            # fill rectangle with black color
            sprite.bitmap.fill_rect(0, 0, 6, 6, Color.new(0, 0, 0, 128))
            # fill rectangle with red color
            sprite.bitmap.fill_rect(1, 1, 4, 4, Color.new(255, 0, 0, 128))
          else
            # create bitmap
            sprite.bitmap = Bitmap.new(56, 14)
            # get red arrow
            sprite.bitmap.blt(0, 0, $BlizzABS.cache.image('red_arrow'), rect, 128)
          end
          # 5th highest sprite
          sprite.z = 50
        # if event is dropped item
        elsif @events[i].dropped
          # create bitmap
          sprite.bitmap = Bitmap.new(8, 8)
          # fill rectangle with black color
          sprite.bitmap.fill_rect(0, 0, 8, 8, Color.new(0, 0, 0, 128))
          # fill rectangle with cyan color
          sprite.bitmap.fill_rect(1, 1, 6, 6, Color.new(0, 255, 255, 128))
          # 3rd highest sprite
          sprite.z = 70
        # if event is normal event
        elsif @events[i].class == Game_Event
          # if event has spc command
          if @events[i].name.clone.gsub!('\spc') {''}
            # temporary variables, 4th highest sprite
            color, arrow, sprite.z = Color.new(255, 255, 0, 128), 'yellow_arrow', 60
          # if event code exists and te
          elsif @events[i].teleport
            # temporary variables, 6th highest sprite
            color, arrow, sprite.z = Color.new(128, 0, 255, 128), 'violet_arrow', 40
          end
          # if event without spriteset or "boxdraw" enforcing
          if @names[i] == '' || @events[i].name.clone.gsub!('\box') {''}
            # create bitmap
            sprite.bitmap = Bitmap.new(6, 6)
            # fill rectangle with black color
            sprite.bitmap.fill_rect(0, 0, 6, 6, Color.new(0, 0, 0, 128))
            # fill rectangle with yellow color
            sprite.bitmap.fill_rect(1, 1, 4, 4, color)
          else
            # create bitmap
            sprite.bitmap = Bitmap.new(56, 14)
            # get yellow or violet arrow
            sprite.bitmap.blt(0, 0, $BlizzABS.cache.image(arrow), rect, 128)
          end
        # if event without spriteset or "boxdraw" enforcing
        elsif @names[i] == '' || @events[i].name.clone.gsub!('\box') {''}
          # create bitmap
          sprite.bitmap = Bitmap.new(6, 6)
          # fill rectangle with black color
          sprite.bitmap.fill_rect(0, 0, 6, 6, Color.new(0, 0, 0, 128))
          # fill rectangle with default white color
          sprite.bitmap.fill_rect(1, 1, 4, 4, Color.new(255, 255, 255, 128))
        else
          # create bitmap
          sprite.bitmap = Bitmap.new(56, 14)
          # get white arrow
          sprite.bitmap.blt(0, 0, $BlizzABS.cache.image('white_arrow'), Rect.new(0, 0, 56, 14), 128)
        end
        # create a little dummy bitmap in case no bitmap was created before
        sprite.bitmap = Bitmap.new(1, 1) if sprite.bitmap == nil
        # get sprite out of map screen so ABSEAL can work correctly
        sprite.ox = sprite.oy = 64
        # if event has a spriteset
        if sprite.bitmap.width != 6
          # depending on the facing direction of the event
          sprite.src_rect.set((@events[i].direction-2)*7, 0, 14, 14)
        end
        # add sprite to array
        @sevents.push(sprite)}
      end
     
end


#==============================================================================
# Scene_Map
#------------------------------------------------------------------------------
#  This class was enhanced to support HUD control and creation system and
#  Blizz-ABS battle handling and level up text display.
#  Changed to enable the party hud
#==============================================================================

class Scene_Map
 
  #----------------------------------------------------------------------------
  # override main
  #----------------------------------------------------------------------------
  alias main_blizzabs_later_winkio main
  def main
    # create HUD if HUD is turned on and HUD active
    @hud = Hud.new if $game_system.hud
    @parhud = ParHud.new if $game_system.parhud
    # if HOTKEYS is turned on and assignment display active
    if $game_system.hotkeys
      # create assignment display
      @hotkeys = Hotkey_Assignment.new
    end
    # if MINIMAP is turned on and minimap active
    if $game_system.minimap > 0
      # create HUD
      @minimap = Minimap.new
    end
    # tests and sets the in_battle flag
    test_in_battle
    # call original method
    main_blizzabs_later
    # set in_battle flag
    $game_temp.in_battle = false
    # delete HUD elements that exist
    [@hud, @parhud, @hotkeys, @minimap].each {|s| s.dispose if s != nil}
  end
  #----------------------------------------------------------------------------
  # hud_update
  #  This method contains a couple of routine calls to handle with the HUD.
  #----------------------------------------------------------------------------
  def hud_update
    # check activation of HUD parts
    check_huds
    # update minimap
    update_minimap
    # update hotkey assignment display
    update_hotkeys
    # iterate through all the HUD sprites
    [@hud, @parhud, @minimap, @hotkeys].each {|s|
        # if sprite exists
        if s != nil
          # update sprite
          s.update
          # if player is on the same position as one of the sprites on the screen
          if $game_player.screen_x < s.vx + s.vw + 16 &&
              $game_player.screen_y < s.vy + s.vh + 48 &&
              $game_player.screen_x > s.vx && $game_player.screen_y > s.vy &&
              ((s == @minimap) ? ($game_system.minimap < 2) : true)
            # decrease opacity quickly if critical opacity not reached
            s.opacity -= 25 if s.opacity > 80
          # if not full opacity
          elsif s.opacity <= 255
            # increase opacity quickly if critical opacity not reached
            s.opacity += 25
          end
        end}
  end
  #----------------------------------------------------------------------------
  # check_huds
  #  This method handles enabling and disabling the HUD parts on the map.
  #----------------------------------------------------------------------------
  def check_huds
    # if minimap button is enabled and pressed
    if $game_system.minimap_button && Input.trigger?(Input::Minimap)
      # trigger minimap active
      $game_system.minimap = ($game_system.minimap + 1) % 2  #change123
    end
    # if hotkey display button is enabled and pressed
    if $game_system.hotkey_button && Input.trigger?(Input::Hotkey)
      # trigger hotkey display active
      $game_system.hotkeys = (!$game_system.hotkeys)
    end
    # if HUD button is enabled and pressed
    if $game_system.hud_button && Input.trigger?(Input::Hud)
      # trigger it active
      $game_system.hud = (!$game_system.hud)
      $game_system.parhud = (!$game_system.parhud)
    end
    # if minimap not active and minimap exists
    if $game_system.minimap == 0 && @minimap != nil
      # delete it
      @minimap.dispose
      @minimap = nil
    # if minimap is turned on and active and doesn't exist
    elsif BlizzABS::Config::MINIMAP && $game_system.minimap > 0
      # create it
      @minimap = Minimap.new if @minimap == nil
    end
    # if assignment display not active and exists
    if !$game_system.hotkeys && @hotkeys != nil
      # delete it
      @hotkeys.dispose
      @hotkeys = nil
    # if HOTKEYS is turned on and active and doesn't exist
    elsif BlizzABS::Config::HOTKEYS && $game_system.hotkeys
      # create it
      @hotkeys = Hotkey_Assignment.new if @hotkeys == nil
    end
    # if HUD not active and HUD exists
    if !$game_system.hud && @hud != nil
      # delete it
      @hud.dispose
      @hud = nil
      @parhud.dispose
      @parhud = nil
    # if HUD is turned on and HUD active and HUD doesn't exist
    elsif BlizzABS::Config::HUD_ENABLED && $game_system.hud
      # create it
      @hud = Hud.new if @hud == nil
      @parhud = ParHud.new if @parhud == nil
    end
  end
 
end
#==============================================================================
# Window_Skill_Hotkey
#------------------------------------------------------------------------------
#  This class serves as display for skills that can be hotkeyed.
#  Changed position to top of screen
#==============================================================================

class Window_Skill_Hotkey < Window_Skill
 
  #----------------------------------------------------------------------------
  # Initialization
  #  actor - actor
  #----------------------------------------------------------------------------
  def initialize(actor)
    # call superclass method
    super
    # set max column number
    @column_max = 1
    # set width and height
    self.width, self.height = 320, 416
    # set y and z position
    self.y, self.z = 0, 21000
    # remove cursor display
    self.cursor_rect.empty
    # set to not active
    self.active = false
    # refresh display
    refresh
  end
 
end

#==============================================================================
# Window_Item_Hotkey
#------------------------------------------------------------------------------
#  This class serves as display for items that can be hotkeyed.
#  Changed position to top of screen
#==============================================================================

class Window_Item_Hotkey < Window_Item
 
  #----------------------------------------------------------------------------
  # Initialization
  #  actor - actor
  #----------------------------------------------------------------------------
  def initialize
    # call superclass method
    super
    # set max column number
    @column_max = 1
    # set width and height
    self.width, self.height = 320, 416
    # set x, y and z position
    self.x, self.y, self.z = 320, 0, 21000
    # remove cursor display
    self.cursor_rect.empty
    # set to not active
    self.active = false
    # refresh display
    refresh
  end
 
end

#==============================================================================
# Scene_Hotkeys
#------------------------------------------------------------------------------
#  This class handles the skill/item hotkey processing.
#  The position of the arrow has been changed to the bottom of the screen.
#  Also included the upside down arrow.
#==============================================================================

class Scene_Hotkeys
 
  #----------------------------------------------------------------------------
  # main
  #  The main processing method.
  #----------------------------------------------------------------------------
  def main
    # create spriteset
    @spriteset = Spriteset_Map.new
    # create viewport
    @view = Viewport.new(0, 0, 640, 480)
    # set tone to current screen tone
    @view.tone = @tone.clone
    # create HUD if HUD is turned on and HUD active
    @hud = Hud.new if BlizzABS::Config::HUD_ENABLED && $game_system.hud
    # if ASSIGNMENT is turned
    if BlizzABS::Config::HOTKEYS
      # create assignment display
      @hotkeys = Hotkey_Assignment.new
      # set z position
      @hotkeys.z = 5000
    end
    # create sprite
    @choice = Sprite.new
    # create bitmap
    @choice.bitmap = menu_arrow
    # set x, y and z positions
    @choice.x, @choice.y, @choice.z, @choice.opacity = 160, 430, 500, 128
    # set x position offset
    @choice.ox = -8
    # set active flag
    @active = true
    # set index
    @index = 0
    # set up mode flag
    @up_mode = true
    # create modified skill window
    @skill_window = Window_Skill_Hotkey.new($game_player.battler)
    # create modified item window
    @item_window = Window_Item_Hotkey.new
    # set last active
    @last_active = true
    # transtition
    Graphics.transition
    # loop
    loop do
      # update game screen
      Graphics.update
      # update input
      Input.update
      # frame update
      update
      # stop if chosen an option
      break if $scene != self
    end
    # freeze screen
    Graphics.freeze
    # delet spriteset
    @spriteset.dispose
    # delete HUD elements that exist
    [@hud, @hotkeys, @minimap].each {|s| s.dispose if s != nil}
    # delete choice sprite
    @choice.dispose
    # delete skill window
    @skill_window.dispose
    # delete item window
    @item_window.dispose
    # delete viewport
    @view.dispose
  end
  #--------------------------------------------------------------------------
  # menu_arrow
  #  Creates the arrow displayed in the hotkey assignment menu.  Upside down
  #--------------------------------------------------------------------------
  def menu_arrow
    b = Bitmap.new(16, 9)
    c1 = Color.new(0, 0, 0)
    c2 = Color.new(255, 255, 255)
    c3 = Color.new(127, 127, 127)
    b.fill_rect(7, 8, 2, 1, c2)
    b.set_pixel(6, 7, c2)
    b.fill_rect(7, 7, 1, 7, c3)
    b.fill_rect(8, 7, 1, 7, c1)
    b.set_pixel(9, 7, c2)
    b.set_pixel(5, 6, c2)
    b.fill_rect(6, 6, 1, 6, c3)
    b.fill_rect(9, 6, 1, 6, c1)
    b.set_pixel(10, 6, c2)
    b.set_pixel(4, 5, c2)
    b.fill_rect(5, 5, 1, 5, c3)
    b.fill_rect(10, 5, 1, 5, c1)
    b.set_pixel(11, 5, c2)
    b.set_pixel(3, 4, c2)
    b.fill_rect(4, 4, 1, 4, c3)
    b.fill_rect(11, 4, 1, 4, c1)
    b.set_pixel(12, 4, c2)
    b.set_pixel(2, 3, c2)
    b.fill_rect(3, 3, 1, 3, c3)
    b.fill_rect(12, 3, 1, 3, c1)
    b.set_pixel(13, 3, c2)
    b.set_pixel(1, 2, c2)
    b.fill_rect(2, 2, 1, 2, c3)
    b.fill_rect(13, 2, 1, 2, c1)
    b.set_pixel(14, 2, c2)
    b.set_pixel(0, 1, c2)
    b.set_pixel(1, 1, c3)
    b.set_pixel(14, 1, c1)
    b.set_pixel(15, 1, c2)
    b.fill_rect(1, 0, 14, 1, c2)
    return b
  end
 
end
Title: Re: [XP] Custom Blizz-ABS HUD
Post by: RoseSkye on March 31, 2009, 08:24:53 pm
Yeah there is an error

Script 'HUD' line 470: NoMethodError occured

undefined method `/' for nil:NilClass
Title: Re: [XP] Custom Blizz-ABS HUD
Post by: Landith on March 31, 2009, 08:26:20 pm
You have it below Blizz-ABS Right..?
Title: Re: [XP] Custom Blizz-ABS HUD
Post by: RoseSkye on March 31, 2009, 08:30:32 pm
Actually I do.
Title: Re: [XP] Custom Blizz-ABS HUD
Post by: Landith on March 31, 2009, 08:39:45 pm
That's an odd error... >.<
Did you copy it all..?
Title: Re: [XP] Custom Blizz-ABS HUD
Post by: G_G on March 31, 2009, 08:40:47 pm
its cuz he probably has no members at the beginning of the game.
Title: Re: [XP] Custom Blizz-ABS HUD
Post by: Landith on March 31, 2009, 08:41:35 pm
Oh... Well I haven't tested it fully yet so yeah... xD
Title: Re: [XP] Custom Blizz-ABS HUD
Post by: RoseSkye on March 31, 2009, 08:42:00 pm
Yep. I get the error as soon as I equip an hotkey'd skill.

Btw its too laggy I can't use it.
Title: Re: [XP] Custom Blizz-ABS HUD
Post by: Landith on March 31, 2009, 08:45:23 pm
Odd, it doesn't happen for me.
What other scripts do you have..?
Title: Re: [XP] Custom Blizz-ABS HUD
Post by: G_G on March 31, 2009, 08:50:08 pm
It could be laggy due to alot of processes opened sucking too much memory.
Title: Re: [XP] Custom Blizz-ABS HUD
Post by: Landith on March 31, 2009, 08:50:57 pm
Okay yeah it does happen to me... Hold on I'll look into it

Okay, I got it to were it shows the SP cost of it but I can't figure out how to make it show the remaining skill usage...

Winkio, made this script work with DIRECT_HOTKEYS option on only... You can still use it with DIRECT_HOTKEYS off but it won't show the selected hotkeys. But once you add it, things change and it doesn't work >.<
Title: Re: [XP] Custom Blizz-ABS HUD
Post by: RoseSkye on March 31, 2009, 09:34:27 pm
:o sokay Landith I'll event around it. Thanks for caring enough to try to help me though.

Some say your heart grew three sizes today.
Title: Re: [XP] Custom Blizz-ABS HUD
Post by: winkio on June 30, 2009, 06:54:31 pm
I'm back for a little, so time to whip this back into shape.  Post any suggestions or comments.

need to:

update to be compatible with Bilzz-ABS 2.55
Add support for when there isn't direct hotkeys
optimize
make slightly more customizeable
Title: Re: [XP] Custom Blizz-ABS HUD
Post by: RoseSkye on July 02, 2009, 01:06:32 am
Quote from: winkio on June 30, 2009, 06:54:31 pm
I'm back for a little, so time to whip this back into shape.  Post any suggestions or comments.

need to:

update to be compatible with Bilzz-ABS 2.55
Add support for when there isn't direct hotkeys
optimize
make slightly more customizeable


Suggestions? Muhahahha... AHAHAHAHAHAHA!?!

*cough*

Sorry, old habits die hard. Yeah, I got a few.

Picture support in the Hud (Drawn Pictures of the character.)
Title: Re: [XP] Custom Blizz-ABS HUD
Post by: Blizzard on July 02, 2009, 04:42:27 am
You mean like facesets?
Title: Re: [XP] Custom Blizz-ABS HUD
Post by: winkio on July 02, 2009, 09:07:40 am
I see how that could be cool, but that would mess up the placements of the bars and everything else, and its really unnecessary, so I'm saying no. 
Title: Re: [XP] Custom Blizz-ABS HUD
Post by: Blizzard on July 02, 2009, 10:43:44 am
You could change the organization of the HUD a bit. If you remove the name and use the faceset instead and move a few thing it might just turn out fine. It's just a suggestion, though.
Title: Re: [XP] Custom Blizz-ABS HUD
Post by: winkio on July 02, 2009, 10:55:37 am
What size are these facesets? (I don't think I have any...)
Title: Re: [XP] Custom Blizz-ABS HUD
Post by: Blizzard on July 02, 2009, 10:58:19 am
I suggest 64x64 or 48x48. Small and still detailed enough.
Title: Re: [XP] Custom Blizz-ABS HUD
Post by: legacyblade on July 02, 2009, 01:20:36 pm
that would indeed be awesome. You could also allow for different facesets depending on the amount of health remaining, that is a commonly requested feature for the XAS hud.
Title: Re: [XP] Custom Blizz-ABS HUD
Post by: winkio on July 02, 2009, 01:41:57 pm
48x48 should be nice, because i wont have to move anything, just change spacing.

EDIT:  Wow, that was laughably easy.  I should stop being so lazy :^_^':

EDIT2:  Put the new version up.  I better not have to modify this again anytime soon...  Enjoy facesets, non-direct hotkeys support, and centered displays. :)
Title: Re: [XP] Custom Blizz-ABS HUD
Post by: RoseSkye on July 02, 2009, 07:32:38 pm
Oooh :O Sexy.
Title: Re: [XP] Custom Blizz-ABS HUD
Post by: G_G on July 02, 2009, 07:58:45 pm
anyway we can replace face set with the character graphic? Sorry to be a bother :(
Title: Re: [XP] Custom Blizz-ABS HUD
Post by: RoseSkye on July 02, 2009, 08:00:34 pm
Quote from: game_guy on July 02, 2009, 07:58:45 pm
anyway we can replace face set with the character graphic? Sorry to be a bother :(


(Yeah upload a frame from the charset and use it in place of the character picture)
Title: Re: [XP] Custom Blizz-ABS HUD
Post by: winkio on July 02, 2009, 08:09:44 pm
You can put anything you want instead of a faceset.  Just a 48x48 png file.
Title: Re: [XP] Custom Blizz-ABS HUD
Post by: legacyblade on July 02, 2009, 09:06:17 pm
Could you make this hud's HP bar change color based on the remaining HP like the default one? It makes it much easier to know when to heal when you see that the bar turns red or yellow.
Title: Re: [XP] Custom Blizz-ABS HUD
Post by: winkio on July 02, 2009, 09:33:26 pm
ill add it as another option.  Wait a little.

Okay, you can toggle it as an option in 1.21
Title: Re: [XP] Custom Blizz-ABS HUD
Post by: legacyblade on July 03, 2009, 12:03:02 am
sweet, love the option, but it causes a problem when activated (the color changing)

(http://i39.tinypic.com/2pobjpf.png)

that doesn't look yummy.

Aside from the bug report, I have a few feature suggestions.

1. Move the actor display down a bit. It looks sorta jammed against the top of the screen, particularly with the faceset enabled. Not too far, just 5-10 pixels should be good, I think.

2. Add in the option to display a picture behind each actor's display. This would add a good customization factor. Maybe allow pictures other places too. I say make it an option though, as some would want the less obtrusive hud design.

3. make map name optional. I have long map names to make it easier to manage the maps in my project

those are just my suggestions. love the hud.
Title: Re: [XP] Custom Blizz-ABS HUD
Post by: RoseSkye on July 03, 2009, 12:27:56 am
1. Its pretty obvious that the first bar is bigger than the second.
2. That isn't very smart. The bars aren't translucent.
3. I agree.
Title: Re: [XP] Custom Blizz-ABS HUD
Post by: winkio on July 03, 2009, 12:32:53 am
Yeah, my bad.  Somehow, that bar glitch didn't happen when I tested...

Anyways, built everything in as an option.  Updating now
Title: Re: [XP] Custom Blizz-ABS HUD
Post by: RoseSkye on July 03, 2009, 12:39:23 am
I love you winkio *giggles*
Title: Re: [XP] Custom Blizz-ABS HUD
Post by: legacyblade on July 03, 2009, 12:56:31 am
sweet, hud is awesome now. I am trying all the custom huds and suggesting features for each.
Title: Re: [XP] Custom Blizz-ABS HUD
Post by: RoseSkye on July 07, 2009, 05:12:42 pm
If anyone wants examples of the HUD in game.

Clicky here: ShowHide

(http://i2.photobucket.com/albums/y18/TokyoAngel/example.jpg)

(http://i2.photobucket.com/albums/y18/TokyoAngel/example2.jpg)
Title: Re: [XP] Custom Blizz-ABS HUD
Post by: Aqua on July 07, 2009, 05:34:34 pm
Looks niiiice
Fat shadows under the words/numbers though. D:
Title: Re: [XP] Custom Blizz-ABS HUD
Post by: winkio on July 07, 2009, 05:42:52 pm
Quote from: Aqua on July 07, 2009, 05:34:34 pm
Looks niiiice
Fat shadows under the words/numbers though. D:


I think that is tons, not the HUD.

Rose, do you mind me putting those in the first post?
Title: Re: [XP] Custom Blizz-ABS HUD
Post by: RoseSkye on July 07, 2009, 06:02:03 pm
Quote from: winkio on July 07, 2009, 05:42:52 pm
Quote from: Aqua on July 07, 2009, 05:34:34 pm
Looks niiiice
Fat shadows under the words/numbers though. D:


I think that is tons, not the HUD.

Rose, do you mind me putting those in the first post?


Go ahead. =o
Title: Re: [XP] Custom Blizz-ABS HUD
Post by: Blizzard on July 07, 2009, 07:13:08 pm
Quote from: winkio on July 07, 2009, 05:42:52 pm
Quote from: Aqua on July 07, 2009, 05:34:34 pm
Looks niiiice
Fat shadows under the words/numbers though. D:


I think that is tons, not the HUD.

Rose, do you mind me putting those in the first post?


You can use draw_shaded_text_later instead of draw_text to avoid double shadows. In fact you might wanna use draw_text_full (stupid method name for outlined text, I know) instead.
Title: Re: [XP] Custom Blizz-ABS HUD
Post by: ManiacClown on July 07, 2009, 09:50:25 pm
The hud is perfect but the Level hud is to ugly!
Title: Re: [XP] Custom Blizz-ABS HUD
Post by: RoseSkye on July 08, 2009, 04:51:16 am
Quote from: ManiacClown on July 07, 2009, 09:50:25 pm
The hud is perfect but the Level hud is to ugly!


I have shadow text enabled.. thats not how the numbers really look =/
Title: Re: [XP] Custom Blizz-ABS HUD
Post by: ManiacClown on July 08, 2009, 09:14:02 am
Is not that. The colors are too "dead"
And the division of map and gold can be:
            Gold: 10000
Map: The name of The Map
                                                                   Level 3 ExP: ||||||||||||| (can be number or porcentage)
Just an ideia ...
Title: Re: [XP] Custom Blizz-ABS HUD
Post by: winkio on July 08, 2009, 03:05:35 pm
Quote from: ManiacClown on July 08, 2009, 09:14:02 am
Is not that. The colors are too "dead"


neutral is the word that you are looking for.  These colors will fit in well with pretty much any game.

Quote from: ManiacClown on July 08, 2009, 09:14:02 am
And the division of map and gold can be:
            Gold: 10000
Map: The name of The Map


There is not enough room to center the gold.  It also looks much better if the gold display doesn't jump around as you spend money.

What's your idea for the exp?  I don't quite think that I got it...

I always appreciate suggestions, even if I reject them.  I might add an option so that you can pick your bar color and style in the future, though.

Title: Re: [XP] Custom Blizz-ABS HUD
Post by: Rose Guardian on July 15, 2009, 02:55:15 pm
This is a nice hud but when I try to disable it for my cut scenes I get this error Script"New Hud"1240:Nomethod Error occered.  Also the text box appears on top and I do not want the text box on top because I'm using Ccoa's UMS and I have the face graphics set to above for a reason.  How can I fix these two problem I really want to use this hud in my game. Please help.
Title: Re: [XP] Custom Blizz-ABS HUD
Post by: winkio on July 15, 2009, 03:45:51 pm
I'll look into the first problem.  How are you disabling the HUD?

The second problem doesn't seem to be related to this HUD, but to the UMS.  There is probably a command you can give it to display text boxes at the bottom.e
Title: Re: [XP] Custom Blizz-ABS HUD
Post by: Rose Guardian on July 15, 2009, 04:11:24 pm
I just put $game_system.hud = false in the call script box like all the previous versions of Blizz's ABS.  I deleted the UMS and I'm still getting the error when disabling the hud.
Title: Re: [XP] Custom Blizz-ABS HUD
Post by: winkio on July 15, 2009, 06:46:27 pm
Updated with the fix to the first problem.
Title: Re: [XP] Custom Blizz-ABS HUD
Post by: Rose Guardian on July 15, 2009, 07:15:19 pm
I hate to keep bothering you but I'm still getting the error when I disable the hud and I'm not using any other scripts except Blizz's ABS and I did not edit any of the scripts and I put it in the right place.
Title: Re: [XP] Custom Blizz-ABS HUD
Post by: winkio on July 15, 2009, 07:22:44 pm
Does it give you the same error when you just use the z key?

I did it both ways (by script and the z key) without any errors with just this and Blizz-ABS...
Title: Re: [XP] Custom Blizz-ABS HUD
Post by: Aqua on July 15, 2009, 07:44:38 pm
If you're doing it by script, did you seperate it into 2 lines?

(Hud method) = 
false
Title: Re: [XP] Custom Blizz-ABS HUD
Post by: Rose Guardian on July 15, 2009, 07:48:30 pm
Yes Aqua I did seprate it into two lines.
Title: Re: [XP] Custom Blizz-ABS HUD
Post by: winkio on July 15, 2009, 08:30:30 pm
As I said, it works for me.  Would somebody else mind testing this?  Or you could send me your Scripts.rxdata, Rose Guardian.
Title: Re: [XP] Custom Blizz-ABS HUD
Post by: Rose Guardian on July 15, 2009, 09:15:19 pm
This is the game I'm using the hud in. By the way it is not finished.  You'll notice the error happens right when you start the game.

http://www.filedropper.com/knightguard
Title: Re: [XP] Custom Blizz-ABS HUD
Post by: winkio on July 15, 2009, 09:26:38 pm
ohhh, I see what's happening.  the parhud (what I call the part at the top of the screen) doesn't load until the second frame of the game.  I fixed that now, so it will load at the beginning.  Updated the first post again.
Title: Re: [XP] Custom Blizz-ABS HUD
Post by: Rose Guardian on July 15, 2009, 09:41:26 pm
Thank you.  The error is finally gone! :)
Title: Re: [XP] Custom Blizz-ABS HUD
Post by: winkio on July 15, 2009, 11:15:18 pm
yeah, no problem.  I'm always happy to maintain my own scripts :)
Title: Re: [XP] Custom Blizz-ABS HUD
Post by: Epinaten on October 05, 2009, 04:30:11 am
I have a few problems with the script:

1. When I have the map name option turned on as true, it gives me the following error:
"Script 'Blizz-ABS Party HUD' line 77: NoMethodError occured.
Undefined method `[]' for nil:NilClass"

2. When I have the map name option turned off as false, and all the others on as true, it gives me the following error every time I change the leader to the 3rd actor:
"Script 'Blizz-ABS Party HUD' line 230: NoMethodError occured.
Undefined method `hp' for nil:NilClass"
I don't know if it has anything to do with it, but my third actor is a test actor with a hp value of 747 (I have not added anything special to the actor yet).

3. When I change the party leader to the second actor, the hp and sp changes in numbers.

4. When I change the party leader to the second actor, and then enter and exit the menu, the name and the hp and sp of all the party members are swapped - the names and hp and sp have changed order, but the pictures haven't.

5. It doesn't have the option to turn the minimap into fullscreen, like in the original blizz-abs script.

I hope you'll look at it, because besides the problems, its a great-looking script!
Title: Re: [XP] Custom Blizz-ABS HUD
Post by: Blizzard on October 05, 2009, 09:20:17 am
It's possible that the versions don't match of that the newest Blizz-ABS version isn't fully compatible with this version of the HUD (and winkio would need to edit it a bit). I suggest that you check the versions first.

Also, keep in mind that you shouldn't use the scripts with old save games that were created without them. Start a new game.
Title: Re: [XP] Custom Blizz-ABS HUD
Post by: winkio on October 05, 2009, 11:38:37 pm
I'll look into it...
Title: Re: [XP] Custom Blizz-ABS HUD
Post by: Epinaten on October 24, 2009, 10:41:18 am
Sorry for not responding earlier.

Blizzard: Thanks for the advice!

Winkio: Thanks! I'm looking forward to it!
Title: Re: [XP] Custom Blizz-ABS HUD
Post by: This Side Backwards on October 24, 2009, 12:57:43 pm
I'm having the same problem as Epinaten...

Where when switching through party members, only the HP SP bars swap positions but not the names (I'm not using any faces).
I've already tried starting a new game, but the same problem occurs again.
Any suggestions?

Thanks in advance!
Title: Re: [XP] Custom Blizz-ABS HUD
Post by: winkio on October 24, 2009, 01:03:37 pm
I'm actually fixing this right now.  The fixed version should be up in an hour.

EDIT:
Quote from: Epinaten on October 05, 2009, 04:30:11 am
I have a few problems with the script:

1. When I have the map name option turned on as true, it gives me the following error:
"Script 'Blizz-ABS Party HUD' line 77: NoMethodError occured.
Undefined method `[]' for nil:NilClass"

2. When I have the map name option turned off as false, and all the others on as true, it gives me the following error every time I change the leader to the 3rd actor:
"Script 'Blizz-ABS Party HUD' line 230: NoMethodError occured.
Undefined method `hp' for nil:NilClass"
I don't know if it has anything to do with it, but my third actor is a test actor with a hp value of 747 (I have not added anything special to the actor yet).

3. When I change the party leader to the second actor, the hp and sp changes in numbers.

4. When I change the party leader to the second actor, and then enter and exit the menu, the name and the hp and sp of all the party members are swapped - the names and hp and sp have changed order, but the pictures haven't.

5. It doesn't have the option to turn the minimap into fullscreen, like in the original blizz-abs script.

I hope you'll look at it, because besides the problems, its a great-looking script!


1.  This is most likely happening because you didn't start a new game.  If you want to use it with old save data, try running these lines in an event in game:

$map_infos = load_data('Data/MapInfos.rxdata')
$map_infos.keys.each {|key| $map_infos[key] = $map_infos[key].name}


If that doesn't work, then you will have to start a new game.  This is because it gets all the map names when you start a new file.

2,3,4.  All those were just because of one bug in the script.  It's now fixed.

5.  I took the option to make it fullscreen out because I was changing the size of the minimap tiles, and didn't want to deal with messing with fullscreen.  I added that option back in now.

For clarification, everything at the top of the screen is supposed to stay in the same place.

The new version is up.
Title: Re: [XP] Custom Blizz-ABS HUD
Post by: Epinaten on October 26, 2009, 03:28:06 am
It's a very nice and well-functioning update! Thanks!
However I have about 30 actors in my game - do you think it will be possible to have the support of more than 4 facesets in a future update (not at the same time, but changing - when adding/removing new party members - with the corresponding actor)?
Plus could it be possible to make a switch turn on/off the HUD (for for example cutscenes)?

Best wishes
Title: Re: [XP] Custom Blizz-ABS HUD
Post by: winkio on October 26, 2009, 11:14:27 am
turning the HUD off/on is already doable:

$game_system.hud = false


false for off, true for on, just run it in an event.

and I updated with the faceset fix - it was supposed to be actor ID in the first place.
Title: Re: [XP] Custom Blizz-ABS HUD
Post by: samwis3 on November 01, 2009, 03:40:59 am
Winkio I'm having a problem with this script.

The error is "Wrong # of arguments (4 for 3) on line 183 of the script.
This only happens when I try to use an image for bgtop.

Any reason why this is doing this and how I can fix?
Title: Re: [XP] Custom Blizz-ABS HUD
Post by: Blizzard on November 01, 2009, 05:22:10 am
You should post the script listing from your game. This could be an incompatibility problem.
Title: Re: [XP] Custom Blizz-ABS HUD
Post by: winkio on November 01, 2009, 10:39:45 am
No it is definitely my stupidity XD.

Change line 183 from:

self.bitmap.blt(0, 0, Rect.new(0, 0, 640, 50+PARHUD_CONFIG::TOPSPACE))

to

self.bitmap.blt(0, 0, bitmap, Rect.new(0, 0, 640, 50+PARHUD_CONFIG::TOPSPACE))
Title: Re: [XP] Custom Blizz-ABS HUD
Post by: Metaron on January 22, 2010, 04:21:11 pm
I've got a small issue, whenever I turn the Hud off, using:

$game_system.hud =
false

The hud won't come back on again when I call the script again and set it to true, except the map and the skill bar.
Title: Re: [XP] Custom Blizz-ABS HUD
Post by: winkio on January 22, 2010, 06:50:30 pm
$game_system.parhud =
true/false

call that as well, I did that so that you could show them independently.
Title: Re: [XP] Custom Blizz-ABS HUD
Post by: Metaron on January 22, 2010, 07:58:22 pm
Using $game_system.parhud = true/false doesn't seem to work either, at the moment i've got:

$game_system.hud =
false

$game_system.parhud =
false

At the beginning of the event and at the end to try and turn the HUD back on:

$game_system.hud =
true

$game_system.parhud =
true

And it still remains off at the end of the event.
Title: Re: [XP] Custom Blizz-ABS HUD
Post by: winkio on January 22, 2010, 11:26:56 pm
Hm, that's odd, I'll look into it.
Title: Re: [XP] Custom Blizz-ABS HUD
Post by: Metaron on January 23, 2010, 08:58:59 am
Nevermind  :^_^':, it's because I was using Blizz ABS 2.57 instead of the latest one, it works fine now.
Title: Re: [XP] Custom Blizz-ABS HUD
Post by: Eternal on February 01, 2010, 12:43:41 pm
straight up, i haven't read more than 5 of the comments, but would this be usable without Blizz ABS? For my new(est...) project, i'm thinking of (for once...) not using blizz abs, and this HUD quite frankly rocks.

Also, would it be possible to perhaps turn off everything except the pictures and health bars (why do i have a feeling it's answered in the first post...?)?


-Peace out
Title: Re: [XP] Custom Blizz-ABS HUD
Post by: legacyblade on February 01, 2010, 01:20:42 pm
I'm going to step out on a limb here and say no. It makes use of several classes added by blizzABS and just wouldn't work without it. But hey, maybe I'm wrong :P
Title: Re: [XP] Custom Blizz-ABS HUD
Post by: winkio on February 01, 2010, 01:31:26 pm
yeah, this is built off of Blizz-ABS, so it won't work with anything else without a decent amount of modifications.

To turn off everything except the top part, you are supposed to be able to just set the hud, hotkeys, and minimap variables to off and the parhud to on, but if I remember correctly, I made a mistake coding that little part (this was my first custom hud), so I will put up a fixed version in a day or two.
Title: Re: [XP] Custom Blizz-ABS HUD
Post by: Eternal on February 02, 2010, 04:20:24 am
well expect this to be in pretty much all of my blizz abs games from now on.

kinda embarrasing i didn't notice it earlier actually..
Title: Re: [XP] Custom Blizz-ABS HUD
Post by: ShinyToyGuns on February 15, 2010, 07:51:37 am
I've encountered a problem with this, and I don't know if it's something I'm doing wrong or what, but if I start the game with no actors, it gives a Blizz-ABS error.

The exact error is this:

(http://i924.photobucket.com/albums/ad83/ShinyToyGunsWeb/divide_by_zero.png)

And we all know that if you divide by zero, the space-time continuum gets all screwed up. :P

Please help me. I do not want the space-time continuum to be destroyed just yet ;)

PS ~ Here's my script order:
Spoiler: ShowHide
(http://i924.photobucket.com/albums/ad83/ShinyToyGunsWeb/script_order.png)
Title: Re: [XP] Custom Blizz-ABS HUD
Post by: Landith on February 15, 2010, 08:32:43 am
You could maybe add this line after it:

unless @psize = 0

Which will make it not return if there is no one in the party. But that might cause other issues.

But that might cause other problems with the script, idk...
(been like 6 months since I've scripted HUDs)

Might be a temp fix until Winkio gets on and finds out how to fix it.
Title: Re: [XP] Custom Blizz-ABS HUD
Post by: ShinyToyGuns on February 15, 2010, 08:38:04 am
That brings up a syntax error before I can even get to the title screen:
(http://i924.photobucket.com/albums/ad83/ShinyToyGunsWeb/syntax_error.png)
Title: Re: [XP] Custom Blizz-ABS HUD
Post by: winkio on February 15, 2010, 12:28:16 pm
I'll fix it later, but for now, you can just turn off the hud until you have a party.
Title: Re: [XP] Custom Blizz-ABS HUD
Post by: ShinyToyGuns on February 15, 2010, 12:56:41 pm
This is gonna sound stupid, but how do I turn off the hud?
Title: Re: [XP] Custom Blizz-ABS HUD
Post by: winkio on February 15, 2010, 01:02:21 pm
$game_system.hud = false
Title: Re: [XP] Custom Blizz-ABS HUD
Post by: ShinyToyGuns on February 15, 2010, 04:14:15 pm
Ok, I guess I'll just disable it until you can fix it :)
Title: Re: [XP] Custom Blizz-ABS HUD
Post by: winkio on February 15, 2010, 05:19:35 pm
Why do you even need the HUD on with an empty party?  Just curious
Title: Re: [XP] Custom Blizz-ABS HUD
Post by: Landith on February 15, 2010, 07:08:04 pm
Oh oops :huh:
Oh well I tried to help :^_^':
Title: Re: [XP] Custom Blizz-ABS HUD
Post by: element on February 16, 2010, 03:35:41 am
I really like to see the first 2 screenshots but I only see a red X
I do see the other 2  :^_^':
Title: Re: [XP] Custom Blizz-ABS HUD
Post by: ShinyToyGuns on February 16, 2010, 09:47:40 am
Quote from: winkio on February 15, 2010, 05:19:35 pm
Why do you even need the HUD on with an empty party?  Just curious

It's only an empty party at the start of the game...The player gets to choose their race/class, and then they're assigned a character based on that. I want a good looking HUD (which is why I want this fixed) once they choose a character, but atm, only the title screen loads...once you choose "New Game" with this script in the database, it gives an error. :(
Title: Re: [XP] Custom Blizz-ABS HUD
Post by: winkio on February 16, 2010, 11:48:16 am
Oh, if you just want it off at the start of the game, find this part near the top:

  def initialize
    @parhud = true
    initialize_parhud_later
  end

and change it to this:

  def initialize
    @parhud = false
    initialize_parhud_later
    @hud = false
  end

Then you can turn it on again at will.
Title: Re: [XP] Custom Blizz-ABS HUD
Post by: ShinyToyGuns on February 16, 2010, 02:04:50 pm
Oh wow...I feel pretty stupid now  :^_^':
Thanks for the help :)
Title: Re: [XP] Custom Blizz-ABS HUD
Post by: Alton Wyte on February 16, 2010, 07:40:28 pm
Don't feel stupid for not knowing that, there's not way you could have. By the way, great job winkio! If my current game was using Blizz-ABS, I would definately use it. Buut the side-view fits my game. Maybe next time I will.
Title: Re: [XP] Custom Blizz-ABS HUD
Post by: Metaron on July 25, 2010, 06:33:34 am
Hey, I get a small error when turning CENTER_DISPLAY =  false and adding 4 members into the party, this error shows up:

(http://img190.imageshack.us/img190/9009/errorng.png)

It works fine when center display is set to true.
Title: Re: [XP] Custom Blizz-ABS HUD
Post by: Memor-X on November 20, 2010, 05:28:12 am
i'm getting a bit of a problem with the hud, my problem is kinda unique cause i doun't think any would be doing the same as me

in my game, when it starts it goes though a loading screen then it runs a Scene_Title script which override the original so instead of the menu i start with a map, anyway, before i added this hud (so i was using the original Hud in Blizz-ABS) i had script call in the Scene_Title override that hid the hud (because there is a player on the map but they have no sprite), that worked, when i added this hud in, when i started the game the character that was on the map, their hud showed up, what's strange is that the gold/exp part of the hud didn't, i enabled the hud key and pressed it during the cutscene i have on that map, the gold/exp display showed up, when i pressed it again, the whole hud disappeared.

to simplify that, i'm getting the character hp/sp part of the hud when it's supposed to be hidden, here's a screenshot
Spoiler: ShowHide
(http://i76.photobucket.com/albums/j14/Memor-X/image.png)

see what i mean, i get the gold/exp part if i remove the the $game_system.hud = false line but when it's in there i get what's above, any idea how to get rid of it?
Title: Re: [XP] Custom Blizz-ABS HUD
Post by: winkio on November 20, 2010, 03:06:53 pm
@Metaron: Make sure that in the Blizz-ABS config, your MAX_PARTY is set to the maximum number of actors you will have at once.
@Memor-X:  $game_system.parhud = false
Title: Re: [XP] Custom Blizz-ABS HUD
Post by: megaman30796 on December 27, 2010, 09:35:24 am
winkio, i have a problem.......the script crashes when i try 2 turn on the minimap.
it says:

script 'custom hud' line 1076: NoMethodError occured
undefined method 'dropped' for #<Game_Event:0x40d88a0>
Title: Re: [XP] Custom Blizz-ABS HUD
Post by: danesopeezy89 on January 02, 2011, 06:05:34 pm
hi, i just wanted to know, how do you disable the hud for a cut scene?
Title: Re: [XP] Custom Blizz-ABS HUD
Post by: WhiteRose on January 02, 2011, 06:18:27 pm
Quote from: danesopeezy89 on January 02, 2011, 06:05:34 pm
hi, i just wanted to know, how do you disable the hud for a cut scene?


Just paste this in a script call. It'll hide the HUD, the hotkeys, and the minimap.


$game_system.hud = false
$game_system.hotkeys = false
$game_system.minimap = 0
Title: Re: [XP] Custom Blizz-ABS HUD
Post by: danesopeezy89 on January 02, 2011, 06:24:36 pm
Thanks a lot  :haha:

Well it disabled everything but hud
Title: Re: [XP] Custom Blizz-ABS HUD
Post by: WhiteRose on January 02, 2011, 06:50:35 pm
Quote from: danesopeezy89 on January 02, 2011, 06:24:36 pm
Thanks a lot  :haha:

Well it disabled everything but hud


Hmm, that's odd; it's always worked for me. It might be a compatibility issue with Winkio's HUD, though I'd have thought that it would be compatible with the default Blizz-ABS commands.
Title: Re: [XP] Custom Blizz-ABS HUD
Post by: winkio on January 02, 2011, 08:08:16 pm
man, i'm getting tired of posting this every page.


$game_system.parhud = false


EDIT: Ironically, all you had to do was scroll to the top of this page.  But I put it on the first post now, so there should be no more confusion.
Title: Re: [XP] Custom Blizz-ABS HUD
Post by: WhiteRose on January 02, 2011, 08:49:19 pm
Sorry, wink. I should have known better. D:
Out of curiosity, why didn't you just make it use the default Blizz-ABS commands?
Title: Re: [XP] Custom Blizz-ABS HUD
Post by: winkio on January 02, 2011, 08:51:21 pm
because it's a separate display.  What if you only wanted to turn that part off or on?
Title: Re: [XP] Custom Blizz-ABS HUD
Post by: RoseSkye on January 19, 2011, 10:49:22 am
I'm editing your HUD a bit and I've run into a bit of a snag.

1. How do I remove the white borders around the hp/sp bars? (They ruin my bg graphic by being transparent and showing through to the map)
2. How do I ignore game_party.actors[0] and make it just show party members 1 - 4. I want it to act like a party HUD instead of an HUD that includes party members.
Title: Re: [XP] Custom Blizz-ABS HUD
Post by: winkio on January 19, 2011, 03:02:00 pm
1.  Under draw_basic is where the outlines are drawn (lines 190-191 for example).  Just change them to match the size of the actual bars (should be 100x12), and add 1 to the x and y position.
2.  Pretty much any time you see (0...@psize).each, replace with (1...@psize)each.  You will have to change a few things in the create_positions methods too to keep it centered.
Title: Re: [XP] Custom Blizz-ABS HUD
Post by: RoseSkye on January 19, 2011, 03:15:48 pm
It errors out now. 190 'no implicit conversion nil to integer'.
Title: Re: [XP] Custom Blizz-ABS HUD
Post by: winkio on January 19, 2011, 03:21:25 pm
yeah, probably because there isn't a second party member.  just surround with
if @psize > 1
CODE HERE
end
Title: Re: [XP] Custom Blizz-ABS HUD
Post by: RoseSkye on January 19, 2011, 03:24:31 pm
Same Error. I placed it on line 187 and on line 203.
if @psize > 1
   if color.is_a?(Color)
     (1...@psize).each {|i|
       # draw outlines in color
       self.bitmap.fill_rect(@hp_x[i], @hp_y[i], 102, 14, color)
       self.bitmap.fill_rect(@sp_x[i], @sp_y[i], 102, 14, color)
       # draw actor's names and faces
       self.bitmap.draw_text_full(@name_x[i], @name_y[i], 104, 20, actor(i).name, 1)
       if PARHUD_CONFIG::FACESETS
         self.bitmap.fill_rect(@face_x[i], @face_y[i], 50, 50, color)
         # load bitmap
         bitmap = RPG::Cache.picture("actor"+actor(i).id.to_s+".png")
         # draw bitmap
         self.bitmap.blt(@face_x[i]+1, @face_y[i]+1, bitmap, Rect.new(0, 0, 48, 48))
       end
       }
     end
   end
end

I also tried to isolate that one line and it errored out as soon as it started with a syntax error. I'm sure the syntax error came from two cases of psize... but I'm still learning so I wouldn't trust my own word.
Title: Re: [XP] Custom Blizz-ABS HUD
Post by: nathmatt on January 19, 2011, 05:34:27 pm
is that the end of a def because after realigning the code im finding 1 end to many

if @psize > 1
  if color.is_a?(Color)
    (1...@psize).each {|i|
    # draw outlines in color
    self.bitmap.fill_rect(@hp_x[i], @hp_y[i], 102, 14, color)
    self.bitmap.fill_rect(@sp_x[i], @sp_y[i], 102, 14, color)
    # draw actor's names and faces
    self.bitmap.draw_text_full(@name_x[i], @name_y[i], 104, 20, actor(i).name, 1)
    if PARHUD_CONFIG::FACESETS
      self.bitmap.fill_rect(@face_x[i], @face_y[i], 50, 50, color)
      # load bitmap
      bitmap = RPG::Cache.picture("actor"+actor(i).id.to_s+".png")
      # draw bitmap
      self.bitmap.blt(@face_x[i]+1, @face_y[i]+1, bitmap, Rect.new(0, 0, 48, 48))
    end}
  end
end
Title: Re: [XP] Custom Blizz-ABS HUD
Post by: winkio on January 19, 2011, 07:09:45 pm
Now you need to replace all the array indicies with i-1 instead of i, because they don't have the player element anymore.
Title: Re: [XP] Custom Blizz-ABS HUD
Post by: RoseSkye on January 19, 2011, 09:09:44 pm
Quote from: winkio on January 19, 2011, 07:09:45 pm
Now you need to replace all the array indicies with i-1 instead of i, because they don't have the player element anymore.


All with [i-1]? Every one in the script? I can do it but I want you to be positive it'll work because it'd be a bitch to revert.
Title: Re: [XP] Custom Blizz-ABS HUD
Post by: winkio on January 19, 2011, 11:02:15 pm
Just inside Parhud, not the whole script.
Title: Re: [XP] Custom Blizz-ABS HUD
Post by: RoseSkye on January 20, 2011, 04:21:23 pm
Okay what do I change to alter the face positions and such?
Title: Re: [XP] Custom Blizz-ABS HUD
Post by: Boba Fett Link on August 30, 2011, 06:22:53 pm
I have a question. Can you make it so that you don't have to have the character with ID 1 in the party at all times?
Title: Re: [XP] Custom Blizz-ABS HUD
Post by: Stray on September 08, 2011, 08:01:55 am
Not compatible with "Growing Stats" and "Journal" Script.
Spoiler: ShowHide
(http://www9.picfront.org/token/qxDt/2011/09/08/1988882.png)

Title: Re: [XP] Custom Blizz-ABS HUD
Post by: Blizzard on December 09, 2011, 05:25:59 am
After a quick run through the code, I can see that it's based on the HUD subsystem that I provided in Blizz-ABS. So sadly no, this won't work out of the box without Blizz-ABS. Editing the script to work without Blizz-ABS isn't a simple or quick job either.
Title: Re: [XP] Custom Blizz-ABS HUD
Post by: Xsyiaris on February 02, 2012, 02:21:46 pm
Sorry for asking but the script

$game_system.parhud = false


Is not working, i added it as an even made it a process and its not working.

Help?
Title: Re: [XP] Custom Blizz-ABS HUD
Post by: athreus on July 29, 2012, 09:36:50 am
Quote from: megaman30796 on December 27, 2010, 09:35:24 am
winkio, i have a problem.......the script crashes when i try 2 turn on the minimap.
it says:

script 'custom hud' line 1076: NoMethodError occured
undefined method 'dropped' for #<Game_Event:0x40d88a0>


I have the same problem. how i can resolve it? I use Blizz-Abs Version 2.84.
Ty!
Title: Re: [XP] Custom Blizz-ABS HUD
Post by: andyrew004 on February 02, 2013, 01:44:56 pm
Quote from: Xsyiaris on February 02, 2012, 02:21:46 pm
Sorry for asking but the script

$game_system.parhud = false


Is not working, i added it as an even made it a process and its not working.

Help?


I know that it is usually not correct forum etiquette to resurrect and old topic, but I am using this script and am having a similar error.

I only have Blizz ABS, this addon (below Blizz ABS), and Advanced Message System 4 (above Blizz ABS) and during the intro of the game, I attempt to hide the hud by calling the script:
$game_system.parhud = false


It is an autorun event and with that code, nothing happens and the events don't start to take place.

Using this worked to get rid of the hud:
$game_system.hud= false
$game_system.hotkeys= false
$game_system.minimap= 0


But I was unable to bring the hud back with:
$game_system.hud= true
$game_system.hotkeys= true
$game_system.minimap= 1


or

$game_system.parhud = true


Any idea on how I could fix this issue? Thank you.
Title: Re: [XP] Custom Blizz-ABS HUD
Post by: Blizzard on February 02, 2013, 01:53:44 pm
RMXP has a bug in script calls if there is only one line. Either break them up into 2 lines like this:

$game_system.parhud =
true


Or get the Interpreter fix: http://forum.chaos-project.com/index.php/topic,938.0.html
Title: Re: [XP] Custom Blizz-ABS HUD
Post by: andyrew004 on February 02, 2013, 02:10:01 pm
Quote from: Blizzard on February 02, 2013, 01:53:44 pm
RMXP has a bug in script calls if there is only one line. Either break them up into 2 lines like this:

$game_system.parhud =
true


Or get the Interpreter fix: http://forum.chaos-project.com/index.php/topic,938.0.html


Wow, thank you! I assume that this code goes above the Blizz ABS Part 1 script?
Title: Re: [XP] Custom Blizz-ABS HUD
Post by: Blizzard on February 02, 2013, 02:39:22 pm
You can add that script wherever you want, only make sure it's below the default scripts and above Main.
Title: Re: [XP] Custom Blizz-ABS HUD
Post by: andyrew004 on February 02, 2013, 06:37:38 pm
Quote from: athreus on July 29, 2012, 09:36:50 am
Quote from: megaman30796 on December 27, 2010, 09:35:24 am
winkio, i have a problem.......the script crashes when i try 2 turn on the minimap.
it says:

script 'custom hud' line 1076: NoMethodError occured
undefined method 'dropped' for #<Game_Event:0x40d88a0>


I have the same problem. how i can resolve it? I use Blizz-Abs Version 2.84.
Ty!


I also get an error when I try to toggle the Minimap.

My error says:

"Script 'Group HUD' Line 1076: NoMethodError occurred.
undefined method 'dropped' for #<Game_Event:0x88d7768>"
Title: Re: [XP] Custom Blizz-ABS HUD
Post by: KK20 on February 02, 2013, 07:23:32 pm
Typo I think. Locate this on line 1011
          if @names[i] != '' && !@events[i].dropped &&

And put a ? after dropped.
          if @names[i] != '' && !@events[i].dropped? &&


Do the exact same thing on line 1076
        elsif @events[i].dropped
Title: Re: [XP] Custom Blizz-ABS HUD
Post by: andyrew004 on February 03, 2013, 02:20:06 am
Quote from: KK20 on February 02, 2013, 07:23:32 pm
Typo I think. Locate this on line 1011
          if @names[i] != '' && !@events[i].dropped &&

And put a ? after dropped.
          if @names[i] != '' && !@events[i].dropped? &&


Do the exact same thing on line 1076
        elsif @events[i].dropped



Yep, that solved it. Thank you very much!