mirror of
https://github.com/tangerineturtle1/NX2navi.git
synced 2026-11-15 19:19:58 -04:00
runtime/menu_assets.c reads them from the user's RomFS at runtime (nothing is shipped): .zs files with the dictionaries of Pack/ZsDic.pack.zs (streamed when a frame does not say its size), the fonts of Font2/Scalable behind their 8-byte header and per-word XOR key, and BNTX textures (Switch 2 archives say "Ounc" where Switch ones say "NX ") through the runtime's block-linear copy and BC4 and ASTC decoders. ui/menu_art.cpp decodes the shared interface archive on a worker at the first present and uploads each texture for Dear ImGui at its first use. The menu now uses ClarimoUDPE for its text (with a sixth more line height) and CetraDisplayPro for its title and tabs, Roboto merged behind both; umber, brown and gold colours; the game's ornamented frame along the window's edge (the art holds two sides and is drawn again turned for the other two); its cursor glow and line around the selected row (edges only, so the label stays readable); and its control-guide bar under Continue and Quit. Without the files it keeps Roboto and plain shapes. The window's pointer is an original gold arrowhead drawn at start for the system DPI. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
27 lines
1.6 KiB
C
27 lines
1.6 KiB
C
// The settings menu's art from the game's own interface textures (ui/menu_art.cpp).
|
|
#pragma once
|
|
#include "imgui.h"
|
|
|
|
typedef enum {
|
|
MENU_ART_CURSOR_GLOW, // the glow of the game's button cursor (white mask; tinted by the caller)
|
|
MENU_ART_CURSOR_LINE, // its outline
|
|
MENU_ART_FRAME_DECO, // a frame with ornamented corners
|
|
MENU_ART_GUIDE_BAR, // the control guide's bar
|
|
MENU_ART_WINDOW_BASE, // a rounded window base
|
|
MENU_ART_COUNT
|
|
} MenuArt;
|
|
|
|
extern "C" void menu_art_start(void); // decodes the textures on a worker, once
|
|
// The texture for the menu's draw lists and its size in pixels; 0 while it is not there (still decoding, or absent).
|
|
// Window thread: the first call for an art uploads it.
|
|
extern "C" int menu_art(MenuArt id, ImTextureID *tex, float *w, float *h);
|
|
extern "C" void menu_art_release(void); // before ImGui's Vulkan back end shuts down
|
|
// Draws an art stretched over [a, b] with a tint; 0 (nothing drawn) while it is not there.
|
|
extern "C" int menu_art_draw(ImDrawList *dl, MenuArt id, ImVec2 a, ImVec2 b, ImU32 tint);
|
|
// Draws an art as nine pieces: corners `corner` pixels on screen from the outer `frac` of the texture, edges stretched,
|
|
// the middle too when fill.
|
|
extern "C" int menu_art_draw9(ImDrawList *dl, MenuArt id, ImVec2 a, ImVec2 b, float corner, float frac, ImU32 tint, int fill);
|
|
// The same with the texture turned half a turn (turned 1): a top-left corner piece drawn at the bottom right.
|
|
extern "C" int menu_art_draw9_turned(ImDrawList *dl, MenuArt id, ImVec2 a, ImVec2 b, float corner, float frac, ImU32 tint, int fill,
|
|
int turned);
|