mirror of
https://github.com/JHDev2006/Super-Mario-Bros.-Remastered-Public.git
synced 2025-10-21 23:18:11 +00:00
level select now shows your high score and score target for challenge mode
This commit is contained in:
@@ -622,6 +622,7 @@ offset_right = 128.0
|
||||
offset_bottom = 40.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
has_challenge_stuff = true
|
||||
|
||||
[node name="CharacterSelect" parent="CanvasLayer/ChallengeHunt" instance=ExtResource("13_8wrri")]
|
||||
visible = false
|
||||
|
@@ -1071,6 +1071,23 @@ offset_bottom = 8.0
|
||||
size_flags_vertical = 4
|
||||
texture = SubResource("AtlasTexture_r70xa")
|
||||
|
||||
[node name="ChallengeBits" type="HBoxContainer" parent="Panel/MarginContainer/VBoxContainer"]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
theme_override_constants/separation = -8
|
||||
alignment = 1
|
||||
|
||||
[node name="HighScore" type="Label" parent="Panel/MarginContainer/VBoxContainer/ChallengeBits"]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
text = "SCORE: 00000"
|
||||
|
||||
[node name="ScoreTarget" type="Label" parent="Panel/MarginContainer/VBoxContainer/ChallengeBits"]
|
||||
unique_name_in_owner = true
|
||||
modulate = Color(0.4627451, 0.5254902, 1, 1)
|
||||
layout_mode = 2
|
||||
text = "/24000"
|
||||
|
||||
[node name="LabelFontChanger" type="Node" parent="." node_paths=PackedStringArray("labels")]
|
||||
script = ExtResource("5_x05vu")
|
||||
labels = [NodePath("../Panel/MarginContainer/VBoxContainer/Title")]
|
||||
|
@@ -9,6 +9,7 @@ var active := false
|
||||
var starting_value := -1
|
||||
|
||||
@export var has_speedrun_stuff := false
|
||||
@export var has_challenge_stuff := false
|
||||
@export var has_disco_stuff := false
|
||||
|
||||
const LEVEL_ICONS := {
|
||||
@@ -98,6 +99,7 @@ var visited_levels := "0000"
|
||||
|
||||
func setup_visuals() -> void:
|
||||
%MarathonBits.visible = Global.current_game_mode == Global.GameMode.MARATHON_PRACTICE
|
||||
%ChallengeBits.visible = Global.current_game_mode == Global.GameMode.CHALLENGE
|
||||
var idx := 0
|
||||
for i in %SlotContainer.get_children():
|
||||
if i.visible == false:
|
||||
@@ -127,6 +129,12 @@ func setup_challenge_mode_bits(container: HBoxContainer, level_num := 1) -> void
|
||||
i.get_node("Full").visible = collected
|
||||
container.get_node("Score/Full").visible = ChallengeModeHandler.top_challenge_scores[Global.world_num - 1][level_num - 1] >= ChallengeModeHandler.CHALLENGE_TARGETS[Global.current_campaign][Global.world_num - 1][level_num - 1]
|
||||
|
||||
func update_score() -> void:
|
||||
if has_challenge_stuff == false: return
|
||||
var target = ChallengeModeHandler.CHALLENGE_TARGETS[Global.current_campaign][Global.world_num - 1][selected_level]
|
||||
%ScoreTarget.text = "/" + str(target)
|
||||
%HighScore.text = "SCORE: " + ("-----" if ChallengeModeHandler.top_challenge_scores[Global.world_num - 1][selected_level] <= 0 else str(int(ChallengeModeHandler.top_challenge_scores[Global.world_num - 1][selected_level])).pad_zeros(5))
|
||||
|
||||
func update_pb() -> void:
|
||||
if has_speedrun_stuff == false: return
|
||||
var best_warpless_time = SpeedrunHandler.best_level_warpless_times[Global.world_num - 1][selected_level]
|
||||
@@ -175,6 +183,7 @@ func select_world() -> void:
|
||||
func slot_selected(idx := 0) -> void:
|
||||
selected_level = idx
|
||||
update_pb()
|
||||
update_score()
|
||||
|
||||
func cleanup() -> void:
|
||||
await get_tree().process_frame
|
||||
|
Reference in New Issue
Block a user