diff --git a/include/draw.h b/include/draw.h index 0fe5f0e..95c0568 100644 --- a/include/draw.h +++ b/include/draw.h @@ -184,5 +184,6 @@ void draw_home(u64 start_time, u64 cur_time); void draw_base_interface(void); void draw_grid_interface(Entry_List_s * list, Instructions_s instructions, int extra_mode); void draw_interface(Entry_List_s * list, Instructions_s instructions, DrawMode draw_mode); +bool draw_confirm_no_interface(const char *conf_msg); #endif diff --git a/include/ui_strings.h b/include/ui_strings.h index fdc8f16..987b3dc 100644 --- a/include/ui_strings.h +++ b/include/ui_strings.h @@ -37,6 +37,7 @@ typedef struct { const char *zip_not_theme_splash; const char *file_not_zip; const char *download_failed; + const char *badge_question; } Camera_Strings_s; typedef struct { diff --git a/source/camera.c b/source/camera.c index e0b4731..7e2bb4b 100644 --- a/source/camera.c +++ b/source/camera.c @@ -398,7 +398,15 @@ bool init_qr(void) } else { - throw_error(language.camera.zip_not_theme_splash, ERROR_LEVEL_WARNING); + bool badge = draw_confirm_no_interface(language.camera.badge_question); + if (badge) + { + save_zip_to_sd(filename, zip_size, zip_buf, REMOTE_MODE_BADGES); + // don't set success since we don't need to reload lists for badge zips + } else + { + throw_error(language.camera.zip_not_theme_splash, ERROR_LEVEL_WARNING); + } } } else diff --git a/source/draw.c b/source/draw.c index 97f259c..bdcbc58 100644 --- a/source/draw.c +++ b/source/draw.c @@ -348,6 +348,24 @@ bool draw_confirm(const char * conf_msg, Entry_List_s * list, DrawMode draw_mode return false; } +bool draw_confirm_no_interface(const char *conf_msg) +{ + while(aptMainLoop()) + { + draw_base_interface(); + draw_text_center(GFX_TOP, 100, 0.5f, 0.7f, 0.7f, colors[COLOR_YELLOW], conf_msg); + draw_c2d_text_center(GFX_TOP, 170, 0.5f, 0.6f, 0.6f, colors[COLOR_WHITE], &text[TEXT_CONFIRM_YES_NO]); + end_frame(); + + hidScanInput(); + u32 kDown = hidKeysDown(); + if(kDown & KEY_A) return true; + if(kDown & KEY_B) return false; + } + + return false; +} + void draw_preview(C2D_Image preview, int preview_offset, float preview_scale) { start_frame(); diff --git a/source/ui_strings.c b/source/ui_strings.c index 0b20fa2..99b2924 100644 --- a/source/ui_strings.c +++ b/source/ui_strings.c @@ -170,6 +170,7 @@ const Language_s language_english = { .zip_not_theme_splash = "Zip downloaded is neither\na splash nor a theme", .file_not_zip = "File downloaded isn't a zip.", .download_failed = "Download failed.", + .badge_question = "Theme or splash not detected.\nIs this a badge?", }, .draw = { @@ -530,6 +531,7 @@ const Language_s language_spanish = { .zip_not_theme_splash = "El archivo ZIP descargado no es\nni un fondo ni un tema", .file_not_zip = "El archivo descargado no es un ZIP.", .download_failed = "Fallo en la descarga.", + .badge_question = "Theme or splash not detected.\nIs this a badge?", }, .draw = { @@ -890,6 +892,7 @@ const Language_s language_french = { .zip_not_theme_splash = "Le fichier zip téléchargé n'est\nni un thème, ni un splash", .file_not_zip = "Le fichier téléchargé n'est pas un zip.", .download_failed = "Le téléchargement a échoué.", + .badge_question = "Theme or splash not detected.\nIs this a badge?", }, .draw = { @@ -1250,6 +1253,7 @@ const Language_s language_portuguese = { .zip_not_theme_splash = "O zip baixado não é um splash nem um tema", .file_not_zip = "O arquivo baixado não é um zip.", .download_failed = "Falha no download.", + .badge_question = "Theme or splash not detected.\nIs this a badge?", }, .draw = {