CR 16: Permadeath raus — Tod führt auf den letzten Spielstand, ESC-Save
- is_permadeath_enabled komplett ausgebaut (GameState, Save-Feld, Hauptmenü-Toggle, Debug-Overlay-Zeile) - SaveSystem.reload_last_save(): lädt Spielstand + gespeicherte Szene; ohne Spielstand startet der Lauf frisch am Viadukt — verdrahtet an Viadukt-KillZone, Tag-9-QTE (Schleife raus, Weiche bleibt über den Tages-Replay erhalten) und Smàladhs Dreschen-Prüfung - Gauntlet-Stürze behalten Checkpoint-/Ernstlauf-Respawn, Jacks Niederlage ihren Fail-Pfad (Ausgänge bleiben spielrelevant) - Neues ESC-Pausenmenü in player.tscn: Weiterspielen, Speichern mit „Gespeichert."-Feedback, Hauptmenü, Beenden; exklusiv zum Lexicon - DialogueSystem: _wait_for_line übersteht Szenenwechsel mitten in der Zeile (is_instance_valid-Guard) - Buchführung: CR 16 nach CHANGEREQUESTS_DONE, ROADMAP-Status nachgezogen Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
parent
f18e6d3a4d
commit
a38398c3ec
37 changed files with 829 additions and 203 deletions
|
|
@ -5,7 +5,7 @@ extends CanvasLayer
|
|||
## PS5-Controller), die Spielerposition, die aktuelle Kamera-Distanz, den
|
||||
## Bewegungszustand sowie seit Phase 1b Tages-Slot und Tageszähler aus dem
|
||||
## TimeSystem und seit Phase 1a die GameState-Werte: Stats,
|
||||
## Klinge-↔-Herz-Ton-Wert, Beziehungswert zu Imogen und Permadeath-Status.
|
||||
## Klinge-↔-Herz-Ton-Wert und Beziehungswerte.
|
||||
## Der verdeckte
|
||||
## Menschlichkeits-Messwert wird laut SPEC bewusst NICHT angezeigt.
|
||||
## Die provisorische Geräteerkennung wandert in einer späteren Phase in das
|
||||
|
|
@ -91,7 +91,6 @@ func _process(_delta: float) -> void:
|
|||
npc_states.append("%s: %s" % [str(npc.npc_id).capitalize(), npc.get_state_name()])
|
||||
if not npc_states.is_empty():
|
||||
lines.append("NPCs: %s" % " ".join(npc_states))
|
||||
lines.append("Permadeath: %s" % ("AN" if GameState.is_permadeath_enabled else "AUS"))
|
||||
_info_label.text = "\n".join(lines)
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -58,7 +58,7 @@ func _unhandled_input(event: InputEvent) -> void:
|
|||
if event.is_action_pressed("journal"):
|
||||
if _is_open:
|
||||
_close()
|
||||
elif not DialogueSystem.is_dialogue_active:
|
||||
elif not DialogueSystem.is_dialogue_active and not _is_pause_open():
|
||||
_open()
|
||||
get_viewport().set_input_as_handled()
|
||||
return
|
||||
|
|
@ -66,6 +66,7 @@ func _unhandled_input(event: InputEvent) -> void:
|
|||
return
|
||||
if event.is_action_pressed("cancel"):
|
||||
_close()
|
||||
get_viewport().set_input_as_handled()
|
||||
return
|
||||
if event.is_action_pressed("ui_left"):
|
||||
_flip(-1)
|
||||
|
|
@ -77,6 +78,18 @@ func _unhandled_input(event: InputEvent) -> void:
|
|||
_close_button.pressed.emit()
|
||||
|
||||
|
||||
## Meldet, ob das Buch gerade offen ist (für Nachbar-UIs wie das
|
||||
## Pausenmenü).
|
||||
func is_open() -> bool:
|
||||
return _is_open
|
||||
|
||||
|
||||
## Meldet, ob das Pausenmenü des Spielers gerade offen ist.
|
||||
func _is_pause_open() -> bool:
|
||||
var pause := get_parent().get_node_or_null("PauseMenu")
|
||||
return pause != null and pause.is_open()
|
||||
|
||||
|
||||
## Baut die Seitenliste des Buchs (feste Reihenfolge).
|
||||
func _build_pages() -> void:
|
||||
_pages = [{ "id": "kalender", "title": "Kalender" }, { "id": "drache", "title": "Drache & Siegelkraft" }]
|
||||
|
|
|
|||
|
|
@ -16,7 +16,6 @@ const MATURE_GATE_SCENE := preload("res://scenes/ui/mature_gate.tscn")
|
|||
|
||||
@onready var _start_button: Button = $CenterContainer/VBoxContainer/StartButton
|
||||
@onready var _continue_button: Button = $CenterContainer/VBoxContainer/ContinueButton
|
||||
@onready var _permadeath_button: Button = $CenterContainer/VBoxContainer/PermadeathButton
|
||||
@onready var _explicit_button: Button = $CenterContainer/VBoxContainer/ExplicitButton
|
||||
@onready var _quit_button: Button = $CenterContainer/VBoxContainer/QuitButton
|
||||
|
||||
|
|
@ -28,10 +27,8 @@ func _ready() -> void:
|
|||
_continue_button.visible = SaveSystem.has_save()
|
||||
_start_button.pressed.connect(_on_start_pressed)
|
||||
_continue_button.pressed.connect(_on_continue_pressed)
|
||||
_permadeath_button.pressed.connect(_on_permadeath_pressed)
|
||||
_explicit_button.pressed.connect(_on_explicit_pressed)
|
||||
_quit_button.pressed.connect(_on_quit_pressed)
|
||||
_update_permadeath_text()
|
||||
_update_explicit_text()
|
||||
if not MatureContentGate.is_age_confirmed:
|
||||
var gate := MATURE_GATE_SCENE.instantiate()
|
||||
|
|
@ -89,14 +86,6 @@ func _on_continue_pressed() -> void:
|
|||
get_tree().change_scene_to_file(target)
|
||||
|
||||
|
||||
## Schaltet Permadeath um (SPEC Abschnitt 6: Toggle, Default AN). Die
|
||||
## Wahl übersteht GameState.reset() und wird beim Speichern im Spielstand
|
||||
## abgelegt; Fortsetzen stellt den gespeicherten Zustand wieder her.
|
||||
func _on_permadeath_pressed() -> void:
|
||||
GameState.is_permadeath_enabled = not GameState.is_permadeath_enabled
|
||||
_update_permadeath_text()
|
||||
|
||||
|
||||
## Beendet das Spiel.
|
||||
func _on_quit_pressed() -> void:
|
||||
get_tree().quit()
|
||||
|
|
@ -109,11 +98,6 @@ func _on_explicit_pressed() -> void:
|
|||
_update_explicit_text()
|
||||
|
||||
|
||||
## Hält den Toggle-Text synchron zum GameState.
|
||||
func _update_permadeath_text() -> void:
|
||||
_permadeath_button.text = "Permadeath: %s" % ("AN" if GameState.is_permadeath_enabled else "AUS")
|
||||
|
||||
|
||||
## Hält den Explizit-Toggle-Text synchron zum MatureContentGate.
|
||||
func _update_explicit_text() -> void:
|
||||
_explicit_button.text = "Explizite Inhalte: %s" % ("AN" if MatureContentGate.is_explicit_enabled else "AUS")
|
||||
|
|
|
|||
94
scripts/ui/pause_menu.gd
Normal file
94
scripts/ui/pause_menu.gd
Normal file
|
|
@ -0,0 +1,94 @@
|
|||
extends CanvasLayer
|
||||
## ESC-Pausenmenü mit Speichern (CR 16 — der Menü-Aufhänger für das
|
||||
## bestehende Save/Load-System; Instanz in player.tscn).
|
||||
##
|
||||
## Die cancel-Action (Esc / Ⓑ◯) öffnet das Menü überall dort, wo der
|
||||
## Spieler frei steuerbar ist (nicht im Dialog, nicht bei gesperrter
|
||||
## Steuerung, nicht während das Lexicon offen ist) und schließt es
|
||||
## wieder. Buttons (fokus-navigierbar): Weiterspielen, Speichern (mit
|
||||
## Bestätigungs-Feedback über SaveSystem.save_game), Zum Hauptmenü,
|
||||
## Spiel beenden. Während das Menü offen ist, ist die Steuerung gesperrt
|
||||
## und die Maus frei. Das Schlafen-Speichern am Tagesende bleibt davon
|
||||
## unberührt; ein Camp im Feld ist Akt-2-Stoff (kein Camp in v1).
|
||||
|
||||
const MAIN_MENU_SCENE := "res://scenes/ui/main_menu.tscn"
|
||||
|
||||
var _is_open := false
|
||||
|
||||
@onready var _resume_button: Button = $Root/Panel/Margin/Content/ResumeButton
|
||||
@onready var _save_button: Button = $Root/Panel/Margin/Content/SaveButton
|
||||
@onready var _menu_button: Button = $Root/Panel/Margin/Content/MenuButton
|
||||
@onready var _quit_button: Button = $Root/Panel/Margin/Content/QuitButton
|
||||
@onready var _feedback_label: Label = $Root/Panel/Margin/Content/FeedbackLabel
|
||||
|
||||
|
||||
## Startet geschlossen und verbindet die Buttons.
|
||||
func _ready() -> void:
|
||||
visible = false
|
||||
_resume_button.pressed.connect(_close)
|
||||
_save_button.pressed.connect(_on_save_pressed)
|
||||
_menu_button.pressed.connect(_on_menu_pressed)
|
||||
_quit_button.pressed.connect(func() -> void: get_tree().quit())
|
||||
|
||||
|
||||
## cancel öffnet/schließt das Menü, wenn der Spieler frei ist.
|
||||
func _unhandled_input(event: InputEvent) -> void:
|
||||
if not event.is_action_pressed("cancel"):
|
||||
return
|
||||
if _is_open:
|
||||
_close()
|
||||
get_viewport().set_input_as_handled()
|
||||
return
|
||||
if DialogueSystem.is_dialogue_active:
|
||||
return
|
||||
var player := get_tree().get_first_node_in_group("player")
|
||||
if player == null or player.is_control_locked():
|
||||
return
|
||||
var lexicon := get_parent().get_node_or_null("Lexicon")
|
||||
if lexicon != null and lexicon.is_open():
|
||||
return
|
||||
_open()
|
||||
get_viewport().set_input_as_handled()
|
||||
|
||||
|
||||
## Meldet, ob das Pausenmenü gerade offen ist (für Nachbar-UIs).
|
||||
func is_open() -> bool:
|
||||
return _is_open
|
||||
|
||||
|
||||
## Öffnet das Menü: Steuerung sperren, Maus frei, Feedback leeren.
|
||||
func _open() -> void:
|
||||
_is_open = true
|
||||
_feedback_label.text = ""
|
||||
visible = true
|
||||
var player := get_tree().get_first_node_in_group("player")
|
||||
if player != null:
|
||||
player.set_control_locked(true)
|
||||
Input.set_mouse_mode(Input.MOUSE_MODE_VISIBLE)
|
||||
_resume_button.grab_focus.call_deferred()
|
||||
|
||||
|
||||
## Schließt das Menü und gibt Steuerung und Maus zurück.
|
||||
func _close() -> void:
|
||||
_is_open = false
|
||||
visible = false
|
||||
var player := get_tree().get_first_node_in_group("player")
|
||||
if player != null:
|
||||
player.set_control_locked(false)
|
||||
Input.set_mouse_mode(Input.MOUSE_MODE_CAPTURED)
|
||||
|
||||
|
||||
## Speichert den Spielstand und zeigt das Bestätigungs-Feedback.
|
||||
func _on_save_pressed() -> void:
|
||||
if SaveSystem.save_game():
|
||||
_feedback_label.text = "Gespeichert."
|
||||
else:
|
||||
_feedback_label.text = "Speichern fehlgeschlagen — siehe Log."
|
||||
|
||||
|
||||
## Wechselt ins Hauptmenü (ohne Auto-Save — Speichern ist ein eigener,
|
||||
## bewusster Knopf).
|
||||
func _on_menu_pressed() -> void:
|
||||
_close()
|
||||
Input.set_mouse_mode(Input.MOUSE_MODE_VISIBLE)
|
||||
get_tree().change_scene_to_file(MAIN_MENU_SCENE)
|
||||
Loading…
Add table
Add a link
Reference in a new issue