Lava abgeschwächt, Archetypen aus Datei mit CI-Messlauf, Kartentext folgt Schriftgröße, Gamepad in Menüs, Anleitung 2 mit sicherem Angriff, Übersetzungsprüfung, Lint und gestaffelte CI
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QPgKvy5W9WRNFHjkm5QsHx
This commit is contained in:
@@ -54,6 +54,41 @@ func show_screen(s: Control) -> void:
|
||||
s.app = self
|
||||
s.set_anchors_preset(Control.PRESET_FULL_RECT)
|
||||
add_child(s)
|
||||
if pad_mode:
|
||||
focus_first_button.call_deferred()
|
||||
|
||||
|
||||
var pad_mode := false # zuletzt Gamepad benutzt: Fokusrahmen sichtbar, Steuerkreuz wechselt Knöpfe
|
||||
|
||||
|
||||
## Gamepad in Menüs: erster Tastendruck setzt den Fokus, Maus nimmt ihn wieder weg.
|
||||
func _input(event: InputEvent) -> void:
|
||||
if event is InputEventJoypadButton or (event is InputEventJoypadMotion and absf(event.axis_value) > 0.5):
|
||||
if not pad_mode:
|
||||
pad_mode = true
|
||||
if get_viewport().gui_get_focus_owner() == null:
|
||||
focus_first_button()
|
||||
elif event is InputEventMouseMotion and pad_mode:
|
||||
pad_mode = false
|
||||
get_viewport().gui_release_focus()
|
||||
|
||||
|
||||
func focus_first_button() -> void:
|
||||
if screen == null or screen is BattleScreen:
|
||||
return
|
||||
var b := _first_button(screen)
|
||||
if b != null:
|
||||
b.grab_focus()
|
||||
|
||||
|
||||
func _first_button(node: Node) -> Button:
|
||||
for c in node.get_children():
|
||||
if c is Button and not c.disabled and c.is_visible_in_tree():
|
||||
return c
|
||||
var found := _first_button(c)
|
||||
if found != null:
|
||||
return found
|
||||
return null
|
||||
|
||||
|
||||
func save() -> void:
|
||||
|
||||
Reference in New Issue
Block a user