diff --git a/.DS_Store b/.DS_Store index 6e85d682..0630b334 100644 Binary files a/.DS_Store and b/.DS_Store differ diff --git a/nyx/nyx_gui/frontend/gui.c b/nyx/nyx_gui/frontend/gui.c index 00b18eae..f49f908a 100644 --- a/nyx/nyx_gui/frontend/gui.c +++ b/nyx/nyx_gui/frontend/gui.c @@ -2010,18 +2010,79 @@ failed_sd_mount: return LV_RES_OK; } +// Fills buf with theme-colored brand text: "hekate | OmniNX X.X.X Pack" from manifest.ini, or "hekate" if missing. +static void _get_home_brand_text(char *buf, size_t buf_size) +{ + static const char * const manifest_paths[] = { + "config/omninx/manifest.ini", + "bootloader/config/omninx/manifest.ini", + }; + // SD is unmounted when the main menu is built; mount so we can read the manifest. + sd_mount(); + link_t ini_sections; + list_init(&ini_sections); + int parsed = 0; + for (u32 p = 0; p < sizeof(manifest_paths) / sizeof(manifest_paths[0]) && !parsed; p++) + parsed = ini_parse(&ini_sections, manifest_paths[p], false); + if (!parsed) + { + s_printf(buf, "%s%s", text_color, " hekate#"); + return; + } + const char *version = NULL; + const char *pack = NULL; + LIST_FOREACH_ENTRY(ini_sec_t, ini_sec, &ini_sections, link) + { + if (ini_sec->type != INI_CHOICE) + continue; + // Accept [OmniNX] or [omninx] (case-insensitive). + const char *n = ini_sec->name; + if ((n[0] != 'O' && n[0] != 'o') || (n[1] != 'm' && n[1] != 'M') || + (n[2] != 'n' && n[2] != 'N') || (n[3] != 'i' && n[3] != 'I') || + (n[4] != 'N' && n[4] != 'n') || (n[5] != 'X' && n[5] != 'x') || n[6] != '\0') + continue; + LIST_FOREACH_ENTRY(ini_kv_t, kv, &ini_sec->kvs, link) + { + if (!strcmp(kv->key, "version")) + version = kv->val; + else if (!strcmp(kv->key, "current_pack")) + pack = kv->val; + else if (!pack && !strcmp(kv->key, "channel_pack")) + pack = kv->val; + } + break; + } + ini_free(&ini_sections); + if (!version || !pack) + { + s_printf(buf, "%s%s", text_color, " hekate#"); + return; + } + // Capitalize first letter of pack for display (e.g. light -> Light). + char pack_display[24]; + size_t i = 0; + while (pack[i] && i < sizeof(pack_display) - 1) + { + pack_display[i] = (i == 0 && pack[0] >= 'a' && pack[0] <= 'z') + ? (char)(pack[0] - 'a' + 'A') : pack[i]; + i++; + } + pack_display[i] = '\0'; + s_printf(buf, "%s hekate | OmniNX %s %s#", text_color, pack_display, version); +} + static void _create_tab_home(lv_theme_t *th, lv_obj_t *parent) { lv_page_set_scrl_layout(parent, LV_LAYOUT_OFF); lv_page_set_scrl_fit(parent, false, false); lv_page_set_scrl_height(parent, 592); - char btn_colored_text[64]; + char btn_colored_text[96]; - // Set brand label. + // Set brand label (from OmniNX manifest if present, else "hekate"). lv_obj_t *label_brand = lv_label_create(parent, NULL); lv_label_set_recolor(label_brand, true); - s_printf(btn_colored_text, "%s%s", text_color, " hekate#"); + _get_home_brand_text(btn_colored_text, sizeof(btn_colored_text)); lv_label_set_text(label_brand, btn_colored_text); lv_obj_set_pos(label_brand, 50, 48);