Display "Applet Mode" indicator when running under an applet

This commit is contained in:
fincs 2019-07-29 17:36:59 +02:00
parent 78da39d0a2
commit ce35f40f31
5 changed files with 36 additions and 17 deletions

View File

@ -46,6 +46,12 @@ const char* const g_strings[StrId_Max][16] =
STR_TW("加載中…"),
},
[StrId_AppletMode] =
{
STR_EN("● Applet Mode ●"),
STR_ES("● Modo Applet ●"),
},
[StrId_Directory] =
{
STR_EN("Directory"),

View File

@ -6,6 +6,7 @@
typedef enum
{
StrId_Loading = 0,
StrId_AppletMode,
StrId_Directory,
StrId_DefaultPublisher,
StrId_IOError,

View File

@ -604,6 +604,12 @@ void menuLoop(void) {
drawImage(40, 20, 140, 60, themeCurrent.hbmenuLogoImage, IMAGE_MODE_RGBA32);
DrawText(interuiregular14, 180, 46 + 18, themeCurrent.textColor, VERSION);
#ifdef __SWITCH__
AppletType at = appletGetAppletType();
if (at != AppletType_Application && at != AppletType_SystemApplication) {
DrawText(interuimedium30, 640-32, 46 + 18, themeCurrent.attentionTextColor, textGetString(StrId_AppletMode));
}
#endif
#ifdef PERF_LOG_DRAW//Seperate from the PERF_LOG define since this might affect perf.
extern u64 g_tickdiff_frame;

View File

@ -14,6 +14,7 @@ void themeStartup(ThemePreset preset) {
themeGlobalPreset = preset;
theme_t themeLight = (theme_t) {
.textColor = MakeColor(0, 0, 0, 255),
.attentionTextColor = MakeColor(255, 0, 0, 255),
.frontWaveColor = MakeColor(100, 212, 250, 255),
.middleWaveColor = MakeColor(100, 153, 255, 255),
.backWaveColor = MakeColor(154, 171, 255, 255),
@ -37,6 +38,7 @@ void themeStartup(ThemePreset preset) {
theme_t themeDark = (theme_t) {
.textColor = MakeColor(255, 255, 255, 255),
.attentionTextColor = MakeColor(255, 0, 0, 255),
.frontWaveColor = MakeColor(96, 204, 204, 255),
.middleWaveColor = MakeColor(66, 154, 159, 255),
.backWaveColor = MakeColor(73, 103, 169, 255),
@ -65,7 +67,7 @@ void themeStartup(ThemePreset preset) {
config_t cfg = {0};
config_init(&cfg);
config_setting_t *theme = NULL;
color_t text, frontWave, middleWave, backWave, background, highlight, separator, borderColor, borderTextColor, progressBarColor;
color_t text, attentionText, frontWave, middleWave, backWave, background, highlight, separator, borderColor, borderTextColor, progressBarColor;
int waveBlending;
const char *AText, *BText, *XText, *YText, *PText, *MText, *starOnText, *starOffText;
bool good_cfg = false;
@ -92,6 +94,8 @@ void themeStartup(ThemePreset preset) {
if (theme != NULL) {
if (!colorFromSetting(config_setting_lookup(theme, "textColor"), &text))
text = themeDefault->textColor;
if (!colorFromSetting(config_setting_lookup(theme, "attentionTextColor"), &attentionText))
attentionText = themeDefault->attentionTextColor;
if (!colorFromSetting(config_setting_lookup(theme, "frontWaveColor"), &frontWave))
frontWave = themeDefault->frontWaveColor;
if (!colorFromSetting(config_setting_lookup(theme, "middleWaveColor"), &middleWave))
@ -130,6 +134,7 @@ void themeStartup(ThemePreset preset) {
starOffText = themeDefault->labelStarOffText;
themeCurrent = (theme_t) {
.textColor = text,
.attentionTextColor = attentionText,
.frontWaveColor = frontWave,
.middleWaveColor = middleWave,
.backWaveColor = backWave,

View File

@ -6,6 +6,7 @@
typedef struct
{
color_t textColor;
color_t attentionTextColor;
color_t frontWaveColor;
color_t middleWaveColor;
color_t backWaveColor;