diff --git a/include/instructions.h b/include/instructions.h index 53a1f3f..6490e93 100644 --- a/include/instructions.h +++ b/include/instructions.h @@ -39,7 +39,7 @@ Instructions_s normal_instructions[MODE_AMOUNT] = { L"\uE001 Queue shuffle theme" }, { - L"\uE002 Reload broken icons", + L"\uE002 Hold for more", L"\uE003 Preview theme" }, { @@ -60,7 +60,7 @@ Instructions_s normal_instructions[MODE_AMOUNT] = { L"\uE001 Delete installed splash" }, { - L"\uE002 Reload broken icons", + L"\uE002 Hold for more", 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 \ No newline at end of file diff --git a/source/main.c b/source/main.c index 506e66c..7543c16 100644 --- a/source/main.c +++ b/source/main.c @@ -315,6 +315,7 @@ int main(void) bool qr_mode = false; bool install_mode = false; + bool extra_mode = false; while(aptMainLoop()) { @@ -343,6 +344,8 @@ int main(void) Instructions_s instructions = normal_instructions[current_mode]; if(install_mode) instructions = install_instructions; + if(extra_mode) + instructions = extra_instructions; if(qr_mode) take_picture(); else if(preview_mode) draw_preview(TEXTURE_PREVIEW, preview_offset); @@ -366,7 +369,7 @@ int main(void) 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 { @@ -516,6 +519,38 @@ int main(void) } 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 @@ -554,17 +589,7 @@ int main(void) } else if(kDown & KEY_X) { - switch(current_mode) - { - case MODE_THEMES: - load_icons_first(current_list, false); - break; - case MODE_SPLASHES: - load_icons_first(current_list, false); - break; - default: - break; - } + extra_mode = true; } else if(kDown & KEY_SELECT) { @@ -646,11 +671,7 @@ int main(void) } else if(BETWEEN(320-96, x, 320-72)) { - if(themeplaza_browser(current_mode)) - { - current_mode = MODE_THEMES; - load_lists(lists); - } + goto browse_themeplaza; } 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)) { - jump_menu(current_list); + goto jump; } } } diff --git a/source/remote.c b/source/remote.c index a4c311c..c245039 100644 --- a/source/remote.c +++ b/source/remote.c @@ -39,7 +39,7 @@ static Instructions_s browser_instructions[MODE_AMOUNT] = { L"\uE001 Go back" }, { - NULL, + L"\uE002 Hold for more", L"\uE003 Preview theme" }, { @@ -60,7 +60,7 @@ static Instructions_s browser_instructions[MODE_AMOUNT] = { L"\uE001 Go back" }, { - NULL, + L"\uE002 Hold for more", 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) { char * entry_json = NULL; @@ -408,6 +431,8 @@ bool themeplaza_browser(EntryMode mode) current_list->tp_search = strdup(""); load_remote_list(current_list, 1, mode); + bool extra_mode = false; + while(aptMainLoop()) { if(current_list->entries == NULL) @@ -416,7 +441,12 @@ bool themeplaza_browser(EntryMode mode) if(preview_mode) draw_preview(TEXTURE_REMOTE_PREVIEW, preview_offset); 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(); hidScanInput(); @@ -424,13 +454,49 @@ bool themeplaza_browser(EntryMode mode) u32 kHeld = hidKeysHeld(); u32 kUp = hidKeysUp(); + + if(kDown & KEY_START) { + exit: quit = true; downloaded = false; 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; Entry_s * current_entry = ¤t_list->entries[selected_entry]; @@ -458,7 +524,10 @@ bool themeplaza_browser(EntryMode mode) download_remote_entry(current_entry, mode); downloaded = true; } - + else if(kDown & KEY_X) + { + extra_mode = true; + } else if(kDown & KEY_L) { 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)) { - quit = true; - downloaded = false; - break; + goto exit; } else if(BETWEEN(320-48, x, 320-24)) { @@ -550,13 +617,7 @@ bool themeplaza_browser(EntryMode mode) } else if(BETWEEN(320-24, x, 320)) { - mode++; - mode %= MODE_AMOUNT; - - free(current_list->tp_search); - current_list->tp_search = strdup(""); - - load_remote_list(current_list, 1, mode); + goto change_mode; } } else if(BETWEEN(240-24, y, 240) && BETWEEN(176, x, 320))