Fix splash install when /luma/splash.bin or /luma/splashbottom.bin were missing

This commit is contained in:
2017-09-01 12:11:25 -04:00
parent 72153ba15d
commit 867f4b61ab
4 changed files with 13 additions and 1 deletions

View File

@@ -35,6 +35,7 @@ void exit_screens(void);
void draw_theme_install(bool shuffle_install); void draw_theme_install(bool shuffle_install);
void draw_theme_interface(Theme_s * themes_list, int theme_count, int selected_theme, bool preview_mode); 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_interface(Splash_s *splashes_list, int splash_count, int selected_splash, bool preview_mode); void draw_splash_interface(Splash_s *splashes_list, int splash_count, int selected_splash, bool preview_mode);
#endif #endif

View File

@@ -140,7 +140,7 @@ void draw_theme_interface(Theme_s * themes_list, int theme_count, int selected_t
pp2d_draw_wtext(20, 65, 0.5, 0.5, COLOR_WHITE, description); pp2d_draw_wtext(20, 65, 0.5, 0.5, COLOR_WHITE, description);
pp2d_draw_wtext_center(GFX_TOP, 150, 0.7, 0.7, COLOR_WHITE, L"\uE000 Install Theme \uE004 Switch to Splashes"); pp2d_draw_wtext_center(GFX_TOP, 150, 0.7, 0.7, COLOR_WHITE, L"\uE000 Install Theme \uE004 Switch to Splashes");
pp2d_draw_wtext_center(GFX_TOP, 180, 0.7, 0.7, COLOR_WHITE, L"\uE001 Queue Shuffle \uE046 Install shuffle"); pp2d_draw_wtext_center(GFX_TOP, 180, 0.7, 0.7, COLOR_WHITE, L"\uE001 Queue Shuffle \uE046 Install Shuffle");
pp2d_draw_wtext_center(GFX_TOP, 210, 0.7, 0.7, COLOR_WHITE, L"\uE003 Preview Theme"); pp2d_draw_wtext_center(GFX_TOP, 210, 0.7, 0.7, COLOR_WHITE, L"\uE003 Preview Theme");
pp2d_draw_on(GFX_BOTTOM); pp2d_draw_on(GFX_BOTTOM);
@@ -197,6 +197,13 @@ void draw_theme_interface(Theme_s * themes_list, int theme_count, int selected_t
pp2d_end_draw(); pp2d_end_draw();
} }
void draw_splash_install(void)
{
draw_base_interface();
pp2d_draw_textf(20, 30, 0.7, 0.7, COLOR_WHITE, "Installing a splash...");
pp2d_end_draw();
}
void draw_splash_interface(Splash_s *splashes_list, int splash_count, int selected_splash, bool preview_mode) void draw_splash_interface(Splash_s *splashes_list, int splash_count, int selected_splash, bool preview_mode)
{ {
if (splashes_list == NULL) if (splashes_list == NULL)

View File

@@ -131,7 +131,9 @@ int main(void)
{ {
if (splash_mode) if (splash_mode)
{ {
draw_splash_install();
splash_install(*current_splash); splash_install(*current_splash);
svcSleepThread(5e8);
} else { } else {
draw_theme_install(false); draw_theme_install(false);
single_install(*current_theme); single_install(*current_theme);

View File

@@ -93,6 +93,7 @@ void splash_install(Splash_s splash_to_install)
u32 size = file_to_buf(fsMakePath(PATH_UTF16, splash_to_install.top_path), ArchiveSD, &screen_buf); u32 size = file_to_buf(fsMakePath(PATH_UTF16, splash_to_install.top_path), ArchiveSD, &screen_buf);
if (size) if (size)
{ {
remake_file("/luma/splash.bin", ArchiveSD, size);
buf_to_file(size, "/luma/splash.bin", ArchiveSD, screen_buf); buf_to_file(size, "/luma/splash.bin", ArchiveSD, screen_buf);
free(screen_buf); free(screen_buf);
} }
@@ -100,6 +101,7 @@ void splash_install(Splash_s splash_to_install)
size = file_to_buf(fsMakePath(PATH_UTF16, splash_to_install.bottom_path), ArchiveSD, &screen_buf); size = file_to_buf(fsMakePath(PATH_UTF16, splash_to_install.bottom_path), ArchiveSD, &screen_buf);
if (size) if (size)
{ {
remake_file("/luma/splashbottom.bin", ArchiveSD, size);
buf_to_file(size, "/luma/splashbottom.bin", ArchiveSD, screen_buf); buf_to_file(size, "/luma/splashbottom.bin", ArchiveSD, screen_buf);
free(screen_buf); free(screen_buf);
} }