diff --git a/scripts/Game_Temp.rb b/scripts/Game_Temp.rb index 336095d..4ee02ee 100644 --- a/scripts/Game_Temp.rb +++ b/scripts/Game_Temp.rb @@ -66,6 +66,7 @@ class Game_Temp attr_accessor :prompt_wait # wait for delay caused by prompt attr_accessor :menus_visible attr_accessor :countdown_password + attr_accessor :igt_timer_visible #-------------------------------------------------------------------------- # * Object Initialization #-------------------------------------------------------------------------- @@ -123,8 +124,9 @@ class Game_Temp @footstep_sfx = nil @filmsprite = nil @prompt_wait = 0 - @menus_visible = false - @countdown_password = "" + @menus_visible = false + @countdown_password = "" + @igt_timer_visible = false end def bgm_fadein(game_system) diff --git a/scripts/Scene_Map.rb b/scripts/Scene_Map.rb index 616f87e..94e5a8b 100644 --- a/scripts/Scene_Map.rb +++ b/scripts/Scene_Map.rb @@ -9,6 +9,14 @@ class Scene_Map # * Main Processing #-------------------------------------------------------------------------- def main + @in_game_timer = Sprite.new + @in_game_timer.x = 8; + @in_game_timer.y = 8; + @in_game_timer.bitmap = Bitmap.new(140, 30) + @in_game_timer.bitmap.fill_rect(0, 0, 140, 30, Color.new(0, 0, 0)) + @in_game_timer.z = 10001 + @in_game_timer.visible = $game_temp.igt_timer_visible + # Make sprite set @spriteset = Spriteset_Map.new # Make message window @@ -82,6 +90,7 @@ class Scene_Map @item_icon.dispose @item_icon_flash.dispose @blackfade.dispose + @in_game_timer.dispose # If switching to title screen if $scene.is_a?(Scene_Title) # Fade out screen @@ -93,6 +102,21 @@ class Scene_Map # * Frame Update #-------------------------------------------------------------------------- def update + if $game_temp.igt_timer_visible && (Graphics.frame_count != nil) + total_sec = Graphics.frame_count / Graphics.frame_rate + hour = total_sec / 60 / 60 + min = total_sec / 60 % 60 + sec = total_sec % 60 + millisec = ((Graphics.frame_count * 1000) / Graphics.frame_rate) % 1000 + time_string = sprintf("%02d:%02d:%02d.%03d", hour, min, sec, millisec) + + igt_seconds = (Graphics.frame_count / 60) % 60 + igt_minutes = (Graphics.frame_count / (60 * 60)) % 60 + igt_hours = Graphics.frame_count / (60 * 60 * 60) + @in_game_timer.bitmap.fill_rect(0, 0, 140, 30, Color.new(0, 0, 0, 128)) + @in_game_timer.bitmap.draw_text(8, 0, 132, 30, time_string) + end + if Input.quit? # put in dialogue boxes here for player # either telling them they can't quit during a cutscene diff --git a/scripts/Scene_Title.rb b/scripts/Scene_Title.rb index 4a5e2d6..201d441 100644 --- a/scripts/Scene_Title.rb +++ b/scripts/Scene_Title.rb @@ -32,6 +32,11 @@ class Scene_Title new_game #unless load # Make system object $game_system = Game_System.new + + if File.exists?("igt.ini") + $game_temp.igt_timer_visible = true + end + # Skip title screen if debug mode (or demo, but not GDC) if $debug || ($demo && !$GDC) || save_exists $game_map.update @@ -225,6 +230,8 @@ class Scene_Title # * Command: Continue #-------------------------------------------------------------------------- def command_continue + # Reset frame count for measuring play time + Graphics.frame_count = 0 # Play decision SE Audio.se_play('Audio/SE/title_decision.wav') # Update map (run parallel process event)