From 6ea3904682365dc9444037325cdfcef029b8bff4 Mon Sep 17 00:00:00 2001 From: Nils P Date: Sat, 2 Sep 2017 17:45:56 +0200 Subject: [PATCH] Adding splash deletion feature (#24) * Adding splash deletion feature * Add Mention for deleting splashes --- include/splashes.h | 2 +- source/draw.c | 4 ++-- source/main.c | 8 ++++++-- source/splashes.c | 6 +++++- 4 files changed, 14 insertions(+), 6 deletions(-) diff --git a/include/splashes.h b/include/splashes.h index 8dde014..9d0a550 100644 --- a/include/splashes.h +++ b/include/splashes.h @@ -37,5 +37,5 @@ typedef struct{ Result get_splashes(Splash_s** splashes_list, int *splash_count); void splash_install(Splash_s splash_to_install); - +void splash_delete(); #endif \ No newline at end of file diff --git a/source/draw.c b/source/draw.c index ad6c697..f5972a2 100644 --- a/source/draw.c +++ b/source/draw.c @@ -239,8 +239,8 @@ void draw_splash_interface(Splash_s *splashes_list, int splash_count, int select draw_base_interface(); pp2d_draw_text_center(GFX_TOP, 4, 0.5, 0.5, COLOR_WHITE, "Splash mode"); - pp2d_draw_wtext_center(GFX_TOP, 210, 0.7, 0.7, COLOR_WHITE, L"\uE000 Install Splash \uE004 Switch to Themes"); - + pp2d_draw_wtext_center(GFX_TOP, 180, 0.7, 0.7, COLOR_WHITE, L"\uE000 Install Splash \uE004 Switch to Themes"); + pp2d_draw_wtext_center(GFX_TOP, 210, 0.7, 0.7, COLOR_WHITE, L"\uE002 Delete current Splash"); pp2d_draw_on(GFX_BOTTOM); for (int i = 0; i < splash_count; i++) { if (splash_count <= THEMES_PER_SCREEN) diff --git a/source/main.c b/source/main.c index f2946f1..dc0c509 100644 --- a/source/main.c +++ b/source/main.c @@ -132,8 +132,12 @@ int main(void) // Actions else if (kDown & KEY_X) { - draw_theme_install(BGM_INSTALL); - bgm_install(*current_theme); + if (splash_mode) { + splash_delete(); + } else { + draw_theme_install(BGM_INSTALL); + bgm_install(*current_theme); + } } else if (kDown & KEY_A) { diff --git a/source/splashes.c b/source/splashes.c index 978c103..b54fd5f 100644 --- a/source/splashes.c +++ b/source/splashes.c @@ -86,7 +86,11 @@ Result get_splashes(Splash_s** splashes_list, int *splash_count) return res; } - +void splash_delete() +{ + remove("/luma/splash.bin"); + remove("/luma/splashbottom.bin"); +} void splash_install(Splash_s splash_to_install) { char *screen_buf;