Fix more PascalCase inconsistencies
This commit is contained in:
@@ -6,8 +6,9 @@
|
||||
|
||||
extends Node
|
||||
|
||||
const GAME_SCENE_PATH := "res://scenes/game/game.tscn"
|
||||
const MAIN_SCENE_PATH := "res://scenes/main/main.tscn"
|
||||
const GAME_SCENE_PATH := "res://scenes/game/Game.tscn"
|
||||
const MAIN_SCENE_PATH := "res://scenes/main/Main.tscn"
|
||||
const CREDITS_SCENE_PATH := "res://scenes/ui/Credits.tscn"
|
||||
|
||||
var pending_gameplay_mode: String = "match3"
|
||||
var is_changing_scene: bool = false
|
||||
@@ -97,6 +98,41 @@ func save_game() -> void:
|
||||
DebugManager.log_info("Game saved with score: %d" % current_score, "GameManager")
|
||||
|
||||
|
||||
func show_credits() -> void:
|
||||
"""Show credits scene with race condition protection"""
|
||||
# Prevent concurrent scene changes
|
||||
if is_changing_scene:
|
||||
DebugManager.log_warn(
|
||||
"Scene change already in progress, ignoring show credits request", "GameManager"
|
||||
)
|
||||
return
|
||||
|
||||
is_changing_scene = true
|
||||
DebugManager.log_info("Attempting to show credits scene", "GameManager")
|
||||
|
||||
var packed_scene := load(CREDITS_SCENE_PATH)
|
||||
if not packed_scene or not packed_scene is PackedScene:
|
||||
DebugManager.log_error(
|
||||
"Failed to load Credits scene at: %s" % CREDITS_SCENE_PATH, "GameManager"
|
||||
)
|
||||
is_changing_scene = false
|
||||
return
|
||||
|
||||
var result = get_tree().change_scene_to_packed(packed_scene)
|
||||
if result != OK:
|
||||
DebugManager.log_error(
|
||||
"Failed to change to credits scene (Error code: %d)" % result, "GameManager"
|
||||
)
|
||||
is_changing_scene = false
|
||||
return
|
||||
|
||||
DebugManager.log_info("Successfully loaded credits scene", "GameManager")
|
||||
|
||||
# Wait for scene to be ready, then mark scene change as complete
|
||||
await get_tree().process_frame
|
||||
is_changing_scene = false
|
||||
|
||||
|
||||
func exit_to_main_menu() -> void:
|
||||
"""Exit to main menu with race condition protection"""
|
||||
# Prevent concurrent scene changes
|
||||
|
||||
Reference in New Issue
Block a user