More renaming and rearranging, fixed typo from earlier commit, tweaked splash and title screen code

This commit is contained in:
Maruno17
2021-04-05 00:04:18 +01:00
parent 5b0960337a
commit f541a13c9b
69 changed files with 180 additions and 69 deletions

View File

@@ -0,0 +1,45 @@
class Sprite_Timer
def initialize(viewport=nil)
@viewport=viewport
@timer=nil
@total_sec=nil
@disposed=false
end
def dispose
@timer.dispose if @timer
@timer=nil
@disposed=true
end
def disposed?
@disposed
end
def update
return if disposed?
if $game_system.timer_working
@timer.visible = true if @timer
if !@timer
@timer=Window_AdvancedTextPokemon.newWithSize("",Graphics.width-120,0,120,64)
@timer.width=@timer.borderX+96
@timer.x=Graphics.width-@timer.width
@timer.viewport=@viewport
@timer.z=99998
end
curtime=$game_system.timer / Graphics.frame_rate
curtime=0 if curtime<0
if curtime != @total_sec
# Calculate total number of seconds
@total_sec = curtime
# Make a string for displaying the timer
min = @total_sec / 60
sec = @total_sec % 60
@timer.text = _ISPRINTF("<ac>{1:02d}:{2:02d}", min, sec)
end
@timer.update
else
@timer.visible=false if @timer
end
end
end