UX Overhaul (#305)

* Fix bgm checking bug

* Converted install and menu options into button menus rather than combos

* Fix sort order

* Various touch screen changes so that most functions can be done via touch

 * Dim theme list when navigating menus

* Translation framework implemented

* bug when no themes loaded fixed

* Fix theme preview regression introduced in d037691
This commit is contained in:
Alex Taber
2024-05-12 14:24:43 -04:00
committed by GitHub
parent 546d459696
commit a43cbcca74
23 changed files with 1060 additions and 536 deletions

View File

@@ -28,6 +28,7 @@
#include "unicode.h"
#include "fs.h"
#include "draw.h"
#include "ui_strings.h"
#define BODY_CACHE_SIZE 0x150000
#define BGM_MAX_SIZE 0x337000
@@ -81,7 +82,7 @@ static Result install_theme_internal(const Entry_List_s * themes, int installmod
{
free(body);
DEBUG("body not found\n");
throw_error("No body_LZ.bin found - is this a theme?", ERROR_LEVEL_WARNING);
throw_error(language.themes.no_body_found, ERROR_LEVEL_WARNING);
return MAKERESULT(RL_PERMANENT, RS_CANCELED, RM_APPLICATION, RD_NOT_FOUND);
}
@@ -118,9 +119,12 @@ static Result install_theme_internal(const Entry_List_s * themes, int installmod
return MAKERESULT(RL_PERMANENT, RS_CANCELED, RM_APPLICATION, RD_TOO_LARGE);
}
if (music[0x62] == 1)
if (music_size > 0)
{
mono_audio = true;
if (music[0x62] == 1)
{
mono_audio = true;
}
}
}
@@ -177,7 +181,7 @@ static Result install_theme_internal(const Entry_List_s * themes, int installmod
{
free(body);
DEBUG("body not found\n");
throw_error("No body_LZ.bin found - is this a theme?", ERROR_LEVEL_WARNING);
throw_error(language.themes.no_body_found, ERROR_LEVEL_WARNING);
return MAKERESULT(RL_PERMANENT, RS_CANCELED, RM_APPLICATION, RD_NOT_FOUND);
}
@@ -298,7 +302,7 @@ static Result install_theme_internal(const Entry_List_s * themes, int installmod
//----------------------------------------
if (mono_audio)
{
throw_error("One or more installed themes use mono audio.\nMono audio causes a number of issues.\nCheck the wiki for more information.", ERROR_LEVEL_WARNING);
throw_error(language.themes.mono_warn, ERROR_LEVEL_WARNING);
}
return 0;
}
@@ -342,7 +346,7 @@ dir_name_callback(void * data, const char ** ppMessage, const char * text, size_
(void)data;
if(strpbrk(text, "><\"?;:/\\+,.|[=]"))
{
*ppMessage = "Illegal character used.";
*ppMessage = language.themes.illegal_char;
return SWKBD_CALLBACK_CONTINUE;
}
return SWKBD_CALLBACK_OK;
@@ -356,10 +360,10 @@ Result dump_current_theme(void)
SwkbdState swkbd;
swkbdInit(&swkbd, SWKBD_TYPE_WESTERN, 2, max_chars);
swkbdSetHintText(&swkbd, "Name of output folder");
swkbdSetHintText(&swkbd, language.themes.name_folder);
swkbdSetButton(&swkbd, SWKBD_BUTTON_LEFT, "Cancel", false);
swkbdSetButton(&swkbd, SWKBD_BUTTON_RIGHT, "Done", true);
swkbdSetButton(&swkbd, SWKBD_BUTTON_LEFT, language.themes.cancel, false);
swkbdSetButton(&swkbd, SWKBD_BUTTON_RIGHT, language.themes.done, true);
swkbdSetValidation(&swkbd, SWKBD_NOTEMPTY_NOTBLANK, 0, max_chars);
swkbdSetFilterCallback(&swkbd, dir_name_callback, NULL);