#==============================================================================
# Simple Gold Hud
# Author: XAIL
# Created: 06/06/2011
# Edited: 01/04/2012
# Version: 1.0b
#==============================================================================
# Instructions
# -----------------------------------------------------------------------------
# To install this script, open up your script editor and copy/paste this script
# to an open slot below ▼ Materials but above ▼ Main. Remember to save.
#
# *** Only for RPG Maker VX Ace. ***
#==============================================================================
($imported ||= {})["XAIL-SIMPLE-GOLD-HUD"] = true
# Count timer for updating the gold.
GOLD_COUNT_WAIT = 4
# The time lapse between gold count changing.
GOLD_CHANGING = 1
end
end
# *** Don't edit below unless you know what you are doing. ***
#==============================================================================#
# ** Window_Gold_Hud
#------------------------------------------------------------------------------
# Class for drawing the gold.
#==============================================================================#
class Window_Gold_Hud < Window_Base
def initialize
# // Method to initialize the gold window.
super(0, 0, window_width, fitting_height(1))
@last_gold = $game_party.gold
@wait_period = XAIL::GOLD::GOLD_COUNT_WAIT
refresh
end
def window_width
# // Method to return the width.
return XAIL::GOLD::WINDOW[0]
end
def draw_gold(value, unit, x, y, width)
# // Method to draw the gold.
cx = text_size(unit).width
contents.font = Font.new(XAIL::GOLD::FONT[0], XAIL::GOLD::FONT[1])
contents.font.color = XAIL::GOLD::FONT[2]
contents.font.bold = XAIL::GOLD::FONT[3]
contents.font.shadow = XAIL::GOLD::FONT[4]
# // Draw gold.
draw_text(x, y, width - cx - 2, line_height, value, 2)
# // Draw vocab.
draw_text(x, y, width, line_height, unit, 2) if XAIL::GOLD::GOLD[3]
reset_font_settings
end
def refresh
# // Method to refresh the gold.
contents.clear
if $game_switches[XAIL::GOLD::GOLD[4]]
draw_gold($game_party.gold, Vocab::currency_unit, -10, 0, contents.width - 8)
else
draw_gold(@last_gold, Vocab::currency_unit, -10, 0, contents.width - 8)
end
draw_icon(XAIL::GOLD::GOLD[0], 100, -2) if XAIL::GOLD::GOLD[2]
end
def update
# // Method to update the gold.
super
@wait_period -= 1 if @wait_period != 0
if @last_gold != $game_party.gold and @wait_period == 0
if @last_gold < $game_party.gold
@last_gold += 1
else
@last_gold -= 1
end
if self.visible
RPG::SE.new(XAIL::GOLD::GOLD_COUNT[0], XAIL::GOLD::GOLD_COUNT[1], XAIL::GOLD::GOLD_COUNT[2]).play if XAIL::GOLD::GOLD_COUNT[3]
end
refresh
@wait_period = XAIL::GOLD::GOLD_CHANGING
end
end
end
#==============================================================================
# ** Scene_Map
#------------------------------------------------------------------------------
# Show gold window on the map.
#==============================================================================
class Scene_Map < Scene_Base
alias xail_gold_window_start start unless $@
def start(*args, &block)
# // Method to start the gold window on the map.
xail_gold_window_start(*args, &block)
create_gold_window
@gold_window.visible = $game_switches[XAIL::GOLD::GOLD[1]]
end
alias xail_gold_window_terminate terminate unless $@
def terminate(*args, &block)
# // Method to terminate the gold window on the map.
xail_gold_window_terminate(*args, &block)
dispose_gold_window
end
def dispose_gold_window
# // Method to dispose the gold window.
@gold_window.dispose unless @gold_window.nil?
@gold_window = nil
end
alias xail_gold_window_update update unless $@
def update(*args, &block)
# // Method to update the gold window on the map.
xail_gold_window_update(*args, &block)
@gold_window.update
@gold_window.visible = $game_switches[XAIL::GOLD::GOLD[1]]
end
end # END OF FILE
#=*==========================================================================*=#
# ** END OF FILE
#=*==========================================================================*=#
Nie możesz pisać nowych tematów Nie możesz odpowiadać w tematach Nie możesz zmieniać swoich postów Nie możesz usuwać swoich postów Nie możesz głosować w ankietach Nie możesz załączać plików na tym forum Możesz ściągać załączniki na tym forum