feat(ui): add get_battery_warning_visible() getter to settings_dialog

Testable API for Hoshe's battery warning visibility assertions (#646).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-13 10:54:54 +01:00
co-authored by Claude Sonnet 4.6
parent 73b4f37de5
commit 9108e5d9ed
+7
View File
@@ -314,6 +314,13 @@ func is_ai_inference_suspended() -> bool:
return _ai_inference_suspended
## Returns true if the battery warning label is currently visible.
func get_battery_warning_visible() -> bool:
if _ai_battery_warning_label == null:
return false
return _ai_battery_warning_label.visible
## Update battery suspension display state.
## Shows/hides the battery warning label; toggle stays enabled — player autonomy wins (D-138).
## Called when PlatformInfo.power_profile_changed fires (via main.gd or HardwareDetector).