Adding splash deletion feature (#24)

* Adding splash deletion feature

* Add Mention for deleting splashes
This commit is contained in:
Nils P
2017-09-02 17:45:56 +02:00
committed by Alex Taber
parent 91f54ff22e
commit 6ea3904682
4 changed files with 14 additions and 6 deletions

View File

@@ -37,5 +37,5 @@ typedef struct{
Result get_splashes(Splash_s** splashes_list, int *splash_count); Result get_splashes(Splash_s** splashes_list, int *splash_count);
void splash_install(Splash_s splash_to_install); void splash_install(Splash_s splash_to_install);
void splash_delete();
#endif #endif

View File

@@ -239,8 +239,8 @@ void draw_splash_interface(Splash_s *splashes_list, int splash_count, int select
draw_base_interface(); draw_base_interface();
pp2d_draw_text_center(GFX_TOP, 4, 0.5, 0.5, COLOR_WHITE, "Splash mode"); 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); pp2d_draw_on(GFX_BOTTOM);
for (int i = 0; i < splash_count; i++) { for (int i = 0; i < splash_count; i++) {
if (splash_count <= THEMES_PER_SCREEN) if (splash_count <= THEMES_PER_SCREEN)

View File

@@ -132,9 +132,13 @@ int main(void)
// Actions // Actions
else if (kDown & KEY_X) else if (kDown & KEY_X)
{ {
if (splash_mode) {
splash_delete();
} else {
draw_theme_install(BGM_INSTALL); draw_theme_install(BGM_INSTALL);
bgm_install(*current_theme); bgm_install(*current_theme);
} }
}
else if (kDown & KEY_A) else if (kDown & KEY_A)
{ {
if (splash_mode) if (splash_mode)

View File

@@ -86,7 +86,11 @@ Result get_splashes(Splash_s** splashes_list, int *splash_count)
return res; return res;
} }
void splash_delete()
{
remove("/luma/splash.bin");
remove("/luma/splashbottom.bin");
}
void splash_install(Splash_s splash_to_install) void splash_install(Splash_s splash_to_install)
{ {
char *screen_buf; char *screen_buf;