- InputMap-Actions mit physischen KEY_*-Codes (shortcut_keys.gd, idempotent) — DE-Layout/Windows-unabhängig - Freelook: RMT halten = Umsehen+Flug (WASD/EQ, Shift x3, Alt x0.3, Rad = Grundtempo dauerhaft), Shift+F toggle; Orbit bleibt Default, Flug-Exit ohne Kamera-Sprung (FlyMath pure) - F zentriert Auswahl (SelectionMath.focus_center); Esc = pure Prioritätskette (ShortcutPolicy) - Strg+LMB + Baum SELECT_MULTI: Mehrfachauswahl synchron Szene↔Baum; Entf/Strg+D wirken auf die ganze Auswahl (EIN Undo-Schritt) - docs/tasten.md = deutsche Source of truth (Karten 2/3 ergänzen) - Tests: test_shortcuts.gd NEU 70 Checks, Suite 571 grün, Builder-Export 21/0, Parse-Check grün
25 lines
No EOL
992 B
GDScript
25 lines
No EOL
992 B
GDScript
extends RefCounted
|
|
class_name ShortcutPolicy
|
|
## Esc-Verhalten des Map-Editors (Karte t_c46d31c2, Karte 1/3) — bewusst pure
|
|
## Funktion: main.gd fragt pro Esc-Taste ab WELCHE Zustandsänderung fällig ist
|
|
## und macht nur noch den Text. tests/test_shortcuts.gd prüft alle Kombos.
|
|
##
|
|
## Priorität (spec „Esc = Auswahl aufheben / Werkzeug abbrechen / Ghost abbrechen"):
|
|
## 1. aktives Sonder-Werkzeug verlassen (Terrain/Spawns/Bauen → Objekt-Werkzeug)
|
|
## 2. Ghost-Preview (Platzieren) abbrechen
|
|
## 3. Auswahl aufheben
|
|
## Rückgabe-Werte:
|
|
## "exit_terrain" | "exit_spawns" | "exit_bauen" | "cancel_placement"
|
|
## "clear_selection" | "none"
|
|
static func esc_action(tool_mode: String, placing: bool, has_selection: bool) -> String:
|
|
if tool_mode == "terrain":
|
|
return "exit_terrain"
|
|
if tool_mode == "spawns":
|
|
return "exit_spawns"
|
|
if tool_mode == "bauen":
|
|
return "exit_bauen"
|
|
if placing:
|
|
return "cancel_placement"
|
|
if has_selection:
|
|
return "clear_selection"
|
|
return "none" |