From 4af7d5741b919967d122008da0092951baaf96fc Mon Sep 17 00:00:00 2001 From: Alex Taber Date: Fri, 1 Sep 2017 00:44:43 -0400 Subject: [PATCH] Add install indicators --- include/draw.h | 1 + source/draw.c | 14 ++++++++------ source/main.c | 4 ++++ 3 files changed, 13 insertions(+), 6 deletions(-) diff --git a/include/draw.h b/include/draw.h index 832881d..3643add 100644 --- a/include/draw.h +++ b/include/draw.h @@ -33,5 +33,6 @@ void init_screens(void); void exit_screens(void); void draw_theme_interface(Theme_s * themes_list, int theme_count, int selected_theme, bool preview_mode); +void draw_theme_install(bool shuffle_install); #endif \ No newline at end of file diff --git a/source/draw.c b/source/draw.c index faae08a..97c2e37 100644 --- a/source/draw.c +++ b/source/draw.c @@ -71,12 +71,6 @@ static Result MCUHWC_GetBatteryLevel(u8 *out) // Code taken from daedreth's fork static int vertical_scroll = 0; -// static const int FRAMES_FOR_TEXT_SCROLL = 40; -// static int frames_count = 0; -// static int horizontal_scroll = 0; -// static int previous_selected = 0; -// static int horizontal_scroll_change = 1; - void draw_base_interface(void) { pp2d_begin_draw(GFX_TOP); @@ -98,6 +92,14 @@ void draw_base_interface(void) pp2d_draw_rectangle(0, 216, 320, 24, COLOR_ACCENT); pp2d_draw_on(GFX_TOP); } + +void draw_theme_install(bool shuffle_install) +{ + draw_base_interface(); + pp2d_draw_textf(20, 30, 0.7, 0.7, COLOR_WHITE, "Installing a %s theme...", !shuffle_install ? "single" : "shuffle"); + pp2d_end_draw(); +} + void draw_theme_interface(Theme_s * themes_list, int theme_count, int selected_theme, bool preview_mode) { diff --git a/source/main.c b/source/main.c index 02e2e14..99e5df1 100644 --- a/source/main.c +++ b/source/main.c @@ -99,6 +99,7 @@ int main(void) } else if (kDown & KEY_A) { + draw_theme_install(false); single_install(*current_theme); } @@ -120,7 +121,10 @@ int main(void) else if (kDown & KEY_SELECT) { if (shuffle_theme_count > 0) + { + draw_theme_install(true); shuffle_install(themes_list, theme_count); + } } // Movement in the UI