From b19343e2384e4da1c13397d9623f5e0ea0faf572 Mon Sep 17 00:00:00 2001 From: Alex Taber Date: Wed, 24 Apr 2024 23:37:13 -0400 Subject: [PATCH] Draw no home icon in theme plaza browser --- source/main.c | 8 ++++---- source/remote.c | 15 +++++++++++++++ 2 files changed, 19 insertions(+), 4 deletions(-) diff --git a/source/main.c b/source/main.c index 78e7dd8..f120276 100644 --- a/source/main.c +++ b/source/main.c @@ -40,8 +40,8 @@ bool dspfirm = false; static audio_s * audio = NULL; static bool homebrew = false; static bool installed_themes = false; -static bool home_displayed = false; -static u64 time_home_pressed = 0; +bool home_displayed = false; +u64 time_home_pressed = 0; static Thread iconLoadingThread = {0}; static Thread_Arg_s iconLoadingThread_arg = {0}; @@ -382,10 +382,10 @@ int main(void) } if (aptCheckHomePressRejected() && !home_displayed) - { + { time_home_pressed = svcGetSystemTick() / CPU_TICKS_PER_MSEC; home_displayed = true; - } + } #ifndef CITRA_MODE if(R_FAILED(archive_result) && current_mode == MODE_THEMES) diff --git a/source/remote.c b/source/remote.c index bc67b3b..be4522e 100644 --- a/source/remote.c +++ b/source/remote.c @@ -501,12 +501,20 @@ bool themeplaza_browser(EntryMode mode) C2D_Image preview = { 0 }; bool extra_mode = false; + extern u64 time_home_pressed; + extern bool home_displayed; while (aptMainLoop() && !quit) { if (current_list->entries == NULL) break; + if (aptCheckHomePressRejected() && !home_displayed) + { + time_home_pressed = svcGetSystemTick() / CPU_TICKS_PER_MSEC; + home_displayed = true; + } + if (preview_mode) { draw_preview(preview, preview_offset); @@ -518,6 +526,13 @@ bool themeplaza_browser(EntryMode mode) instructions = extra_instructions; draw_grid_interface(current_list, instructions); } + + if (home_displayed) + { + u64 cur_time = svcGetSystemTick() / CPU_TICKS_PER_MSEC; + draw_home(time_home_pressed, cur_time); + if (cur_time - time_home_pressed > 2000) home_displayed = false; + } end_frame(); hidScanInput();