mirror of
https://git.triforceproject.com/triforce/source
synced 2026-12-01 05:18:50 -04:00
Triforce v0.9.0
Character tab, faster renderer defaults, HD rumble shipped, and the 11-30 bug pass: ending softlock below 60 fps, adult first-night lock, Intel Arc robust buffers, adult map, randomizer load order.
This commit is contained in:
@@ -78,4 +78,33 @@ inline int at(const Layout& l, float x, float y) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
// ((Triforce, 11-30) two players, on an Xbox and a PlayStation controller: "The X is supposed to open up the Mod Menu but
|
||||
// instead it is opening up the save selection; the Y is supposed to open up the Save selection but instead it's opening up
|
||||
// the Mod menu". A tab opens with the pad input the Switch's X or Y is bound to (vk_menu.cpp menu_tick: the top face button
|
||||
// for Mods by default, Y on an Xbox pad, Triangle on a PlayStation one), but its prompt was the Switch button's own code
|
||||
// (U+E042, U+E043), which is that input's icon only in a font the host pointed at this run's controls at the start
|
||||
// (host/prompts.c cmap4_bind). In the game's own font (no prompts folder from Setup: "the game shows its own icons"), and
|
||||
// on a key's cap without a font ("X", "Y"), it is the Switch's letter: on an Xbox or PlayStation pad, the other button's
|
||||
// name. Controls changed during the run were not followed either (the overlay reads the font once). The prompt now names
|
||||
// the input itself, as the button test reads it: the icon font's own icon of that input on the face shown, else its name)
|
||||
constexpr unsigned kPadBase = 0xF700; // (the font's own face's icon of each pad input: host/prompts.c PAD_BASE)
|
||||
constexpr unsigned kFaceBase = 0xF800, kFaceCodes = 32; // (each controller face's icons: host/prompts.c FACE_BASE, FACE_CODES)
|
||||
/// The icon font's codes that may have the icon of pad input `input` on controller face `face` (HOS_PROMPT_*; faces: how many
|
||||
/// faces have icons there, inputs: how many pad inputs have one), the first to look for first: that face's own (a font with
|
||||
/// every face's, nx2/prompt_assets.py faces_font), then the font's own face's (one built before those). 0 0 for none
|
||||
inline void icon_codes(int face, int input, int faces, int inputs, unsigned out[2]) {
|
||||
out[0] = out[1] = 0;
|
||||
if (face < 0 || face >= faces || input < 0 || input >= inputs || input >= (int)kFaceCodes) return;
|
||||
out[0] = kFaceBase + kFaceCodes * (unsigned)face + (unsigned)input;
|
||||
out[1] = kPadBase + (unsigned)input;
|
||||
}
|
||||
/// code as UTF-8 in out (the text ImGui draws); "" for 0 or a code past U+FFFF (the icons are all under it)
|
||||
inline const char* utf8(unsigned code, char out[4]) {
|
||||
if (!code || code > 0xFFFF) out[0] = 0;
|
||||
else if (code < 0x80) out[0] = (char)code, out[1] = 0;
|
||||
else if (code < 0x800) out[0] = (char)(0xC0 | code >> 6), out[1] = (char)(0x80 | (code & 0x3F)), out[2] = 0;
|
||||
else out[0] = (char)(0xE0 | code >> 12), out[1] = (char)(0x80 | (code >> 6 & 0x3F)), out[2] = (char)(0x80 | (code & 0x3F)), out[3] = 0;
|
||||
return out;
|
||||
}
|
||||
|
||||
} // namespace mkwvk::title_tabs
|
||||
|
||||
Reference in New Issue
Block a user