Custom page: language is now two explicit choices, 中文 / English (#12)

The single "Language: English" checkbox becomes two side-by-side options, readable in both UIs, with a hint under the row in the chosen language: tap Apply, then close and reopen the app. Storage is unchanged (still one key).

Suggested in #12.
This commit is contained in:
jhaizhou
2026-10-13 10:57:13 +08:00
parent a8e65cece8
commit 3897301a0d
6 changed files with 56 additions and 18 deletions
+2 -1
View File
@@ -1017,7 +1017,8 @@ static int ui_classify(module_t *m, uint64_t root, int x, int y, char *hit, size
// The settings page covers the pause menu, yet the pause menu's buttons still receive clicks (the game's dispatch does not look at who is on top): on a pause menu button and not on a clickable widget of the settings page = covered, do not click (same as "on a button covered by an upper panel").
// Previously, while the settings page was open the whole pause menu layer was set invisible and written back on close - that is writing to the original game's widgets, violating the no-writes-to-original-widgets rule; changed to blocking here only on a hit
{ uint64_t st = ui_panel(root, "SettingsPanel"), xy = (uint64_t)(uint32_t)x | ((uint64_t)(uint32_t)y << 32);
if (st && *(uint8_t *)(st + 0x50) && !click_walk(st, xy, 1, (uint64_t)m->base)) { // 设置页自己可点的控件照常;点在它的底板 / 列表空处时,游戏会把这一下交给底下的暂停菜单按钮 | The settings page's own clickable widgets work as usual; when the tap is on its backing / empty list space, the game would hand this tap to the pause menu button underneath
uint64_t cp = ui_panel(root, "VideoOptionsPanel"); // 自定义页(借的视频页)与设置页并列、不是它的子控件:这一页上的勾选框也算「设置页自己可点的控件」(语言行的「中文」那格正落在暂停菜单按钮的位置上) | The Custom page (the borrowed video page) sits beside the settings page and is not its child: checkboxes on this page also count as "controls of the settings page itself that can be tapped" (the 「中文」 box of the language row lands exactly where the pause menu button is)
if (st && *(uint8_t *)(st + 0x50) && !click_walk(st, xy, 1, (uint64_t)m->base) && !(cp && *(uint8_t *)(cp + 0x50) && click_walk(cp, xy, 1, (uint64_t)m->base))) { // 设置页自己可点的控件照常;点在它的底板 / 列表空处时,游戏会把这一下交给底下的暂停菜单按钮 | The settings page's own clickable widgets work as usual; when the tap is on its backing / empty list space, the game would hand this tap to the pause menu button underneath
static const char *const pl[] = { "PauseLayoutGarden", "PauseLayout" };
for (int i = 0; i < 2; i++) { uint64_t pw = ui_panel(root, pl[i]); if (pw && *(uint8_t *)(pw + 0x50) && click_walk(pw, xy, 1, (uint64_t)m->base)) { snprintf(hit, hn, "设置页盖着的暂停菜单按钮(不点,可滚)"); return 11; } /* 11:这一下不点下去,但从这里起手上下拖照常滚设置页的列表(自定义页各行的文字不是可点控件,玩家多半就在文字上滑) | 11: this tap is not pressed down, but a vertical drag starting here still scrolls the settings page list as usual (the text of the rows on the Custom page is not a clickable widget, and players mostly swipe right on the text) */ } } }
const char *mn = ""; uint64_t mp = modal_top(m, root, &mn);