refactor(client): remove archetype selection, fix Randomise→Randomize
- Remove character_select.tscn and character_select.gd entirely (Smuggler/Detective archetypes removed per v0.2 pivot) - New Game goes straight to character creation - Rename Randomise→Randomize throughout (US English convention) - Add *.import and *.uid to client gitignore (import artifacts) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
+5
-41
@@ -1,12 +1,10 @@
|
||||
extends Control
|
||||
## #258: Main menu — New Game / Continue / Load Game / Quit.
|
||||
## New Game: shows character select panel (D-085 save dir created after archetype chosen).
|
||||
## New Game: opens character creation screen, then starts game.
|
||||
## Continue: loads most recent save directory.
|
||||
## Load Game: shows sorted save list for manual selection (#257).
|
||||
## #588: Character archetype selection — panel shown between New Game click and game load.
|
||||
|
||||
const GAME_SCENE := "res://scenes/main.tscn"
|
||||
const CHARACTER_SELECT_SCENE := "res://scenes/character_select.tscn"
|
||||
const CHARACTER_CREATION_SCENE := "res://scenes/character_creation.tscn"
|
||||
|
||||
const BG_COLOR := Color(0.05, 0.05, 0.08, 1.0)
|
||||
@@ -26,8 +24,7 @@ const FONT_SIZE_BTN := 15
|
||||
@onready var _saves_list: VBoxContainer = $LoadGamePanel/VBox/SavesScroll/SavesList
|
||||
@onready var _load_back_btn: Button = $LoadGamePanel/VBox/BackBtn
|
||||
|
||||
var _char_select: Control = null # Instantiated on demand
|
||||
var _char_creation: Control = null # Instantiated after archetype confirmed
|
||||
var _char_creation: Control = null
|
||||
|
||||
|
||||
func _ready() -> void:
|
||||
@@ -47,40 +44,10 @@ func _refresh_continue_state() -> void:
|
||||
|
||||
|
||||
func _on_new_game() -> void:
|
||||
# #588: Show character select before creating the save directory.
|
||||
# ESC on character select cancels with no directory created.
|
||||
GameState.pending_load_path = ""
|
||||
_show_character_select()
|
||||
|
||||
|
||||
func _show_character_select() -> void:
|
||||
if _char_select != null and is_instance_valid(_char_select):
|
||||
_char_select.queue_free()
|
||||
var scene := load(CHARACTER_SELECT_SCENE) as PackedScene
|
||||
if scene == null:
|
||||
push_error("MainMenu: failed to load character_select.tscn")
|
||||
return
|
||||
_char_select = scene.instantiate()
|
||||
add_child(_char_select)
|
||||
_char_select.archetype_confirmed.connect(_on_archetype_confirmed)
|
||||
_char_select.archetype_cancelled.connect(_on_archetype_cancelled)
|
||||
|
||||
|
||||
func _on_archetype_confirmed(archetype: String) -> void:
|
||||
if _char_select != null and is_instance_valid(_char_select):
|
||||
_char_select.queue_free()
|
||||
_char_select = null
|
||||
# Set archetype first; save dir created after character creation confirms.
|
||||
GameState.character_archetype = archetype
|
||||
_show_character_creation()
|
||||
|
||||
|
||||
func _on_archetype_cancelled() -> void:
|
||||
if _char_select != null and is_instance_valid(_char_select):
|
||||
_char_select.queue_free()
|
||||
_char_select = null
|
||||
|
||||
|
||||
func _show_character_creation() -> void:
|
||||
if _char_creation != null and is_instance_valid(_char_creation):
|
||||
_char_creation.queue_free()
|
||||
@@ -107,8 +74,6 @@ func _on_creation_cancelled() -> void:
|
||||
if _char_creation != null and is_instance_valid(_char_creation):
|
||||
_char_creation.queue_free()
|
||||
_char_creation = null
|
||||
# Return to archetype select
|
||||
_show_character_select()
|
||||
|
||||
|
||||
func _start_game_with_defaults() -> void:
|
||||
@@ -116,12 +81,11 @@ func _start_game_with_defaults() -> void:
|
||||
if game_id.is_empty():
|
||||
push_error("MainMenu: new_game() failed to create save directory — cannot start")
|
||||
return
|
||||
SessionManager.save_character_archetype(game_id, GameState.character_archetype)
|
||||
get_tree().change_scene_to_file(GAME_SCENE)
|
||||
|
||||
|
||||
func _on_continue() -> void:
|
||||
GameState.pending_load_path = "" # clear stale load path from previous Load selection
|
||||
GameState.pending_load_path = ""
|
||||
var saves := SessionManager.list_game_dirs()
|
||||
if saves.is_empty():
|
||||
return
|
||||
@@ -129,7 +93,7 @@ func _on_continue() -> void:
|
||||
get_tree().change_scene_to_file(GAME_SCENE)
|
||||
|
||||
|
||||
var _list_built: bool = false # guard against queue_free() race on rapid reopen
|
||||
var _list_built: bool = false
|
||||
|
||||
|
||||
func _on_load_game_browse() -> void:
|
||||
@@ -141,7 +105,7 @@ func _on_load_game_browse() -> void:
|
||||
|
||||
func _on_load_back() -> void:
|
||||
_load_panel.visible = false
|
||||
_list_built = false # allow rebuild on next open
|
||||
_list_built = false
|
||||
|
||||
|
||||
func _on_quit() -> void:
|
||||
|
||||
Reference in New Issue
Block a user