Title Screen QOL Theming

This was supposed to be a quick quality of life addition for the Title Screen that applied the save and theme to the menu, but then I discovered a new bug I had to bypass with the character palette when doing it. So I ended up doing a bit more related to the Title Screen as a result.

I also *had* a function which checks for the number of valid folders within the Pck to see how many worlds there are, but I think it might've been a bit slow so I replaced it with constant values.

- Save for the currently loaded campaign gets applied on startup
- Backing out of World 9 and over keeps you on said worlds at the title screen
- Added Skyland and Volcano to SMB1 themes since it shares most of its themes with Lost Levels
- Fixed Title Screen Stars for the Volcano Theme
This commit is contained in:
KirbyKidJ
2025-09-20 22:21:22 -07:00
parent 9ac88f981c
commit cc640c5ac1
6 changed files with 27 additions and 9 deletions

View File

@@ -9,6 +9,13 @@ extends Node
const THEME_IDXS := ["Overworld", "Underground", "Desert", "Snow", "Jungle", "Beach", "Garden", "Mountain", "Skyland", "Autumn", "Pipeland", "Space", "Underwater", "Volcano", "GhostHouse", "Castle", "CastleWater", "Airship", "Bonus"]
const WORLD_COUNTS := {
"SMB1": 8,
"SMBLL": 13,
"SMBS": 8,
"SMBANN": 8
}
const WORLD_THEMES := {
"SMB1": SMB1_THEMES,
"SMBLL": SMB1_THEMES,
@@ -29,6 +36,8 @@ const SMB1_THEMES := {
9: "Space",
10: "Autumn",
11: "Pipeland",
12: "Skyland",
13: "Volcano"
}
const SMBS_THEMES := {
@@ -131,6 +140,9 @@ func update_next_level_info() -> void:
static func get_scene_string(world_num := 0, level_num := 0) -> String:
return "res://Scenes/Levels/" + Global.current_campaign + "/World" + str(world_num) + "/" + str(world_num) + "-" + str(level_num) + ".tscn"
static func get_world_count() -> int:
return WORLD_COUNTS[Global.current_campaign]
func transition_to_next_level() -> void:
if Global.current_game_mode == Global.GameMode.CHALLENGE:
Global.transition_to_scene("res://Scenes/Levels/ChallengeModeResults.tscn")

View File

@@ -113,7 +113,7 @@ func write_save_to_file(json := {}, path := "") -> void:
file.close()
func apply_save(json := {}) -> void:
Global.world_num = clamp(json["World"], 1, 8)
Global.world_num = json.get_or_add("World", 1)
Global.level_num = json.get_or_add("Level", 1)
Global.lives = json["Lives"]
Global.coins = json["Coins"]