mirror of
https://github.com/JHDev2006/Super-Mario-Bros.-Remastered-Public.git
synced 2025-10-22 15:38:14 +00:00
level select now shows your high score and score target for challenge mode
This commit is contained in:
@@ -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