From 49e6c6f82777f658d663aad55028cfb9e479fe7e Mon Sep 17 00:00:00 2001 From: Alex Taber Date: Sat, 2 Sep 2017 12:16:17 -0400 Subject: [PATCH] Add splash uninstall screen --- include/common.h | 6 ++++-- include/draw.h | 2 +- source/draw.c | 14 ++++++++++++-- source/main.c | 15 ++++++++------- source/splashes.c | 4 ++-- 5 files changed, 27 insertions(+), 14 deletions(-) diff --git a/include/common.h b/include/common.h index 6e44c62..11ce73e 100644 --- a/include/common.h +++ b/include/common.h @@ -35,9 +35,11 @@ #define THEMES_PATH "/Themes/" #define SPLASHES_PATH "/Splashes/" -#define SINGLE_INSTALL 0 -#define SHUFFLE_INSTALL 1 + +#define SINGLE_INSTALL 0 +#define SHUFFLE_INSTALL 1 #define BGM_INSTALL 2 +#define UNINSTALL 3 static const int THEMES_PER_SCREEN = 4; diff --git a/include/draw.h b/include/draw.h index fa4dabb..5010065 100644 --- a/include/draw.h +++ b/include/draw.h @@ -35,7 +35,7 @@ void exit_screens(void); void draw_theme_install(int install_type); void draw_theme_interface(Theme_s * themes_list, int theme_count, int selected_theme, bool preview_mode); -void draw_splash_install(void); +void draw_splash_install(int install_type); void draw_splash_interface(Splash_s *splashes_list, int splash_count, int selected_splash, bool preview_mode); #endif \ No newline at end of file diff --git a/source/draw.c b/source/draw.c index c48b9c8..f1dfdd5 100644 --- a/source/draw.c +++ b/source/draw.c @@ -209,10 +209,20 @@ void draw_theme_interface(Theme_s * themes_list, int theme_count, int selected_t pp2d_end_draw(); } -void draw_splash_install(void) +void draw_splash_install(int install_type) { draw_base_interface(); - pp2d_draw_textf(20, 30, 0.7, 0.7, COLOR_WHITE, "Installing a splash..."); + switch (install_type) + { + case SINGLE_INSTALL: + pp2d_draw_textf(20, 30, 0.7, 0.7, COLOR_WHITE, "Installing a splash..."); + break; + case UNINSTALL: + pp2d_draw_textf(20, 30, 0.7, 0.7, COLOR_WHITE, "Uninstalling a splash..."); + break; + default: + break; + } pp2d_end_draw(); } diff --git a/source/main.c b/source/main.c index 015e29f..1e264a8 100644 --- a/source/main.c +++ b/source/main.c @@ -124,18 +124,19 @@ int main(void) // Actions else if (kDown & KEY_X) { - if (splash_mode) { - splash_delete(); - } else { - draw_theme_install(BGM_INSTALL); - bgm_install(*current_theme); - } + if (splash_mode) { + draw_splash_install(UNINSTALL); + splash_delete(); + } else { + draw_theme_install(BGM_INSTALL); + bgm_install(*current_theme); + } } else if (kDown & KEY_A) { if (splash_mode) { - draw_splash_install(); + draw_splash_install(SINGLE_INSTALL); splash_install(*current_splash); svcSleepThread(5e8); } else { diff --git a/source/splashes.c b/source/splashes.c index b54fd5f..2ec1cc8 100644 --- a/source/splashes.c +++ b/source/splashes.c @@ -88,8 +88,8 @@ Result get_splashes(Splash_s** splashes_list, int *splash_count) } void splash_delete() { - remove("/luma/splash.bin"); - remove("/luma/splashbottom.bin"); + remove("/luma/splash.bin"); + remove("/luma/splashbottom.bin"); } void splash_install(Splash_s splash_to_install) {