From 8dc1583f66f410d07972fc4c2ba248137cfbde4f Mon Sep 17 00:00:00 2001 From: JHDev2006 Date: Thu, 2 Oct 2025 11:13:02 +0100 Subject: [PATCH] IGT is now visible in marathon mode --- Scenes/Prefabs/GameHud.tscn | 76 +++++++++++++------ .../Prefabs/LevelObjects/BooRaceHandler.tscn | 25 +++++- Scripts/Classes/UI/GameHUD.gd | 6 ++ 3 files changed, 81 insertions(+), 26 deletions(-) diff --git a/Scenes/Prefabs/GameHud.tscn b/Scenes/Prefabs/GameHud.tscn index 7492a57..677415d 100644 --- a/Scenes/Prefabs/GameHud.tscn +++ b/Scenes/Prefabs/GameHud.tscn @@ -530,6 +530,7 @@ uppercase = true [node name="Time" type="Label" parent="Main/TimeDisplay/TimeLabel"] unique_name_in_owner = true +visible = false layout_mode = 1 anchors_preset = -1 offset_left = -12.0 @@ -540,27 +541,41 @@ text = " 000" horizontal_alignment = 2 uppercase = true -[node name="Stopwatch" type="Label" parent="Main/TimeDisplay/TimeLabel"] -unique_name_in_owner = true -layout_mode = 1 -anchors_preset = -1 -offset_left = -16.0 +[node name="VBoxContainer" type="VBoxContainer" parent="Main/TimeDisplay/TimeLabel"] +layout_mode = 0 +offset_left = -24.0 offset_top = 8.0 -offset_right = 24.0 -offset_bottom = 16.0 +offset_right = 56.0 +offset_bottom = 40.0 +theme_override_constants/separation = -8 +alignment = 1 + +[node name="Stopwatch" type="Label" parent="Main/TimeDisplay/TimeLabel/VBoxContainer"] +unique_name_in_owner = true +layout_mode = 2 +size_flags_vertical = 0 text = "00:00:00" +horizontal_alignment = 2 uppercase = true -[node name="PB" type="Label" parent="Main/TimeDisplay/TimeLabel"] +[node name="PB" type="Label" parent="Main/TimeDisplay/TimeLabel/VBoxContainer"] unique_name_in_owner = true -visible = false -layout_mode = 1 -anchors_preset = -1 -offset_left = -24.0 -offset_top = 16.0 -offset_right = 16.0 -offset_bottom = 24.0 +layout_mode = 2 +size_flags_vertical = 0 text = "+00:00:00" +horizontal_alignment = 2 +uppercase = true + +[node name="Control" type="Control" parent="Main/TimeDisplay/TimeLabel/VBoxContainer"] +custom_minimum_size = Vector2(0, 12) +layout_mode = 2 + +[node name="IGT" type="Label" parent="Main/TimeDisplay/TimeLabel/VBoxContainer"] +unique_name_in_owner = true +layout_mode = 2 +size_flags_vertical = 2 +text = " ⏲000" +horizontal_alignment = 2 uppercase = true [node name="Buffer5" type="Control" parent="Main"] @@ -918,7 +933,7 @@ grow_horizontal = 0 grow_vertical = 2 size_flags_horizontal = 10 size_flags_vertical = 8 -text = "⏲000" +text = "⏲00:00:00" horizontal_alignment = 2 [node name="ModernScore" type="Label" parent="ModernHUD/Right/ModernTime"] @@ -932,16 +947,27 @@ size_flags_horizontal = 8 size_flags_vertical = 8 text = "000000000" -[node name="ModernPB" type="Label" parent="ModernHUD/Right/ModernTime"] +[node name="VBoxContainer" type="VBoxContainer" parent="ModernHUD/Right/ModernTime"] +layout_mode = 0 +offset_top = 9.0 +offset_right = 80.0 +offset_bottom = 41.0 +theme_override_constants/separation = -4 + +[node name="ModernPB" type="Label" parent="ModernHUD/Right/ModernTime/VBoxContainer"] unique_name_in_owner = true -layout_mode = 1 -anchors_preset = -1 -offset_top = 12.0 -offset_right = 40.0 -offset_bottom = 28.0 +layout_mode = 2 size_flags_horizontal = 10 size_flags_vertical = 8 -text = "⏲00" +text = "⏲00:00:00" +horizontal_alignment = 2 + +[node name="ModernIGT" type="Label" parent="ModernHUD/Right/ModernTime/VBoxContainer"] +unique_name_in_owner = true +layout_mode = 2 +size_flags_horizontal = 10 +size_flags_vertical = 8 +text = "⏲000" horizontal_alignment = 2 [node name="Timer" type="Timer" parent="."] @@ -1036,7 +1062,7 @@ metadata/_custom_type_script = "uid://cbal8ms2oe1ik" [node name="TextShadowColourChanger" type="Node" parent="." node_paths=PackedStringArray("labels", "shadow_node")] script = ExtResource("18_jwl8o") -labels = [NodePath("../Main/ScoreName/CharacterName"), NodePath("../Main/ScoreName/Score"), NodePath("../Main/CoinCount/CoinLabel"), NodePath("../Main/LevelDisplay/WorldTitle"), NodePath("../Main/LevelDisplay/WorldTitle/LevelNum"), NodePath("../Main/TimeDisplay/TimeLabel"), NodePath("../Main/TimeDisplay/TimeLabel/Time"), NodePath("../Main/TimeDisplay/TimeLabel/Stopwatch"), NodePath("../Main/TimeDisplay/TimeLabel/PB"), NodePath("../ModernHUD/TopLeft/CoinCount/ModernCoinCount"), NodePath("../ModernHUD/Right/ModernTime"), NodePath("../ModernHUD/Right/ModernTime/ModernScore"), NodePath("../Main/CoinCount/KeyCount/KeyAmount"), NodePath("../ModernHUD/TopLeft/ModernKeyCount/ModernKeyAmount"), NodePath("../ModernHUD/TopLeft/LifeCount/ModernLifeCount"), NodePath("../Combo/ComboAmount"), null, null, NodePath("../ModernHUD/Right/ModernTime/ModernPB")] +labels = [NodePath("../Main/ScoreName/CharacterName"), NodePath("../Main/ScoreName/Score"), NodePath("../Main/CoinCount/CoinLabel"), NodePath("../Main/LevelDisplay/WorldTitle"), NodePath("../Main/LevelDisplay/WorldTitle/LevelNum"), NodePath("../Main/TimeDisplay/TimeLabel"), NodePath("../Main/TimeDisplay/TimeLabel/Time"), NodePath("../Main/TimeDisplay/TimeLabel/VBoxContainer/Stopwatch"), NodePath("../Main/TimeDisplay/TimeLabel/VBoxContainer/PB"), NodePath("../ModernHUD/TopLeft/CoinCount/ModernCoinCount"), NodePath("../ModernHUD/Right/ModernTime"), NodePath("../ModernHUD/Right/ModernTime/ModernScore"), NodePath("../Main/CoinCount/KeyCount/KeyAmount"), NodePath("../ModernHUD/TopLeft/ModernKeyCount/ModernKeyAmount"), NodePath("../ModernHUD/TopLeft/LifeCount/ModernLifeCount"), NodePath("../Combo/ComboAmount"), null, null, NodePath("../ModernHUD/Right/ModernTime/VBoxContainer/ModernPB"), NodePath("../Main/TimeDisplay/TimeLabel/VBoxContainer/IGT"), NodePath("../ModernHUD/Right/ModernTime/VBoxContainer/ModernIGT")] shadow_node = NodePath("../Main/RedCoins/BorderL/Shadow") [node name="HudTemplate" type="Sprite2D" parent="."] @@ -1048,7 +1074,7 @@ centered = false [node name="LabelFontChanger" type="Node" parent="." node_paths=PackedStringArray("labels")] script = ExtResource("15_jwl8o") -labels = [NodePath("../Main/ScoreName/CharacterName"), NodePath("../Main/ScoreName/Score"), NodePath("../Main/CoinCount/CoinLabel"), NodePath("../Main/LevelDisplay/WorldTitle"), NodePath("../Main/LevelDisplay/WorldTitle/LevelNum"), NodePath("../Main/TimeDisplay/TimeLabel"), NodePath("../Main/TimeDisplay/TimeLabel/Time"), NodePath("../ModernHUD/TopLeft/CoinCount/ModernCoinCount"), NodePath("../ModernHUD/Right/ModernTime"), NodePath("../ModernHUD/Right/ModernTime/ModernScore"), NodePath("../Main/CoinCount/KeyCount/KeyAmount"), NodePath("../Main/TimeDisplay/TimeLabel/Stopwatch"), NodePath("../Main/TimeDisplay/TimeLabel/PB"), NodePath("../ModernHUD/TopLeft/LifeCount/ModernLifeCount"), NodePath("../Main/CoinCount/KeyCount/KeyAmount"), NodePath("../Combo/ComboAmount"), NodePath("../ModernHUD/TopLeft/ModernKeyCount/ModernKeyAmount"), NodePath("../Main/LevelDisplay/WorldTitle/LevelNum/Crown"), NodePath("../ModernHUD/Right/ModernTime/ModernPB")] +labels = [NodePath("../Main/ScoreName/CharacterName"), NodePath("../Main/ScoreName/Score"), NodePath("../Main/CoinCount/CoinLabel"), NodePath("../Main/LevelDisplay/WorldTitle"), NodePath("../Main/LevelDisplay/WorldTitle/LevelNum"), NodePath("../Main/TimeDisplay/TimeLabel"), NodePath("../Main/TimeDisplay/TimeLabel/Time"), NodePath("../ModernHUD/TopLeft/CoinCount/ModernCoinCount"), NodePath("../ModernHUD/Right/ModernTime"), NodePath("../ModernHUD/Right/ModernTime/ModernScore"), NodePath("../Main/CoinCount/KeyCount/KeyAmount"), NodePath("../Main/TimeDisplay/TimeLabel/VBoxContainer/Stopwatch"), NodePath("../Main/TimeDisplay/TimeLabel/VBoxContainer/PB"), NodePath("../ModernHUD/TopLeft/LifeCount/ModernLifeCount"), NodePath("../Main/CoinCount/KeyCount/KeyAmount"), NodePath("../Combo/ComboAmount"), NodePath("../ModernHUD/TopLeft/ModernKeyCount/ModernKeyAmount"), NodePath("../Main/LevelDisplay/WorldTitle/LevelNum/Crown"), NodePath("../ModernHUD/Right/ModernTime/VBoxContainer/ModernPB"), NodePath("../Main/TimeDisplay/TimeLabel/VBoxContainer/IGT"), NodePath("../ModernHUD/Right/ModernTime/VBoxContainer/ModernIGT")] metadata/_custom_type_script = "uid://co6tjg3w6qpd8" [node name="TextureUpdater" type="Node" parent="." node_paths=PackedStringArray("sprites")] diff --git a/Scenes/Prefabs/LevelObjects/BooRaceHandler.tscn b/Scenes/Prefabs/LevelObjects/BooRaceHandler.tscn index 08a84fe..72a4d8d 100644 --- a/Scenes/Prefabs/LevelObjects/BooRaceHandler.tscn +++ b/Scenes/Prefabs/LevelObjects/BooRaceHandler.tscn @@ -89,6 +89,18 @@ tracks/2/keys = { "update": 1, "values": [true, false] } +tracks/3/type = "value" +tracks/3/imported = false +tracks/3/enabled = true +tracks/3/path = NodePath("Countdown:playing") +tracks/3/interp = 1 +tracks/3/loop_wrap = true +tracks/3/keys = { +"times": PackedFloat32Array(0), +"transitions": PackedFloat32Array(1), +"update": 1, +"values": [true] +} [sub_resource type="Animation" id="Animation_axajb"] length = 0.001 @@ -128,6 +140,18 @@ tracks/2/keys = { "update": 1, "values": [true] } +tracks/3/type = "value" +tracks/3/imported = false +tracks/3/enabled = true +tracks/3/path = NodePath("Countdown:playing") +tracks/3/interp = 1 +tracks/3/loop_wrap = true +tracks/3/keys = { +"times": PackedFloat32Array(0), +"transitions": PackedFloat32Array(1), +"update": 1, +"values": [false] +} [sub_resource type="AnimationLibrary" id="AnimationLibrary_qeaax"] _data = { @@ -167,7 +191,6 @@ metadata/_custom_type_script = "uid://cq6f682453q6o" [node name="Countdown" type="AudioStreamPlayer" parent="."] stream = ExtResource("6_qeaax") -autoplay = true bus = &"SFX" script = ExtResource("7_reyer") metadata/_custom_type_script = "uid://dmtw1jesw1vl7" diff --git a/Scripts/Classes/UI/GameHUD.gd b/Scripts/Classes/UI/GameHUD.gd index 9ef4c47..869c4f1 100644 --- a/Scripts/Classes/UI/GameHUD.gd +++ b/Scripts/Classes/UI/GameHUD.gd @@ -26,6 +26,7 @@ func handle_main_hud() -> void: $ModernHUD.visible = Settings.file.visuals.modern_hud $Main/RedCoins.hide() $Main/CoinCount.show() + %IGT.hide() %Combo.hide() $Timer.paused = Settings.file.difficulty.time_limit == 2 $%Time.show() @@ -147,6 +148,11 @@ func handle_yoshi_radar() -> void: func handle_speedrun_timer() -> void: %Time.hide() %Stopwatch.show() + %IGT.show() + %IGT.modulate.a = int([Global.GameMode.MARATHON, Global.GameMode.MARATHON_PRACTICE].has(Global.current_game_mode) and get_tree().get_first_node_in_group("Players") != null) + %IGT.text = "⏲" + (str(Global.time).pad_zeros(3)) + %ModernIGT.visible = %IGT.modulate.a == 1 + %ModernIGT.text = %IGT.text var late = SpeedrunHandler.timer > SpeedrunHandler.best_time var diff = SpeedrunHandler.best_time - SpeedrunHandler.timer %PB.visible = SpeedrunHandler.best_time > 0 and (SpeedrunHandler.timer > 0 or Global.current_level != null)