Phase 6a: Mature-Gate mit 18+-Screen, Explizit-Toggle, Debug-Flag

- MatureContentGate: 18+-Bestaetigung und Explizit-Toggle persistent in
  user://settings.json (installations- statt durchlaufbezogen, daher
  getrennt vom Spielstand)
- 18+-Screen mit Content-Warnung als Overlay ueber dem Hauptmenue beim
  allerersten Start (kein zusaetzlicher Szenenschritt); fokus-navigierbar
  nach dem confirm-Muster, Beenden-Ausweg; erscheint nach Bestaetigung
  nie wieder
- Options-Toggle Explizite Inhalte im Hauptmenue (Default AUS, Muster wie
  Permadeath-Toggle)
- Romantik-Weiche als dokumentiertes Format: optionales Feld
  explicit_text in Dialog-Knoten, vom DialogueSystem nur bei aktivem
  Toggle genutzt (_node_text); Standardtext bleibt die
  Fade-to-Black-Variante, explizite Texte pflegt laut SPEC ausschliesslich
  der Nutzer - keine Inhalte angelegt
- Debug-Aufraeumen: GameState.is_debug_mode (Umschalten direkt im Skript
  dokumentiert, true beim Testen / false im Release) schaltet Tab-Save
  (Hub + Testszene) und F9/F10; Schlafsaal speichert jetzt regulaer beim
  Schlafen (unabhaengig vom Debug-Modus), Dreschen-Autosave unveraendert
- Headless verifiziert (29 Checks): Weiche, Gate-Erststart/-Persistenz,
  Toggle-Roundtrip, Untertitel-Verhalten, Debug AN/AUS fuer Tab und
  F9/F10, regulaeres Schlafsaal-Speichern

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
danny 2026-07-07 06:23:28 +02:00
parent 8d9ad3156b
commit 01f50f3107
12 changed files with 233 additions and 12 deletions

View file

@ -51,7 +51,7 @@ func _on_dialogue_finished(_dialogue_id: String) -> void:
## verschieben testweise das Gezeichneten-Standing (reine Debug-Hilfe des
## Overlays, bewusst ohne Input-Action — fliegt mit dem Overlay raus).
func _input(event: InputEvent) -> void:
if event is InputEventKey and event.pressed and not event.echo:
if GameState.is_debug_mode and event is InputEventKey and event.pressed and not event.echo:
if event.physical_keycode == KEY_F9:
FactionSystem.adjust_standing(FactionSystem.MARKED_FACTION_ID, -5)
elif event.physical_keycode == KEY_F10:

View file

@ -12,10 +12,12 @@ extends Control
const NEW_GAME_SCENE := "res://scenes/viaduct/viaduct.tscn"
const CONTINUE_SCENE := "res://scenes/hub/rider_quadrant.tscn"
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
@ -27,8 +29,15 @@ func _ready() -> void:
_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()
add_child(gate)
gate.confirmed.connect(func() -> void: _start_button.grab_focus())
return
_start_button.grab_focus.call_deferred()
@ -87,6 +96,18 @@ func _on_quit_pressed() -> void:
get_tree().quit()
## Schaltet explizite Inhalte um (SPEC Abschnitt 6, Default AUS); die
## Wahl liegt persistent in user://settings.json (MatureContentGate).
func _on_explicit_pressed() -> void:
MatureContentGate.set_explicit_enabled(not MatureContentGate.is_explicit_enabled)
_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")

49
scripts/ui/mature_gate.gd Normal file
View file

@ -0,0 +1,49 @@
extends CanvasLayer
## 18+-Bestätigungs-Screen mit Content-Warnung (Phase 6a, SPEC.md
## Abschnitt 6).
##
## Erscheint als Overlay über dem Hauptmenü, nur beim allerersten
## Programmstart (MatureContentGate.is_age_confirmed). Fokus-navigierbar
## mit Tastatur und Controller nach dem confirm-Muster des Hauptmenüs;
## cancel springt auf Beenden. Bestätigen speichert dauerhaft und gibt
## das Menü frei, Beenden schließt das Spiel.
signal confirmed
@onready var _confirm_button: Button = $Root/Panel/Margin/Content/Buttons/ConfirmButton
@onready var _quit_button: Button = $Root/Panel/Margin/Content/Buttons/QuitButton
## Verbindet die Buttons und setzt den Start-Fokus.
func _ready() -> void:
_confirm_button.pressed.connect(_on_confirm_pressed)
_quit_button.pressed.connect(_on_quit_pressed)
_confirm_button.grab_focus.call_deferred()
## Aktiviert mit confirm den fokussierten Button (Controller-Pfad ohne
## ui_accept-Doppelung); cancel springt auf Beenden.
func _unhandled_input(event: InputEvent) -> void:
if event.is_action_pressed("cancel"):
_quit_button.grab_focus()
return
if not event.is_action_pressed("confirm"):
return
if event.is_action("ui_accept"):
return
var focused := get_viewport().gui_get_focus_owner()
var button := focused as BaseButton
if button != null and not button.disabled:
button.pressed.emit()
## Bestätigt dauerhaft und gibt das Hauptmenü frei.
func _on_confirm_pressed() -> void:
MatureContentGate.confirm_age()
confirmed.emit()
queue_free()
## Beendet das Spiel ohne Bestätigung.
func _on_quit_pressed() -> void:
get_tree().quit()

View file

@ -0,0 +1 @@
uid://srhc5to3e5c4