mirror of
https://git.triforceproject.com/triforce/source
synced 2026-11-29 04:18:49 -04:00
Triforce v0.8.5
A Randomizer page in the launcher, a new title screen with Mods and Save Select tabs, scaling changes applied in game, the Jabu-Jabu bars fixed, renderer frame-time work and the brightness-flash fix, and fixes from the 0.8.4 reports.
This commit is contained in:
@@ -718,7 +718,7 @@ static void mouse_tick_locked(Ctx *c, uint64_t screen) {
|
||||
if (moved && !hit.hit && !rx_option(HOS_OPT_MODS_SELECTED, 0)) {
|
||||
const int onto = mods_entry_hit(hit.x, hit.y) ? 1 : quit_entry_hit(hit.x, hit.y) ? 4 : 0;
|
||||
if (onto) rx_option_set(HOS_OPT_MODS_ENTER, onto);
|
||||
if (onto && trace) hos_log("menu: mouse (%.0f, %.0f): onto the %s entry", hit.x, hit.y, onto == 1 ? "Mods" : "Quit");
|
||||
if (onto && trace) hos_log("menu: mouse (%.0f, %.0f): onto the %s entry", hit.x, hit.y, onto == 1 ? "Mods (the title's: Quit Game)" : "Quit");
|
||||
}
|
||||
/* hover: the focus to the button under the mouse, only as it moves (the pad keeps the focus it moved) */
|
||||
int just = 0;
|
||||
@@ -919,7 +919,12 @@ extern volatile LONG64 hos_present_count; /* (display.c: the game's own presen
|
||||
static Rect mods_entry; /* (the entry's box, as the renderer draws it: under the last button by the pitch) */
|
||||
static Rect quit_entry; /* ((Triforce, 11-19) Quit's, under Mods by the pitch; empty on the title's list */
|
||||
static volatile LONG64 mods_entry_ns;
|
||||
int hos_save_files_on(void); /* ((Triforce) host/save_files.c: on the title the entry under Mods is Save Select then) */
|
||||
/* ((Triforce) the owner: "move the mod tab and the save select tab to the top left of the screen ... Add a quit game option
|
||||
below the Options tab". On the title the entry under the list's last button is Quit Game now, and Mods and Save Select are
|
||||
tabs at the picture's top left, drawn and clicked in the renderer (gpu/vk/vk_menu.cpp draw_title_tabs, title_tabs.h): the
|
||||
list last told of was the title's */
|
||||
static volatile LONG mods_entry_title;
|
||||
int hos_save_files_on(void); /* ((Triforce) host/save_files.c: the title has its Save Select tab then) */
|
||||
typedef struct { Rect r[16]; uint64_t b[16]; int n, pause; } ModsList;
|
||||
static void mods_list_entry(int i, uint64_t entry, uint64_t button, void *arg) {
|
||||
(void)i, (void)entry;
|
||||
@@ -1013,6 +1018,12 @@ static void mods_list_tick(uint64_t screen, int title, ModsCall *call) {
|
||||
Anything but a number from 0 to 1 there: all of it, as before) */
|
||||
float alpha = 1.0f;
|
||||
if (!peek(peek64(l.b[last] + 0x58) + 0x78, &alpha, 4) || !(alpha >= 0.0f && alpha <= 1.0f)) alpha = 1.0f;
|
||||
if (trace && !title) { /* ((Triforce, 11-26) HOS_MENU_TRACE: the System list's buttons' amount as it changes, and its frame: how the
|
||||
pause menu closes, the owner's Mods and Quit left on the game after it) */
|
||||
static float told = -1.0f;
|
||||
if (alpha != told) hos_log("menu: mods entry: the System list's buttons at %.3f (present %lld)", alpha,
|
||||
(long long)InterlockedCompareExchange64(&hos_present_count, 0, 0)), told = alpha;
|
||||
}
|
||||
/* The button's state byte (+56) is its focus animation's: 0 none, 1 coming, 3 focused, 2 going. While Mods has the
|
||||
cursor the game gets no input (nn_hid.c) and its last button is let go (mods_held, above) */
|
||||
uint8_t state = 0;
|
||||
@@ -1044,6 +1055,11 @@ static void mods_list_tick(uint64_t screen, int title, ModsCall *call) {
|
||||
Mods has the cursor */
|
||||
int pend = 0;
|
||||
if (!mods_cursor_button(screen, &pend) && !mods_held.button) {
|
||||
static int64_t left_told; /* ((Triforce, 11-26) HOS_MENU_TRACE: the game's cursor gone from the System list, once a run of it */
|
||||
if (trace && !title && now - left_told > 500000000LL)
|
||||
hos_log("menu: mods entry: the game's cursor left the System list (its buttons at %.3f, present %lld)", alpha,
|
||||
(long long)InterlockedCompareExchange64(&hos_present_count, 0, 0));
|
||||
if (!title) left_told = now;
|
||||
/* ((Triforce, 11-20) the game's buttons are hidden too (Options or the Load list opened over the title: their
|
||||
alpha goes to 0 on that frame): said, not left to the renderer's 150 ms without a report, so the entry
|
||||
goes on the frame they do. With the buttons still showing (the cursor between two of them for a frame) it
|
||||
@@ -1064,14 +1080,10 @@ static void mods_list_tick(uint64_t screen, int title, ModsCall *call) {
|
||||
const float mx = (r.x0 + r.x1) / 2, my = (r.y0 + r.y1) / 2 - pitch;
|
||||
mods_entry = (Rect){mx - 550, my - pitch / 2, mx + 550, my + pitch / 2};
|
||||
}
|
||||
/* ((Triforce) the title's list has the one entry, Quit Game: Save Select, a pitch under it before, is a tab at the top
|
||||
left now, as Mods is (hos_oot_title_tabs) */
|
||||
quit_entry = title ? (Rect){0, 0, 0, 0} : (Rect){r.x0, r.y0 - 2 * pitch, r.x1, r.y1 - 2 * pitch};
|
||||
/* ((Triforce) on the title, while the save files are on (host/save_files.c), the entry under Mods is Save Select: a line
|
||||
of the title's list as Mods is one, a pitch lower. Its words are Quit's (3 clicked, 4 the mouse onto it): the renderer
|
||||
knows by the list which of the two it draws there (vk_menu.cpp files_row_shown) */
|
||||
if (title && hos_save_files_on()) {
|
||||
const float mx = (r.x0 + r.x1) / 2, my = (r.y0 + r.y1) / 2 - 2 * pitch;
|
||||
quit_entry = (Rect){mx - 550, my - pitch / 2, mx + 550, my + pitch / 2};
|
||||
}
|
||||
InterlockedExchange(&mods_entry_title, title);
|
||||
if (alpha >= 0.5f) InterlockedExchange64(&mods_entry_ns, (LONG64)now); /* (the mouse's: an entry not shown yet is not there to click) */
|
||||
rx_option_set(HOS_OPT_MODS_ALPHA, (int)(alpha * 1000.0f + 0.5f));
|
||||
rx_option_set(HOS_OPT_MODS_X0, (int)r.x0), rx_option_set(HOS_OPT_MODS_X1, (int)r.x1);
|
||||
@@ -1095,6 +1107,14 @@ int hos_oot_mods_down(void) {
|
||||
const LONG64 presents = InterlockedCompareExchange64(&hos_present_count, 0, 0) - InterlockedCompareExchange64(&mods_last_present, 0, 0);
|
||||
return presents >= 0 && presents <= 1;
|
||||
}
|
||||
/* ((Triforce) The title's tabs are there to choose: the title's list was told of with its buttons shown within the last
|
||||
second (as a click on its entry counts). 0 no; else 1, and 2 too while the save files are on (Save Select is one of them).
|
||||
nn_hid.c: a test's scripted X or Y there is the tab's; display.c: a left click there is the renderer's to look at */
|
||||
int hos_oot_title_tabs(void) {
|
||||
const LONG64 t = InterlockedCompareExchange64(&mods_entry_ns, 0, 0);
|
||||
if (!t || (LONG64)hos_now_ns() - t >= 1000000000LL || !InterlockedCompareExchange(&mods_entry_title, 0, 0)) return 0;
|
||||
return 1 | (hos_save_files_on() ? 2 : 0);
|
||||
}
|
||||
static int quit_entry_hit(float x, float y) {
|
||||
const LONG64 t = InterlockedCompareExchange64(&mods_entry_ns, 0, 0);
|
||||
return t && (LONG64)hos_now_ns() - t < 1000000000LL && quit_entry.x1 > quit_entry.x0 && x >= quit_entry.x0 && x <= quit_entry.x1 &&
|
||||
@@ -1302,4 +1322,5 @@ int hos_oot_options_front(void) {
|
||||
has the cursor, so nn_hid.c never keeps a Down from the game. Without it every Linux build of v0.5.0 stopped at the link,
|
||||
"undefined reference to hos_oot_mods_down" (#bug-tracker, 11-18). tests/test_oot_menu_linux_half.py) */
|
||||
int hos_oot_mods_down(void) { return 0; }
|
||||
int hos_oot_title_tabs(void) { return 0; } /* ((Triforce) the title's tabs: the Windows half's too) */
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user