You have friends in heart places.
If there is anything you want changed or if something doesn't work, just post and I will try to fix it.
#==============================================================================
# Zeichwolf HUD
# Version: 1.0
# Author: modern algebra
# Date: February 15, 2009
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
# Description:
# A simple HUD that just shows the HP of the lead actor.
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
# Instructions:
# Paste this script above Main and below Materials in the Script Editor (F11)
#
# To toggle the HUD on and off, you can use the call script:
# toggle_hud (x)
#
# where x is either true or false, where true means the HUD will be shown
# and false means it won't be. If you do not give any argument, it will just
# toggle the visibility of the HUD, i.e. turn it on if it is off and off it
# is on.
#==============================================================================
#==============================================================================
# ** Game Actor
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
# Summary of Changes:
# aliased method - hp=
#==============================================================================
class Game_Actor
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# * Change HP
# hp : new HP
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
alias modalg_zeichwof_hudsply_hpequals_64b6 hp=
def hp=(hp)
# Run Original Method
modalg_zeichwof_hudsply_hpequals_64b6 (hp)
# If HUD showing self and scene is map
$scene.refresh_zhud if $game_party.members[0] == self && $scene.is_a? (Scene_Map)
end
end
#==============================================================================
# ** Game_System
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
# Summary of Changes:
# new instance variable - zhud_visible
# aliased method - initialize
#==============================================================================
class Game_System
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# * Public Instance Variables
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
attr_accessor :zhud_visible # Boolean determining whether to show HUD or not
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# * Object Initialization
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
alias malg_zeichwolf_init_simp_hud_85h6 initialize
def initialize
# Run Original Method
malg_zeichwolf_init_simp_hud_85h6
# Initialize new variable
@zhud_visible = true
end
end
#==============================================================================
# ** Game_Interpreter
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
# Summary of Changes:
# new method - toggle_hud
#==============================================================================
class Game_Interpreter
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# * Toggle HUD
# boolean : if desired, set directly to a value
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
def toggle_hud (boolean = nil)
$game_system.zhud_visible = boolean == nil ? !$game_system.zhud_visible : boolean
$scene.refresh_zhud if $scene.is_a? (Scene_Map)
end
end
#==============================================================================
# ** Window_ZHUD
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
# This window shows a simply HP display
#==============================================================================
class Window_ZHUD < Window_Base
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# * Object Initialization
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
def initialize
# Run Super method
super (384, 0, 160, 32 + WLH)
self.opacity = 160
refresh
end
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# * Refresh
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
def refresh
self.contents.clear
# Set visibility
self.visible = $game_system.zhud_visible
# Do not draw anything if no actors are in the party
return if $game_party.members.size < 1
# Draw HP of lead party member
draw_actor_hp ($game_party.members[0], 0, 0, 128)
end
end
#==============================================================================
# ** Scene Map
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
# Summary of Changes:
# aliased methods - start, terminate
# new methods - refresh_ZHUD
#==============================================================================
class Scene_Map
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# * Start
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
alias mornbra_zeic_hud_strt_6w52d start
def start
# Run Original Method
mornbra_zeic_hud_strt_6w52d
# Create ZHUD window
@zhud_window = Window_ZHUD.new
end
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# * Terminate
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
alias malg_zechwlf_hedsupdply_trmnte_1hb5 terminate
def terminate
# Dispose of HUD window
@zhud_window.dispose
# Run Original Method
malg_zechwlf_hedsupdply_trmnte_1hb5
end
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# * Refresh ZHUD
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
def refresh_zhud
return if @zhud_window.disposed? || @zhud_window == nil
@zhud_window.refresh
end
end
I kind of actually posted this yesterday by editing my first post, but I just realized today that you had posted before then so you probably never saw it so I am posting it again.