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

@ -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")