feat(ui): AI-Enhanced Dialogue toggle + hardware detection (#646, D-138)
Implements the full AI-Enhanced Dialogue feature for Sprint 26: - HardwareDetector autoload (extends Node): three-layer detection — Layer 1 RAM classification (pass/marginal/fail, thresholds 2GB/1.6GB), Layer 2 TPT benchmark cache (green/yellow/red, thresholds 6/3 t/s), Layer 3 degradation monitoring (>40% drop → yellow). load_ai_pref() restores toggle state from user://settings.cfg on startup. - Settings dialog AI section: toggle, colored status dot, status message label, testable API (get_ai_dialogue_label_text, set_ai_dialogue_ hardware_status, is_ai_dialogue_toggle_enabled). Only RAM "fail" greys out toggle — player always overrides yellow/red recommendations (D-138). - GameState.ai_enhanced_dialogue_enabled (default true, opt-out model). GameState.settings_response (v20 one-shot settings dump from server). apply_snapshot() hydrates ai_enhanced_dialogue_enabled from full dump. - Protocol v19→v20, settings_response decoding in decode_snapshot(). Protocol converted to extends Node autoload (enables test has_method). encode_change_settings() helper for test inspection. - InputMapper: CHANGE_SETTINGS, REQUEST_ALL_SETTINGS, DELETE_SETTING. SimBridge: wire mappings for all three. RequestAllSettings queued after handshake to hydrate client state from server SQLite on connect. settings_response carry-forward in receive_bytes(). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -17,6 +17,7 @@ config/icon="res://icon.svg"
|
||||
|
||||
[autoload]
|
||||
|
||||
Protocol="*res://scripts/protocol/protocol.gd"
|
||||
SimBridge="*res://scripts/autoloads/sim_bridge.gd"
|
||||
GameState="*res://scripts/autoloads/game_state.gd"
|
||||
InputMapper="*res://scripts/autoloads/input_mapper.gd"
|
||||
@@ -24,6 +25,7 @@ UIStrings="*res://scripts/autoloads/ui_strings.gd"
|
||||
FogState="*res://scripts/autoloads/fog_state.gd"
|
||||
AudioManager="*res://scripts/autoloads/audio_manager.gd"
|
||||
SessionManager="*res://scripts/autoloads/session_manager.gd"
|
||||
HardwareDetector="*res://ui/hardware_detector.gd"
|
||||
|
||||
[audio]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user