use X for extra options, behaves like A for installing themes
This commit is contained in:
@@ -39,7 +39,7 @@ Instructions_s normal_instructions[MODE_AMOUNT] = {
|
|||||||
L"\uE001 Queue shuffle theme"
|
L"\uE001 Queue shuffle theme"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
L"\uE002 Reload broken icons",
|
L"\uE002 Hold for more",
|
||||||
L"\uE003 Preview theme"
|
L"\uE003 Preview theme"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -60,7 +60,7 @@ Instructions_s normal_instructions[MODE_AMOUNT] = {
|
|||||||
L"\uE001 Delete installed splash"
|
L"\uE001 Delete installed splash"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
L"\uE002 Reload broken icons",
|
L"\uE002 Hold for more",
|
||||||
L"\uE003 Preview splash"
|
L"\uE003 Preview splash"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -98,4 +98,27 @@ Instructions_s install_instructions = {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Instructions_s extra_instructions = {
|
||||||
|
.info_line = L"Release \uE002 to cancel or hold \uE006 and release \uE002 to do stuff",
|
||||||
|
.info_line_color = COLOR_WHITE,
|
||||||
|
.instructions = {
|
||||||
|
{
|
||||||
|
L"\uE079 Jump in the list",
|
||||||
|
L"\uE07A Reload broken icons"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
L"\uE07B Browse ThemePlaza",
|
||||||
|
NULL
|
||||||
|
},
|
||||||
|
{
|
||||||
|
NULL,
|
||||||
|
NULL
|
||||||
|
},
|
||||||
|
{
|
||||||
|
L"Exit",
|
||||||
|
NULL
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
@@ -315,6 +315,7 @@ int main(void)
|
|||||||
|
|
||||||
bool qr_mode = false;
|
bool qr_mode = false;
|
||||||
bool install_mode = false;
|
bool install_mode = false;
|
||||||
|
bool extra_mode = false;
|
||||||
|
|
||||||
while(aptMainLoop())
|
while(aptMainLoop())
|
||||||
{
|
{
|
||||||
@@ -343,6 +344,8 @@ int main(void)
|
|||||||
Instructions_s instructions = normal_instructions[current_mode];
|
Instructions_s instructions = normal_instructions[current_mode];
|
||||||
if(install_mode)
|
if(install_mode)
|
||||||
instructions = install_instructions;
|
instructions = install_instructions;
|
||||||
|
if(extra_mode)
|
||||||
|
instructions = extra_instructions;
|
||||||
|
|
||||||
if(qr_mode) take_picture();
|
if(qr_mode) take_picture();
|
||||||
else if(preview_mode) draw_preview(TEXTURE_PREVIEW, preview_offset);
|
else if(preview_mode) draw_preview(TEXTURE_PREVIEW, preview_offset);
|
||||||
@@ -366,7 +369,7 @@ int main(void)
|
|||||||
|
|
||||||
if(kDown & KEY_START) quit = true;
|
if(kDown & KEY_START) quit = true;
|
||||||
|
|
||||||
if(!install_mode)
|
if(!install_mode && !extra_mode)
|
||||||
{
|
{
|
||||||
if(!preview_mode && !qr_mode && kDown & KEY_L) //toggle between splashes and themes
|
if(!preview_mode && !qr_mode && kDown & KEY_L) //toggle between splashes and themes
|
||||||
{
|
{
|
||||||
@@ -516,6 +519,38 @@ int main(void)
|
|||||||
}
|
}
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
else if(extra_mode)
|
||||||
|
{
|
||||||
|
if(kUp & KEY_X)
|
||||||
|
extra_mode = false;
|
||||||
|
if(!extra_mode)
|
||||||
|
{
|
||||||
|
if((kDown | kHeld) & KEY_DLEFT)
|
||||||
|
{
|
||||||
|
browse_themeplaza:
|
||||||
|
if(themeplaza_browser(current_mode))
|
||||||
|
{
|
||||||
|
current_mode = MODE_THEMES;
|
||||||
|
load_lists(lists);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if((kDown | kHeld) & KEY_DUP)
|
||||||
|
{
|
||||||
|
jump:
|
||||||
|
jump_menu(current_list);
|
||||||
|
|
||||||
|
}
|
||||||
|
else if((kDown | kHeld) & KEY_DRIGHT)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
else if((kDown | kHeld) & KEY_DDOWN)
|
||||||
|
{
|
||||||
|
load_icons_first(current_list, false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
// Actions
|
// Actions
|
||||||
|
|
||||||
@@ -554,17 +589,7 @@ int main(void)
|
|||||||
}
|
}
|
||||||
else if(kDown & KEY_X)
|
else if(kDown & KEY_X)
|
||||||
{
|
{
|
||||||
switch(current_mode)
|
extra_mode = true;
|
||||||
{
|
|
||||||
case MODE_THEMES:
|
|
||||||
load_icons_first(current_list, false);
|
|
||||||
break;
|
|
||||||
case MODE_SPLASHES:
|
|
||||||
load_icons_first(current_list, false);
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else if(kDown & KEY_SELECT)
|
else if(kDown & KEY_SELECT)
|
||||||
{
|
{
|
||||||
@@ -646,11 +671,7 @@ int main(void)
|
|||||||
}
|
}
|
||||||
else if(BETWEEN(320-96, x, 320-72))
|
else if(BETWEEN(320-96, x, 320-72))
|
||||||
{
|
{
|
||||||
if(themeplaza_browser(current_mode))
|
goto browse_themeplaza;
|
||||||
{
|
|
||||||
current_mode = MODE_THEMES;
|
|
||||||
load_lists(lists);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else if(BETWEEN(320-72, x, 320-48))
|
else if(BETWEEN(320-72, x, 320-48))
|
||||||
{
|
{
|
||||||
@@ -673,7 +694,7 @@ int main(void)
|
|||||||
}
|
}
|
||||||
else if(current_list->entries != NULL && BETWEEN(176, x, 320))
|
else if(current_list->entries != NULL && BETWEEN(176, x, 320))
|
||||||
{
|
{
|
||||||
jump_menu(current_list);
|
goto jump;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ static Instructions_s browser_instructions[MODE_AMOUNT] = {
|
|||||||
L"\uE001 Go back"
|
L"\uE001 Go back"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
NULL,
|
L"\uE002 Hold for more",
|
||||||
L"\uE003 Preview theme"
|
L"\uE003 Preview theme"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -60,7 +60,7 @@ static Instructions_s browser_instructions[MODE_AMOUNT] = {
|
|||||||
L"\uE001 Go back"
|
L"\uE001 Go back"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
NULL,
|
L"\uE002 Hold for more",
|
||||||
L"\uE003 Preview splash"
|
L"\uE003 Preview splash"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -75,6 +75,29 @@ static Instructions_s browser_instructions[MODE_AMOUNT] = {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
static Instructions_s extra_instructions = {
|
||||||
|
.info_line = L"Release \uE002 to cancel or hold \uE006 and release \uE002 to do stuff",
|
||||||
|
.info_line_color = COLOR_WHITE,
|
||||||
|
.instructions = {
|
||||||
|
{
|
||||||
|
L"\uE079 Jump to page",
|
||||||
|
L"\uE07A Search tags"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
L"\uE07B Toggle splash/theme",
|
||||||
|
NULL
|
||||||
|
},
|
||||||
|
{
|
||||||
|
NULL,
|
||||||
|
NULL
|
||||||
|
},
|
||||||
|
{
|
||||||
|
L"Exit",
|
||||||
|
NULL
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
static void load_remote_entry(Entry_s * entry)
|
static void load_remote_entry(Entry_s * entry)
|
||||||
{
|
{
|
||||||
char * entry_json = NULL;
|
char * entry_json = NULL;
|
||||||
@@ -408,6 +431,8 @@ bool themeplaza_browser(EntryMode mode)
|
|||||||
current_list->tp_search = strdup("");
|
current_list->tp_search = strdup("");
|
||||||
load_remote_list(current_list, 1, mode);
|
load_remote_list(current_list, 1, mode);
|
||||||
|
|
||||||
|
bool extra_mode = false;
|
||||||
|
|
||||||
while(aptMainLoop())
|
while(aptMainLoop())
|
||||||
{
|
{
|
||||||
if(current_list->entries == NULL)
|
if(current_list->entries == NULL)
|
||||||
@@ -416,7 +441,12 @@ bool themeplaza_browser(EntryMode mode)
|
|||||||
if(preview_mode)
|
if(preview_mode)
|
||||||
draw_preview(TEXTURE_REMOTE_PREVIEW, preview_offset);
|
draw_preview(TEXTURE_REMOTE_PREVIEW, preview_offset);
|
||||||
else
|
else
|
||||||
draw_grid_interface(current_list, browser_instructions[mode]);
|
{
|
||||||
|
Instructions_s instructions = browser_instructions[mode];
|
||||||
|
if(extra_mode)
|
||||||
|
instructions = extra_instructions;
|
||||||
|
draw_grid_interface(current_list, instructions);
|
||||||
|
}
|
||||||
pp2d_end_draw();
|
pp2d_end_draw();
|
||||||
|
|
||||||
hidScanInput();
|
hidScanInput();
|
||||||
@@ -424,13 +454,49 @@ bool themeplaza_browser(EntryMode mode)
|
|||||||
u32 kHeld = hidKeysHeld();
|
u32 kHeld = hidKeysHeld();
|
||||||
u32 kUp = hidKeysUp();
|
u32 kUp = hidKeysUp();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if(kDown & KEY_START)
|
if(kDown & KEY_START)
|
||||||
{
|
{
|
||||||
|
exit:
|
||||||
quit = true;
|
quit = true;
|
||||||
downloaded = false;
|
downloaded = false;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(extra_mode)
|
||||||
|
{
|
||||||
|
if(kUp & KEY_X)
|
||||||
|
extra_mode = false;
|
||||||
|
if(!extra_mode)
|
||||||
|
{
|
||||||
|
if((kDown | kHeld) & KEY_DLEFT)
|
||||||
|
{
|
||||||
|
change_mode:
|
||||||
|
mode++;
|
||||||
|
mode %= MODE_AMOUNT;
|
||||||
|
|
||||||
|
free(current_list->tp_search);
|
||||||
|
current_list->tp_search = strdup("");
|
||||||
|
|
||||||
|
load_remote_list(current_list, 1, mode);
|
||||||
|
}
|
||||||
|
else if((kDown | kHeld) & KEY_DUP)
|
||||||
|
{
|
||||||
|
jump_menu(current_list);
|
||||||
|
}
|
||||||
|
else if((kDown | kHeld) & KEY_DRIGHT)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
else if((kDown | kHeld) & KEY_DDOWN)
|
||||||
|
{
|
||||||
|
search_menu(current_list);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
int selected_entry = current_list->selected_entry;
|
int selected_entry = current_list->selected_entry;
|
||||||
Entry_s * current_entry = ¤t_list->entries[selected_entry];
|
Entry_s * current_entry = ¤t_list->entries[selected_entry];
|
||||||
|
|
||||||
@@ -458,7 +524,10 @@ bool themeplaza_browser(EntryMode mode)
|
|||||||
download_remote_entry(current_entry, mode);
|
download_remote_entry(current_entry, mode);
|
||||||
downloaded = true;
|
downloaded = true;
|
||||||
}
|
}
|
||||||
|
else if(kDown & KEY_X)
|
||||||
|
{
|
||||||
|
extra_mode = true;
|
||||||
|
}
|
||||||
else if(kDown & KEY_L)
|
else if(kDown & KEY_L)
|
||||||
{
|
{
|
||||||
load_remote_list(current_list, current_list->tp_current_page-1, mode);
|
load_remote_list(current_list, current_list->tp_current_page-1, mode);
|
||||||
@@ -540,9 +609,7 @@ bool themeplaza_browser(EntryMode mode)
|
|||||||
}
|
}
|
||||||
else if(BETWEEN(320-72, x, 320-48))
|
else if(BETWEEN(320-72, x, 320-48))
|
||||||
{
|
{
|
||||||
quit = true;
|
goto exit;
|
||||||
downloaded = false;
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
else if(BETWEEN(320-48, x, 320-24))
|
else if(BETWEEN(320-48, x, 320-24))
|
||||||
{
|
{
|
||||||
@@ -550,13 +617,7 @@ bool themeplaza_browser(EntryMode mode)
|
|||||||
}
|
}
|
||||||
else if(BETWEEN(320-24, x, 320))
|
else if(BETWEEN(320-24, x, 320))
|
||||||
{
|
{
|
||||||
mode++;
|
goto change_mode;
|
||||||
mode %= MODE_AMOUNT;
|
|
||||||
|
|
||||||
free(current_list->tp_search);
|
|
||||||
current_list->tp_search = strdup("");
|
|
||||||
|
|
||||||
load_remote_list(current_list, 1, mode);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if(BETWEEN(240-24, y, 240) && BETWEEN(176, x, 320))
|
else if(BETWEEN(240-24, y, 240) && BETWEEN(176, x, 320))
|
||||||
|
|||||||
Reference in New Issue
Block a user