my question is how I can update the texts that display the time and pokeballs
because to update the texts I have to enter to a house
here is the script
because to update the texts I have to enter to a house
here is the script
Spoiler:
#===============================================================================
# * Simple HUD - by FL (Credits will be apreciated)
#===============================================================================
#
# This script is for Pokémon Essentials. It displays a simple HUD with the
# party icons and some small text.
#
#===============================================================================
#
# To this script works, put it above main.
#
#===============================================================================
class Spriteset_Map
USEBAR=true # Make as 'false' to don't show the blue bar
DRAWATBOTTOM=true # Make as 'true' to draw the HUD at bottom
UPDATESPERSECONDS=0.25 # More updates = more lag
alias :initializeoldFL :initialize
alias :disposeoldFL :dispose
alias :updateoldFL :update
def initialize(map=nil)
#------------------------------------------------------
t = Time.now
@time = t.strftime("%I:%M %p")
@date = t.strftime("%m/%d/%y")
#-----------------------------------------------------
@ball=$PokemonBag.pbQuantity(PBItems::POKEBALL) +
$PokemonBag.pbQuantity(PBItems::GREATBALL) +
$PokemonBag.pbQuantity(PBItems::SAFARIBALL) +
$PokemonBag.pbQuantity(PBItems::ULTRABALL) +
$PokemonBag.pbQuantity(PBItems::MASTERBALL) +
$PokemonBag.pbQuantity(PBItems::NETBALL) +
$PokemonBag.pbQuantity(PBItems::DIVEBALL) +
$PokemonBag.pbQuantity(PBItems::NESTBALL) +
$PokemonBag.pbQuantity(PBItems::REPEATBALL) +
$PokemonBag.pbQuantity(PBItems::TIMERBALL) +
$PokemonBag.pbQuantity(PBItems::LUXURYBALL) +
$PokemonBag.pbQuantity(PBItems::PREMIERBALL) +
$PokemonBag.pbQuantity(PBItems::DUSKBALL) +
$PokemonBag.pbQuantity(PBItems::HEALBALL) +
$PokemonBag.pbQuantity(PBItems::QUICKBALL) +
$PokemonBag.pbQuantity(PBItems::CHERISHBALL) +
$PokemonBag.pbQuantity(PBItems::FASTBALL) +
$PokemonBag.pbQuantity(PBItems::LEVELBALL) +
$PokemonBag.pbQuantity(PBItems::LUREBALL) +
$PokemonBag.pbQuantity(PBItems::HEAVYBALL) +
$PokemonBag.pbQuantity(PBItems::LOVEBALL) +
$PokemonBag.pbQuantity(PBItems::FRIENDBALL) +
$PokemonBag.pbQuantity(PBItems::MOONBALL) +
$PokemonBag.pbQuantity(PBItems::SPORTBALL)
#-----------------------------------------------------
@hud = []
@updateRate = (UPDATESPERSECONDS>0) ?
(Graphics.frame_rate/UPDATESPERSECONDS).floor : 0x3FFF
initializeoldFL(map)
createHud
end
def dispose
disposeoldFL
disposeHud
end
def update
updateoldFL
updateHud
end
def createHud
return if !$Trainer # Don't draw the hud if the player wasn't defined
yposition = DRAWATBOTTOM ? Graphics.height-64 : 0
@hud = []
if USEBAR # Draw the blue bar
bar=IconSprite.new(0,yposition,@viewport1)
bar.x = 0
bar.y = 319
bar.z = 0
bar.opacity = 90
bar.bitmap = RPG::Cache.picture("bar2")
bar1=IconSprite.new(0,yposition,@viewport1)
bar1.x = 0
bar1.y = 319
bar1.z = 0
bar1.bitmap = RPG::Cache.picture("bar1")
ball=IconSprite.new(0,yposition,@viewport1)
ball.x = 444
ball.y = 328
ball.z = 0
ball.bitmap = RPG::Cache.icon("pokeb")
@hud.push(bar)
@hud.push(bar1)
@hud.push(ball)
end
# Draw the text
baseColor=Color.new(00,102,255)
shadowColor=Color.new(14,16,18)
@hud.push(BitmapSprite.new(Graphics.width,Graphics.height,@viewport1))
text1=(_INTL("{1}",@time))
text2=(_INTL("{1}",@date))
text3=(_INTL("x{1}",@ball))
textPosition=[[text1,Graphics.width-460,yposition+4,2,baseColor,shadowColor],
[text2,Graphics.width-460,yposition+34,2,baseColor,shadowColor],
[text3,Graphics.width-30,yposition+5,2,baseColor,shadowColor]]
pbSetSystemFont(@hud[-1].bitmap)
pbDrawTextPositions(@hud[-1].bitmap,textPosition)
# Draw the pokémon icons
for i in 0...$Trainer.party.size
pokeicon=IconSprite.new(110+54*i,yposition-8,@viewport1)
pokeicon.setBitmap(pbPokemonIconFile($Trainer.party))
pokeicon.src_rect=Rect.new(0,0,64,64)
@hud.push(pokeicon)
end
# Adjust z of every @hud sprite
for sprite in @hud
sprite.z+=600
end
end
#------------------------------------------------
def updateHud
if (Graphics.frame_count%@updateRate==0 && [email protected]?)
disposeHud
createHud
end
for sprite in @hud
sprite.update
end
end
#---------------------------------------------------------
def disposeHud
for sprite in @hud
sprite.dispose
end
@hud.clear
end
#------------------------------------------------------------
end
# * Simple HUD - by FL (Credits will be apreciated)
#===============================================================================
#
# This script is for Pokémon Essentials. It displays a simple HUD with the
# party icons and some small text.
#
#===============================================================================
#
# To this script works, put it above main.
#
#===============================================================================
class Spriteset_Map
USEBAR=true # Make as 'false' to don't show the blue bar
DRAWATBOTTOM=true # Make as 'true' to draw the HUD at bottom
UPDATESPERSECONDS=0.25 # More updates = more lag
alias :initializeoldFL :initialize
alias :disposeoldFL :dispose
alias :updateoldFL :update
def initialize(map=nil)
#------------------------------------------------------
t = Time.now
@time = t.strftime("%I:%M %p")
@date = t.strftime("%m/%d/%y")
#-----------------------------------------------------
@ball=$PokemonBag.pbQuantity(PBItems::POKEBALL) +
$PokemonBag.pbQuantity(PBItems::GREATBALL) +
$PokemonBag.pbQuantity(PBItems::SAFARIBALL) +
$PokemonBag.pbQuantity(PBItems::ULTRABALL) +
$PokemonBag.pbQuantity(PBItems::MASTERBALL) +
$PokemonBag.pbQuantity(PBItems::NETBALL) +
$PokemonBag.pbQuantity(PBItems::DIVEBALL) +
$PokemonBag.pbQuantity(PBItems::NESTBALL) +
$PokemonBag.pbQuantity(PBItems::REPEATBALL) +
$PokemonBag.pbQuantity(PBItems::TIMERBALL) +
$PokemonBag.pbQuantity(PBItems::LUXURYBALL) +
$PokemonBag.pbQuantity(PBItems::PREMIERBALL) +
$PokemonBag.pbQuantity(PBItems::DUSKBALL) +
$PokemonBag.pbQuantity(PBItems::HEALBALL) +
$PokemonBag.pbQuantity(PBItems::QUICKBALL) +
$PokemonBag.pbQuantity(PBItems::CHERISHBALL) +
$PokemonBag.pbQuantity(PBItems::FASTBALL) +
$PokemonBag.pbQuantity(PBItems::LEVELBALL) +
$PokemonBag.pbQuantity(PBItems::LUREBALL) +
$PokemonBag.pbQuantity(PBItems::HEAVYBALL) +
$PokemonBag.pbQuantity(PBItems::LOVEBALL) +
$PokemonBag.pbQuantity(PBItems::FRIENDBALL) +
$PokemonBag.pbQuantity(PBItems::MOONBALL) +
$PokemonBag.pbQuantity(PBItems::SPORTBALL)
#-----------------------------------------------------
@hud = []
@updateRate = (UPDATESPERSECONDS>0) ?
(Graphics.frame_rate/UPDATESPERSECONDS).floor : 0x3FFF
initializeoldFL(map)
createHud
end
def dispose
disposeoldFL
disposeHud
end
def update
updateoldFL
updateHud
end
def createHud
return if !$Trainer # Don't draw the hud if the player wasn't defined
yposition = DRAWATBOTTOM ? Graphics.height-64 : 0
@hud = []
if USEBAR # Draw the blue bar
bar=IconSprite.new(0,yposition,@viewport1)
bar.x = 0
bar.y = 319
bar.z = 0
bar.opacity = 90
bar.bitmap = RPG::Cache.picture("bar2")
bar1=IconSprite.new(0,yposition,@viewport1)
bar1.x = 0
bar1.y = 319
bar1.z = 0
bar1.bitmap = RPG::Cache.picture("bar1")
ball=IconSprite.new(0,yposition,@viewport1)
ball.x = 444
ball.y = 328
ball.z = 0
ball.bitmap = RPG::Cache.icon("pokeb")
@hud.push(bar)
@hud.push(bar1)
@hud.push(ball)
end
# Draw the text
baseColor=Color.new(00,102,255)
shadowColor=Color.new(14,16,18)
@hud.push(BitmapSprite.new(Graphics.width,Graphics.height,@viewport1))
text1=(_INTL("{1}",@time))
text2=(_INTL("{1}",@date))
text3=(_INTL("x{1}",@ball))
textPosition=[[text1,Graphics.width-460,yposition+4,2,baseColor,shadowColor],
[text2,Graphics.width-460,yposition+34,2,baseColor,shadowColor],
[text3,Graphics.width-30,yposition+5,2,baseColor,shadowColor]]
pbSetSystemFont(@hud[-1].bitmap)
pbDrawTextPositions(@hud[-1].bitmap,textPosition)
# Draw the pokémon icons
for i in 0...$Trainer.party.size
pokeicon=IconSprite.new(110+54*i,yposition-8,@viewport1)
pokeicon.setBitmap(pbPokemonIconFile($Trainer.party))
pokeicon.src_rect=Rect.new(0,0,64,64)
@hud.push(pokeicon)
end
# Adjust z of every @hud sprite
for sprite in @hud
sprite.z+=600
end
end
#------------------------------------------------
def updateHud
if (Graphics.frame_count%@updateRate==0 && [email protected]?)
disposeHud
createHud
end
for sprite in @hud
sprite.update
end
end
#---------------------------------------------------------
def disposeHud
for sprite in @hud
sprite.dispose
end
@hud.clear
end
#------------------------------------------------------------
end