Add platform layer: lifecycle, data dirs, safe area (mobile step 2)

Move the macOS/Android data and config directory code out of main.cpp
into src/app/platform. Handle background/foreground: save config and
interface status, pause audio, cancel touch input and skip rendering
while keeping the network pumped. Map the window safe area through the
letterboxed presentation into TouchLayout and expose touch.GetSafeArea()
so the mobile HUD stays clear of notches and gesture bars.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
shenlei
2026-10-12 20:45:07 +09:00
co-authored by Claude Opus 5.5
parent 260d421bde
commit b79fbce0b0
16 changed files with 475 additions and 73 deletions
+4 -2
View File
@@ -27,10 +27,12 @@ class MobileCombatWheel(ui.Window):
sw = wndMgr.GetScreenWidth()
sh = wndMgr.GetScreenHeight()
# 安全区(刘海/圆角/手势条)内缩,桌面为 0
safe_l, safe_t, safe_r, safe_b = touch.GetSafeArea()
if origin_x is None:
origin_x = sw - 120
origin_x = sw - safe_r - 120
if origin_y is None:
origin_y = sh - 120
origin_y = sh - safe_b - 120
self.origin_x = origin_x
self.origin_y = origin_y