mirror of
https://github.com/astronautlevel2/Anemone3DS.git
synced 2026-03-10 23:53:24 -04:00
Compare commits
5 Commits
newui
...
3.0.1-hotf
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
fc697af002 | ||
| 0a23b20f6e | |||
| a8cc3ebfc3 | |||
| b1454bf2a1 | |||
| 1a2efdc129 |
6
Makefile
6
Makefile
@@ -75,12 +75,6 @@ ifeq ($(strip $(NOGIT)),)
|
||||
VERSION_MINOR := $(shell echo $(VERSION) | cut -c2- | cut -f1 -d- | cut -f2 -d.)
|
||||
VERSION_BUILD := $(shell echo $(VERSION) | cut -c2- | cut -f1 -d- | cut -f3 -d.)
|
||||
|
||||
ifeq ($(strip $(VERSION_MAJOR)),)
|
||||
VERSION_MAJOR := 0
|
||||
endif
|
||||
ifeq ($(strip $(VERSION_MINOR)),)
|
||||
VERSION_MINOR := 0
|
||||
endif
|
||||
ifeq ($(strip $(VERSION_BUILD)),)
|
||||
VERSION_BUILD := 0
|
||||
endif
|
||||
|
||||
@@ -3,7 +3,6 @@
|
||||
A Theme and Splashscreen Manager for the Nintendo 3DS, written in C.
|
||||
|
||||
# Dependencies
|
||||
* Make, Git and PKG-Config
|
||||
* devkitARM, which can be installed following the instructions [here](https://devkitpro.org/wiki/Getting_Started).
|
||||
* jansson, libvorbisidec, libpng, and libarchive, which can be retrieved from [devkitPro pacman](https://devkitpro.org/viewtopic.php?f=13&t=8702).
|
||||
* A recent build of [makerom](https://github.com/profi200/Project_CTR) and the latest release of [bannertool](https://github.com/Steveice10/bannertool). These must be added to your PATH.
|
||||
@@ -12,7 +11,7 @@ A Theme and Splashscreen Manager for the Nintendo 3DS, written in C.
|
||||
First of all, make sure devkitARM is properly installed - `$DEVKITPRO` and `$DEVKITARM` should be set to `/opt/devkitpro` and `$DEVKITPRO/devkitARM`, respectively.
|
||||
After that, open the directory you want to clone the repo into, and execute
|
||||
`git clone https://github.com/astronautlevel2/Anemone3DS` (or any other cloning method).
|
||||
To install the prerequisite libraries, begin by ensuring devkitPro pacman (and the base install group, `3ds-dev`) is installed, and then install the dkP packages `3ds-jansson`, `3ds-libvorbisidec`, `3ds-libpng`, `3ds-lz4`, `3ds-libarchive` and `3ds-curl` using `[sudo] [dkp-]pacman -S <package-name>`. System wide packages `make`, `git` and `pkg-config` are also needed.
|
||||
To install the prerequisite libraries, begin by ensuring devkitPro pacman (and the base install group, `3ds-dev`) is installed, and then install the dkP packages `3ds-jansson`, `3ds-libvorbisidec`, `3ds-libpng`, `3ds-lz4`, `3ds-libarchive` and `3ds-curl` using `[sudo] [dkp-]pacman -S <package-name>`.
|
||||
|
||||
After adding [makerom](https://github.com/profi200/Project_CTR) and [bannertool](https://github.com/Steveice10/buildtools) to your PATH, just enter your directory and run `make`. All built binaries will be in `/out/`.
|
||||
|
||||
|
||||
@@ -35,12 +35,10 @@ typedef u32 Color;
|
||||
typedef enum {
|
||||
COLOR_BACKGROUND, //silver-y black
|
||||
COLOR_ACCENT,
|
||||
COLOR_WHITE_BACKGROUND,
|
||||
COLOR_WHITE_ACCENT,
|
||||
COLOR_WHITE,
|
||||
COLOR_CURSOR,
|
||||
COLOR_BLACK,
|
||||
COLOR_RED_BACKGROUND,
|
||||
COLOR_RED_ACCENT,
|
||||
COLOR_RED,
|
||||
COLOR_YELLOW,
|
||||
|
||||
COLOR_AMOUNT,
|
||||
|
||||
@@ -79,7 +79,7 @@ typedef enum {
|
||||
REMOTE_MODE_AMOUNT,
|
||||
} RemoteMode;
|
||||
|
||||
extern const char * main_paths[REMOTE_MODE_AMOUNT];
|
||||
extern const char * main_paths[MODE_AMOUNT];
|
||||
extern const int entries_per_screen_v[MODE_AMOUNT];
|
||||
extern const int entries_per_screen_h[MODE_AMOUNT];
|
||||
extern const int entry_size[MODE_AMOUNT];
|
||||
|
||||
@@ -32,14 +32,9 @@
|
||||
#include <jansson.h>
|
||||
|
||||
typedef struct {
|
||||
u32 accent_color;
|
||||
u32 background_color;
|
||||
u32 white_color_background;
|
||||
u32 white_color_accent;
|
||||
u32 cursor_color;
|
||||
u32 black_color;
|
||||
u32 red_color_background;
|
||||
u32 red_color_accent;
|
||||
u32 accent_color;
|
||||
u32 red_color;
|
||||
u32 yellow_color;
|
||||
} Config_s;
|
||||
|
||||
|
||||
@@ -130,9 +130,6 @@ typedef struct {
|
||||
const char *parental_fail;
|
||||
const char *zip_not_found;
|
||||
const char *generic_httpc_error;
|
||||
const char *http_timeout;
|
||||
const char *http_no_network;
|
||||
const char *http_ssl_error;
|
||||
const char *http303_tp;
|
||||
const char *http303;
|
||||
const char *http404;
|
||||
@@ -196,8 +193,4 @@ typedef enum {
|
||||
Language_s init_strings(CFG_Language lang);
|
||||
extern Language_s language;
|
||||
|
||||
// fetches the system language through CFGU_GetSystemLanguage
|
||||
// and returns the appropriate CFG_Language enum value
|
||||
CFG_Language get_system_language(void);
|
||||
|
||||
#endif
|
||||
|
||||
BIN
meta/logo.bin
BIN
meta/logo.bin
Binary file not shown.
@@ -32,6 +32,7 @@
|
||||
#include "draw.h"
|
||||
#include "ui_strings.h"
|
||||
|
||||
static Handle actHandle;
|
||||
Handle badgeDataHandle;
|
||||
char *badgeMngBuffer;
|
||||
u16 *rgb_buf_64x64;
|
||||
@@ -41,6 +42,51 @@ u8 *alpha_buf_32x32;
|
||||
u64 progress_finish;
|
||||
u64 progress_status;
|
||||
|
||||
Result actInit(void)
|
||||
{
|
||||
return srvGetServiceHandle(&actHandle, "act:u");
|
||||
}
|
||||
|
||||
Result actExit(void)
|
||||
{
|
||||
return svcCloseHandle(actHandle);
|
||||
}
|
||||
|
||||
Result ACTU_Initialize(u32 sdkVersion, u32 memSize, Handle handle)
|
||||
{
|
||||
Result ret = 0;
|
||||
u32 *cmdbuf = getThreadCommandBuffer();
|
||||
|
||||
cmdbuf[0] = 0x00010084;
|
||||
cmdbuf[1] = sdkVersion;
|
||||
cmdbuf[2] = memSize;
|
||||
cmdbuf[3] = 0x20;
|
||||
cmdbuf[4] = 0x0;
|
||||
cmdbuf[5] = 0x0;
|
||||
cmdbuf[6] = handle;
|
||||
|
||||
if ((ret = svcSendSyncRequest(actHandle)) != 0) return ret;
|
||||
|
||||
return (Result) cmdbuf[1];
|
||||
}
|
||||
|
||||
Result ACTU_GetAccountDataBlock(u32 slot, u32 size, u32 blockId, u32 *output)
|
||||
{
|
||||
Result ret = 0;
|
||||
u32 *cmdbuf = getThreadCommandBuffer();
|
||||
cmdbuf[0] = 0x000600C2;
|
||||
cmdbuf[1] = slot;
|
||||
cmdbuf[2] = size;
|
||||
cmdbuf[3] = blockId;
|
||||
cmdbuf[4] = (size << 4) | 12;
|
||||
cmdbuf[5] = (u32) output;
|
||||
|
||||
if ((ret = svcSendSyncRequest(actHandle)) != 0) return ret;
|
||||
|
||||
return (Result) cmdbuf[1];
|
||||
}
|
||||
|
||||
|
||||
void remove_exten(u16 *filename)
|
||||
{
|
||||
for (int i = 0; i < strulen(filename, 0x8A); ++i)
|
||||
@@ -169,7 +215,7 @@ int install_badge_dir(FS_DirectoryEntry set_dir, int *badge_count, int set_id)
|
||||
u16 path[512] = {0};
|
||||
u16 set_icon[17] = {0};
|
||||
utf8_to_utf16(set_icon, (u8 *) "_seticon.png", 16);
|
||||
struacat(path, main_paths[REMOTE_MODE_BADGES]);
|
||||
struacat(path, "/Badges/");
|
||||
strucat(path, set_dir.name);
|
||||
res = FSUSER_OpenDirectory(&folder, ArchiveSD, fsMakePath(PATH_UTF16, path));
|
||||
if (R_FAILED(res))
|
||||
@@ -185,7 +231,7 @@ int install_badge_dir(FS_DirectoryEntry set_dir, int *badge_count, int set_id)
|
||||
if (!strcmp(badge_files[i].shortExt, "PNG"))
|
||||
{
|
||||
memset(path, 0, 512 * sizeof(u16));
|
||||
struacat(path, main_paths[REMOTE_MODE_BADGES]);
|
||||
struacat(path, "/Badges/");
|
||||
strucat(path, set_dir.name);
|
||||
struacat(path, "/");
|
||||
strucat(path, badge_files[i].name);
|
||||
@@ -199,7 +245,7 @@ int install_badge_dir(FS_DirectoryEntry set_dir, int *badge_count, int set_id)
|
||||
} else if (!strcmp(badge_files[i].shortExt, "ZIP"))
|
||||
{
|
||||
memset(path, 0, 512 * sizeof(u16));
|
||||
struacat(path, main_paths[REMOTE_MODE_BADGES]);
|
||||
struacat(path, "/Badges/");
|
||||
strucat(path, set_dir.name);
|
||||
struacat(path, "/");
|
||||
strucat(path, badge_files[i].name);
|
||||
@@ -289,14 +335,7 @@ void free_list(SetNode *head)
|
||||
SetNode * extract_sets(char *badgeMngBuffer, Handle backupDataHandle)
|
||||
{
|
||||
u32 setCount = *((u32 *) (badgeMngBuffer + 0x4));
|
||||
|
||||
if (!setCount) // GYTB? make unknown set
|
||||
{
|
||||
u16 set_path[256] = {0};
|
||||
struacat(set_path, "/3ds/" APP_TITLE "/BadgeBackups/Unknown Set");
|
||||
FSUSER_CreateDirectory(ArchiveSD, fsMakePath(PATH_UTF16, set_path), FS_ATTRIBUTE_DIRECTORY);
|
||||
return NULL;
|
||||
}
|
||||
if (setCount == 0) return NULL;
|
||||
|
||||
SetNode *head = calloc(1, sizeof(SetNode));
|
||||
SetNode *cursor = head;
|
||||
@@ -402,7 +441,7 @@ Result extract_badges(void)
|
||||
{
|
||||
u32 set_index = get_set_index(head, badgeSetId);
|
||||
if (set_index == 0xFFFFFFFF) {
|
||||
sprintf(dir, "/3ds/" APP_TITLE "/BadgeBackups/Unknown Set");
|
||||
sprintf(dir, "/3ds" APP_TITLE "/BadgeBackups/Unknown Set");
|
||||
} else
|
||||
{
|
||||
u16 utf16SetName[0x46] = {0};
|
||||
@@ -415,9 +454,6 @@ Result extract_badges(void)
|
||||
DEBUG("UTF-8 Set Name: %s; ID: %lx\n", utf8SetName, badgeSetId);
|
||||
sprintf(dir, "/3ds/" APP_TITLE "/BadgeBackups/%s", utf8SetName);
|
||||
}
|
||||
} else
|
||||
{
|
||||
sprintf(dir, "/3ds/" APP_TITLE "/BadgeBackups/Unknown Set");
|
||||
}
|
||||
|
||||
if (shortcut == 0xFFFFFFFF)
|
||||
@@ -529,27 +565,27 @@ Result install_badges(void)
|
||||
if (handle) FSFILE_Close(handle);
|
||||
|
||||
DEBUG("Initializing ACT\n");
|
||||
res = actInit(true);
|
||||
res = actInit();
|
||||
if (R_FAILED(res))
|
||||
{
|
||||
DEBUG("actInit() failed!\n");
|
||||
return res;
|
||||
}
|
||||
|
||||
DEBUG("Initializing ACT\n");
|
||||
res = ACT_Initialize(0xB0502C8, 0, 0);
|
||||
DEBUG("Initializing ACTU\n");
|
||||
res = ACTU_Initialize(0xB0502C8, 0, 0);
|
||||
if (R_FAILED(res))
|
||||
{
|
||||
DEBUG("ACT_Initialize failed! %08lx\n", res);
|
||||
DEBUG("ACTU_Initialize failed! %08lx\n", res);
|
||||
return res;
|
||||
}
|
||||
|
||||
DEBUG("Getting NNID\n");
|
||||
u32 nnidNum = 0xFFFFFFFF;
|
||||
res = ACT_GetAccountInfo(&nnidNum, sizeof(nnidNum), ACT_DEFAULT_ACCOUNT, INFO_TYPE_PRINCIPAL_ID);
|
||||
res = ACTU_GetAccountDataBlock(0xFE, 4, 12, &nnidNum);
|
||||
if (R_FAILED(res))
|
||||
{
|
||||
DEBUG("ACT_GetAccountInfo failed! %08lx\n", res);
|
||||
DEBUG("ACTU_GetAccountDataBlock failed! %08lx\n", res);
|
||||
return res;
|
||||
}
|
||||
DEBUG("NNID found: 0x%08lx\n", nnidNum);
|
||||
@@ -563,7 +599,7 @@ Result install_badges(void)
|
||||
|
||||
DEBUG("Opening badge directory\n");
|
||||
FS_DirectoryEntry *badge_files = calloc(1024, sizeof(FS_DirectoryEntry));
|
||||
res = FSUSER_OpenDirectory(&folder, ArchiveSD, fsMakePath(PATH_ASCII, main_paths[REMOTE_MODE_BADGES]));
|
||||
res = FSUSER_OpenDirectory(&folder, ArchiveSD, fsMakePath(PATH_ASCII, "/Badges/"));
|
||||
if (R_FAILED(res))
|
||||
{
|
||||
DEBUG("Failed to open folder: %lx\n", res);
|
||||
@@ -642,7 +678,7 @@ Result install_badges(void)
|
||||
default_idx = badge_count;
|
||||
}
|
||||
u16 path[0x512] = {0};
|
||||
struacat(path, main_paths[REMOTE_MODE_BADGES]);
|
||||
struacat(path, "/Badges/");
|
||||
strucat(path, badge_files[i].name);
|
||||
default_set_count += install_badge_png(fsMakePath(PATH_UTF16, path), badge_files[i], &badge_count, default_set);
|
||||
} else if (!strcmp(badge_files[i].shortExt, "ZIP"))
|
||||
@@ -653,7 +689,7 @@ Result install_badges(void)
|
||||
default_set = set_count;
|
||||
}
|
||||
u16 path[0x512] = {0};
|
||||
struacat(path, main_paths[REMOTE_MODE_BADGES]);
|
||||
struacat(path, "/Badges/");
|
||||
strucat(path, badge_files[i].name);
|
||||
|
||||
default_set_count += install_badge_zip(path, &badge_count, default_set);
|
||||
|
||||
@@ -201,7 +201,7 @@ static void update_ui(void * arg)
|
||||
C2D_DrawImageAt((C2D_Image){ &tex, &subt3x }, 0.0f, 0.0f, 0.4f, NULL, 1.0f, 1.0f);
|
||||
|
||||
set_screen(bottom);
|
||||
draw_text_center(GFX_BOTTOM, 4, 0.5, 0.5, 0.5, colors[COLOR_WHITE_ACCENT], language.camera.quit);
|
||||
draw_text_center(GFX_BOTTOM, 4, 0.5, 0.5, 0.5, colors[COLOR_WHITE], language.camera.quit);
|
||||
end_frame();
|
||||
}
|
||||
|
||||
|
||||
@@ -32,11 +32,9 @@ void init_colors(void)
|
||||
{
|
||||
colors[COLOR_BACKGROUND] = config.background_color;
|
||||
colors[COLOR_ACCENT] = config.accent_color;
|
||||
colors[COLOR_WHITE_BACKGROUND] = config.white_color_background;
|
||||
colors[COLOR_WHITE_ACCENT] = config.white_color_accent;
|
||||
colors[COLOR_CURSOR] = config.cursor_color;
|
||||
colors[COLOR_BLACK] = config.black_color;
|
||||
colors[COLOR_RED_BACKGROUND] = config.red_color_background;
|
||||
colors[COLOR_RED_ACCENT] = config.red_color_accent;
|
||||
colors[COLOR_WHITE] = C2D_Color32(255, 255, 255, 255);
|
||||
colors[COLOR_CURSOR] = C2D_Color32(200, 200, 200, 255);
|
||||
colors[COLOR_BLACK] = C2D_Color32(0, 0, 0, 255);
|
||||
colors[COLOR_RED] = config.red_color;
|
||||
colors[COLOR_YELLOW] = config.yellow_color;
|
||||
}
|
||||
138
source/config.c
138
source/config.c
@@ -30,8 +30,6 @@ Config_s config;
|
||||
|
||||
void load_config(void)
|
||||
{
|
||||
Handle test_handle;
|
||||
Result res;
|
||||
memset(&config, 0, sizeof(Config_s));
|
||||
char *json_buf = NULL;
|
||||
u32 json_len = file_to_buf(fsMakePath(PATH_ASCII, "/3ds/" APP_TITLE "/config.json"), ArchiveSD, &json_buf);
|
||||
@@ -71,7 +69,7 @@ void load_config(void)
|
||||
config.background_color = C2D_Color32(r, g, b, a);
|
||||
}
|
||||
}
|
||||
else if (json_is_array(value) && !strcmp(key, "White Color Background") && json_array_size(value) == 4)
|
||||
else if (json_is_array(value) && !strcmp(key, "Red Color") && json_array_size(value) == 4)
|
||||
{
|
||||
if (json_is_integer(json_array_get(value, 0)) && json_is_integer(json_array_get(value, 1))
|
||||
&& json_is_integer(json_array_get(value, 2)) && json_is_integer(json_array_get(value, 3)))
|
||||
@@ -81,72 +79,7 @@ void load_config(void)
|
||||
u8 b = min(255, json_integer_value(json_array_get(value, 2)));
|
||||
u8 a = min(255, json_integer_value(json_array_get(value, 3)));
|
||||
|
||||
config.white_color_background = C2D_Color32(r, g, b, a);
|
||||
}
|
||||
}
|
||||
else if (json_is_array(value) && !strcmp(key, "White Color Accent") && json_array_size(value) == 4)
|
||||
{
|
||||
if (json_is_integer(json_array_get(value, 0)) && json_is_integer(json_array_get(value, 1))
|
||||
&& json_is_integer(json_array_get(value, 2)) && json_is_integer(json_array_get(value, 3)))
|
||||
{
|
||||
u8 r = min(255, json_integer_value(json_array_get(value, 0)));
|
||||
u8 g = min(255, json_integer_value(json_array_get(value, 1)));
|
||||
u8 b = min(255, json_integer_value(json_array_get(value, 2)));
|
||||
u8 a = min(255, json_integer_value(json_array_get(value, 3)));
|
||||
|
||||
config.white_color_accent = C2D_Color32(r, g, b, a);
|
||||
}
|
||||
}
|
||||
else if (json_is_array(value) && !strcmp(key, "Cursor Color") && json_array_size(value) == 4)
|
||||
{
|
||||
if (json_is_integer(json_array_get(value, 0)) && json_is_integer(json_array_get(value, 1))
|
||||
&& json_is_integer(json_array_get(value, 2)) && json_is_integer(json_array_get(value, 3)))
|
||||
{
|
||||
u8 r = min(255, json_integer_value(json_array_get(value, 0)));
|
||||
u8 g = min(255, json_integer_value(json_array_get(value, 1)));
|
||||
u8 b = min(255, json_integer_value(json_array_get(value, 2)));
|
||||
u8 a = min(255, json_integer_value(json_array_get(value, 3)));
|
||||
|
||||
config.cursor_color = C2D_Color32(r, g, b, a);
|
||||
}
|
||||
}
|
||||
else if (json_is_array(value) && !strcmp(key, "Black Color") && json_array_size(value) == 4)
|
||||
{
|
||||
if (json_is_integer(json_array_get(value, 0)) && json_is_integer(json_array_get(value, 1))
|
||||
&& json_is_integer(json_array_get(value, 2)) && json_is_integer(json_array_get(value, 3)))
|
||||
{
|
||||
u8 r = min(255, json_integer_value(json_array_get(value, 0)));
|
||||
u8 g = min(255, json_integer_value(json_array_get(value, 1)));
|
||||
u8 b = min(255, json_integer_value(json_array_get(value, 2)));
|
||||
u8 a = min(255, json_integer_value(json_array_get(value, 3)));
|
||||
|
||||
config.black_color = C2D_Color32(r, g, b, a);
|
||||
}
|
||||
}
|
||||
else if (json_is_array(value) && !strcmp(key, "Red Color Background") && json_array_size(value) == 4)
|
||||
{
|
||||
if (json_is_integer(json_array_get(value, 0)) && json_is_integer(json_array_get(value, 1))
|
||||
&& json_is_integer(json_array_get(value, 2)) && json_is_integer(json_array_get(value, 3)))
|
||||
{
|
||||
u8 r = min(255, json_integer_value(json_array_get(value, 0)));
|
||||
u8 g = min(255, json_integer_value(json_array_get(value, 1)));
|
||||
u8 b = min(255, json_integer_value(json_array_get(value, 2)));
|
||||
u8 a = min(255, json_integer_value(json_array_get(value, 3)));
|
||||
|
||||
config.red_color_background = C2D_Color32(r, g, b, a);
|
||||
}
|
||||
}
|
||||
else if (json_is_array(value) && !strcmp(key, "Red Color Accent") && json_array_size(value) == 4)
|
||||
{
|
||||
if (json_is_integer(json_array_get(value, 0)) && json_is_integer(json_array_get(value, 1))
|
||||
&& json_is_integer(json_array_get(value, 2)) && json_is_integer(json_array_get(value, 3)))
|
||||
{
|
||||
u8 r = min(255, json_integer_value(json_array_get(value, 0)));
|
||||
u8 g = min(255, json_integer_value(json_array_get(value, 1)));
|
||||
u8 b = min(255, json_integer_value(json_array_get(value, 2)));
|
||||
u8 a = min(255, json_integer_value(json_array_get(value, 3)));
|
||||
|
||||
config.red_color_accent = C2D_Color32(r, g, b, a);
|
||||
config.red_color = C2D_Color32(r, g, b, a);
|
||||
}
|
||||
}
|
||||
else if (json_is_array(value) && !strcmp(key, "Yellow Color") && json_array_size(value) == 4)
|
||||
@@ -162,54 +95,6 @@ void load_config(void)
|
||||
config.yellow_color = C2D_Color32(r, g, b, a);
|
||||
}
|
||||
}
|
||||
else if (json_is_string(value) && !strcmp(key, "Themes Path"))
|
||||
{
|
||||
bool need_slash = json_string_value(value)[strlen(json_string_value(value)) - 1] != '/';
|
||||
char *theme_path = calloc(1, strlen(json_string_value(value)) + 1 + (need_slash ? 1 : 0));
|
||||
memcpy(theme_path, json_string_value(value), strlen(json_string_value(value)));
|
||||
if (need_slash) theme_path[strlen(json_string_value(value))] = '/';
|
||||
if (R_SUCCEEDED(res = FSUSER_OpenDirectory(&test_handle, ArchiveSD, fsMakePath(PATH_ASCII, theme_path))))
|
||||
{
|
||||
main_paths[REMOTE_MODE_THEMES] = theme_path;
|
||||
FSDIR_Close(test_handle);
|
||||
} else
|
||||
{
|
||||
DEBUG("Failed test - reverting to default. Err 0x%08lx\n", res);
|
||||
free(theme_path);
|
||||
}
|
||||
}
|
||||
else if (json_is_string(value) && !strcmp(key, "Splashes Path"))
|
||||
{
|
||||
bool need_slash = json_string_value(value)[strlen(json_string_value(value)) - 1] != '/';
|
||||
char *splash_path = calloc(1, strlen(json_string_value(value)) + 1 + (need_slash ? 1 : 0));
|
||||
memcpy(splash_path, json_string_value(value), strlen(json_string_value(value)));
|
||||
if (need_slash) splash_path[strlen(json_string_value(value))] = '/';
|
||||
if (R_SUCCEEDED(res = FSUSER_OpenDirectory(&test_handle, ArchiveSD, fsMakePath(PATH_ASCII, splash_path))))
|
||||
{
|
||||
main_paths[REMOTE_MODE_SPLASHES] = splash_path;
|
||||
FSDIR_Close(test_handle);
|
||||
} else
|
||||
{
|
||||
DEBUG("Failed test - reverting to default. Err 0x%08lx\n", res);
|
||||
free(splash_path);
|
||||
}
|
||||
}
|
||||
else if (json_is_string(value) && !strcmp(key, "Badges Path"))
|
||||
{
|
||||
bool need_slash = json_string_value(value)[strlen(json_string_value(value)) - 1] != '/';
|
||||
char *badge_path = calloc(1, strlen(json_string_value(value)) + 1 + (need_slash ? 1 : 0));
|
||||
memcpy(badge_path, json_string_value(value), strlen(json_string_value(value)));
|
||||
if (need_slash) badge_path[strlen(json_string_value(value))] = '/';
|
||||
if (R_SUCCEEDED(res = FSUSER_OpenDirectory(&test_handle, ArchiveSD, fsMakePath(PATH_ASCII, badge_path))))
|
||||
{
|
||||
main_paths[REMOTE_MODE_BADGES] = badge_path;
|
||||
FSDIR_Close(test_handle);
|
||||
} else
|
||||
{
|
||||
DEBUG("Failed test - reverting to default. Err 0x%08lx\n", res);
|
||||
free(badge_path);
|
||||
}
|
||||
}
|
||||
}
|
||||
} else
|
||||
{
|
||||
@@ -222,23 +107,8 @@ void load_config(void)
|
||||
if (config.background_color == 0)
|
||||
config.background_color = C2D_Color32(35, 28, 32, 255); //silver-y black
|
||||
|
||||
if (config.white_color_background == 0)
|
||||
config.white_color_background = C2D_Color32(255, 255, 255, 255);
|
||||
|
||||
if (config.white_color_accent == 0)
|
||||
config.white_color_accent = C2D_Color32(255, 255, 255, 255);
|
||||
|
||||
if (config.cursor_color == 0)
|
||||
config.cursor_color = C2D_Color32(200, 200, 200, 255);
|
||||
|
||||
if (config.black_color == 0)
|
||||
config.black_color = C2D_Color32(0, 0, 0, 255);
|
||||
|
||||
if (config.red_color_background == 0)
|
||||
config.red_color_background = C2D_Color32(229, 66, 66, 255);
|
||||
|
||||
if (config.red_color_accent == 0)
|
||||
config.red_color_accent = C2D_Color32(229, 66, 66, 255);
|
||||
if (config.red_color == 0)
|
||||
config.red_color = C2D_Color32(229, 66, 66, 255);
|
||||
|
||||
if (config.yellow_color == 0)
|
||||
config.yellow_color = C2D_Color32(239, 220, 11, 255);
|
||||
|
||||
136
source/draw.c
136
source/draw.c
@@ -173,11 +173,6 @@ void end_frame(void)
|
||||
C3D_FrameEnd(0);
|
||||
}
|
||||
|
||||
static void draw_image_tint(int image_id, float x, float y, C2D_ImageTint tint)
|
||||
{
|
||||
C2D_DrawImageAt(C2D_SpriteSheetGetImage(spritesheet, image_id), x, y, 0.6f, &tint, 1.0f, 1.0f);
|
||||
}
|
||||
|
||||
static void draw_image(int image_id, float x, float y)
|
||||
{
|
||||
C2D_DrawImageAt(C2D_SpriteSheetGetImage(spritesheet, image_id), x, y, 0.6f, NULL, 1.0f, 1.0f);
|
||||
@@ -276,10 +271,10 @@ void draw_base_interface(void)
|
||||
C2D_TextParse(&minutes, dynamicBuf, string_minutes);
|
||||
C2D_TextOptimize(&minutes);
|
||||
|
||||
C2D_DrawText(&hours, C2D_WithColor, 7, 2, 0.5f, 0.6f, 0.6f, colors[COLOR_WHITE_ACCENT]);
|
||||
C2D_DrawText(&hours, C2D_WithColor, 7, 2, 0.5f, 0.6f, 0.6f, colors[COLOR_WHITE]);
|
||||
if(tm.tm_sec % 2 == 1)
|
||||
C2D_DrawText(&separator, C2D_WithColor, 28, 1, 0.5f, 0.6f, 0.6f, colors[COLOR_WHITE_ACCENT]);
|
||||
C2D_DrawText(&minutes, C2D_WithColor, 34, 2, 0.5f, 0.6f, 0.6f, colors[COLOR_WHITE_ACCENT]);
|
||||
C2D_DrawText(&separator, C2D_WithColor, 28, 1, 0.5f, 0.6f, 0.6f, colors[COLOR_WHITE]);
|
||||
C2D_DrawText(&minutes, C2D_WithColor, 34, 2, 0.5f, 0.6f, 0.6f, colors[COLOR_WHITE]);
|
||||
|
||||
#ifndef CITRA_MODE
|
||||
u8 battery_charging = 0;
|
||||
@@ -296,7 +291,7 @@ void draw_base_interface(void)
|
||||
|
||||
C2D_DrawRectSolid(0, 0, 0.5f, 320, 24, colors[COLOR_ACCENT]);
|
||||
C2D_DrawRectSolid(0, 216, 0.5f, 320, 24, colors[COLOR_ACCENT]);
|
||||
C2D_DrawText(&text[TEXT_VERSION], C2D_WithColor, 7, 219, 0.5f, 0.6f, 0.6f, colors[COLOR_WHITE_ACCENT]);
|
||||
C2D_DrawText(&text[TEXT_VERSION], C2D_WithColor, 7, 219, 0.5f, 0.6f, 0.6f, colors[COLOR_WHITE]);
|
||||
|
||||
set_screen(top);
|
||||
}
|
||||
@@ -304,13 +299,13 @@ void draw_base_interface(void)
|
||||
void throw_error(const char * error, ErrorLevel level)
|
||||
{
|
||||
Text bottom_text = TEXT_AMOUNT;
|
||||
Color text_color = COLOR_WHITE_BACKGROUND;
|
||||
Color text_color = COLOR_WHITE;
|
||||
|
||||
switch(level)
|
||||
{
|
||||
case ERROR_LEVEL_ERROR:
|
||||
bottom_text = TEXT_ERROR_QUIT;
|
||||
text_color = COLOR_RED_BACKGROUND;
|
||||
text_color = COLOR_RED;
|
||||
break;
|
||||
case ERROR_LEVEL_WARNING:
|
||||
bottom_text = TEXT_ERROR_CONTINUE;
|
||||
@@ -327,7 +322,7 @@ void throw_error(const char * error, ErrorLevel level)
|
||||
|
||||
draw_base_interface();
|
||||
draw_text_center(GFX_TOP, 100, 0.5f, 0.6f, 0.6f, colors[text_color], error);
|
||||
draw_c2d_text_center(GFX_TOP, 170, 0.5f, 0.6f, 0.6f, colors[COLOR_WHITE_BACKGROUND], &text[bottom_text]);
|
||||
draw_c2d_text_center(GFX_TOP, 170, 0.5f, 0.6f, 0.6f, colors[COLOR_WHITE], &text[bottom_text]);
|
||||
end_frame();
|
||||
|
||||
if(kDown & KEY_A) break;
|
||||
@@ -342,7 +337,7 @@ bool draw_confirm(const char * conf_msg, Entry_List_s * list, DrawMode draw_mode
|
||||
draw_interface(list, instructions, draw_mode);
|
||||
set_screen(top);
|
||||
draw_text_center(GFX_TOP, BUTTONS_Y_LINE_1, 0.5f, 0.7f, 0.7f, colors[COLOR_YELLOW], conf_msg);
|
||||
draw_c2d_text_center(GFX_TOP, BUTTONS_Y_LINE_3, 0.5f, 0.6f, 0.6f, colors[COLOR_WHITE_BACKGROUND], &text[TEXT_CONFIRM_YES_NO]);
|
||||
draw_c2d_text_center(GFX_TOP, BUTTONS_Y_LINE_3, 0.5f, 0.6f, 0.6f, colors[COLOR_WHITE], &text[TEXT_CONFIRM_YES_NO]);
|
||||
end_frame();
|
||||
|
||||
hidScanInput();
|
||||
@@ -360,7 +355,7 @@ bool draw_confirm_no_interface(const char *conf_msg)
|
||||
{
|
||||
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_BACKGROUND], &text[TEXT_CONFIRM_YES_NO]);
|
||||
draw_c2d_text_center(GFX_TOP, 170, 0.5f, 0.6f, 0.6f, colors[COLOR_WHITE], &text[TEXT_CONFIRM_YES_NO]);
|
||||
end_frame();
|
||||
|
||||
hidScanInput();
|
||||
@@ -386,7 +381,7 @@ static void draw_install_handler(InstallType type)
|
||||
if(type != INSTALL_NONE)
|
||||
{
|
||||
C2D_Text * install_text = &text[type];
|
||||
draw_c2d_text_center(GFX_TOP, 120.0f, 0.5f, 0.8f, 0.8f, colors[COLOR_WHITE_BACKGROUND], install_text);
|
||||
draw_c2d_text_center(GFX_TOP, 120.0f, 0.5f, 0.8f, 0.8f, colors[COLOR_WHITE], install_text);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -413,7 +408,7 @@ void draw_loading_bar(u32 current, u32 max, InstallType type)
|
||||
static void draw_instructions(Instructions_s instructions)
|
||||
{
|
||||
if(instructions.info_line != NULL)
|
||||
draw_text_center(GFX_TOP, BUTTONS_Y_INFO, 0.5, 0.55, 0.55, colors[COLOR_WHITE_BACKGROUND], instructions.info_line);
|
||||
draw_text_center(GFX_TOP, BUTTONS_Y_INFO, 0.5, 0.55, 0.55, colors[COLOR_WHITE], instructions.info_line);
|
||||
|
||||
const int y_lines[BUTTONS_INFO_LINES-1] = {
|
||||
BUTTONS_Y_LINE_1,
|
||||
@@ -424,20 +419,20 @@ static void draw_instructions(Instructions_s instructions)
|
||||
for(int i = 0; i < BUTTONS_INFO_LINES-1; i++)
|
||||
{
|
||||
if(instructions.instructions[i][0] != NULL)
|
||||
draw_text_wrap_scaled(BUTTONS_X_LEFT, y_lines[i], 0.5, colors[COLOR_WHITE_BACKGROUND], instructions.instructions[i][0], 0.6, 0, BUTTONS_X_RIGHT-2);
|
||||
draw_text_wrap_scaled(BUTTONS_X_LEFT, y_lines[i], 0.5, colors[COLOR_WHITE], instructions.instructions[i][0], 0.6, 0, BUTTONS_X_RIGHT-2);
|
||||
if(instructions.instructions[i][1] != NULL)
|
||||
draw_text_wrap_scaled(BUTTONS_X_RIGHT, y_lines[i], 0.5, colors[COLOR_WHITE_BACKGROUND], instructions.instructions[i][1], 0.6, 0, BUTTONS_X_MAX-2);
|
||||
draw_text_wrap_scaled(BUTTONS_X_RIGHT, y_lines[i], 0.5, colors[COLOR_WHITE], instructions.instructions[i][1], 0.6, 0, BUTTONS_X_MAX-2);
|
||||
}
|
||||
|
||||
C2D_ImageTint white_tint;
|
||||
C2D_PlainImageTint(&white_tint, colors[COLOR_WHITE_BACKGROUND], 1.0f);
|
||||
C2D_PlainImageTint(&white_tint, colors[COLOR_WHITE], 1.0f);
|
||||
|
||||
const char * start_line = instructions.instructions[BUTTONS_INFO_LINES-1][0];
|
||||
if(start_line != NULL)
|
||||
{
|
||||
C2D_SpriteSetPos(&sprite_start, BUTTONS_X_LEFT-10, BUTTONS_Y_LINE_4 + 3);
|
||||
C2D_DrawSpriteTinted(&sprite_start, &white_tint);
|
||||
draw_text_wrap_scaled(BUTTONS_X_LEFT+26, BUTTONS_Y_LINE_4, 0.5, colors[COLOR_WHITE_BACKGROUND], start_line, 0.6, 0, BUTTONS_X_RIGHT-2);
|
||||
draw_text_wrap_scaled(BUTTONS_X_LEFT+26, BUTTONS_Y_LINE_4, 0.5, colors[COLOR_WHITE], start_line, 0.6, 0, BUTTONS_X_RIGHT-2);
|
||||
}
|
||||
|
||||
const char * select_line = instructions.instructions[BUTTONS_INFO_LINES-1][1];
|
||||
@@ -445,7 +440,7 @@ static void draw_instructions(Instructions_s instructions)
|
||||
{
|
||||
C2D_SpriteSetPos(&sprite_select, BUTTONS_X_RIGHT-10, BUTTONS_Y_LINE_4 + 3);
|
||||
C2D_DrawSpriteTinted(&sprite_select, &white_tint);
|
||||
draw_text_wrap_scaled(BUTTONS_X_RIGHT+26, BUTTONS_Y_LINE_4, 0.5, colors[COLOR_WHITE_BACKGROUND], select_line, 0.6, 0, BUTTONS_X_MAX-2);
|
||||
draw_text_wrap_scaled(BUTTONS_X_RIGHT+26, BUTTONS_Y_LINE_4, 0.5, colors[COLOR_WHITE], select_line, 0.6, 0, BUTTONS_X_MAX-2);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -533,18 +528,18 @@ static void draw_entry_info(Entry_s * entry)
|
||||
{
|
||||
char author[0x41] = {0};
|
||||
utf16_to_utf8((u8 *)author, entry->author, 0x40);
|
||||
draw_c2d_text(20, 35, 0.5, 0.5, 0.5, colors[COLOR_WHITE_BACKGROUND], &text[TEXT_BY_AUTHOR]);
|
||||
draw_c2d_text(20, 35, 0.5, 0.5, 0.5, colors[COLOR_WHITE], &text[TEXT_BY_AUTHOR]);
|
||||
float width = 0;
|
||||
C2D_TextGetDimensions(&text[TEXT_BY_AUTHOR], 0.5, 0.5, &width, NULL);
|
||||
draw_text(20+width, 35, 0.5, 0.5, 0.5, colors[COLOR_WHITE_BACKGROUND], author);
|
||||
draw_text(20+width, 35, 0.5, 0.5, 0.5, colors[COLOR_WHITE], author);
|
||||
|
||||
char title[0x41] = {0};
|
||||
utf16_to_utf8((u8 *)title, entry->name, 0x40);
|
||||
draw_text(20, 50, 0.5, 0.7, 0.7, colors[COLOR_WHITE_BACKGROUND], title);
|
||||
draw_text(20, 50, 0.5, 0.7, 0.7, colors[COLOR_WHITE], title);
|
||||
|
||||
char description[0x81] = {0};
|
||||
utf16_to_utf8((u8 *)description, entry->desc, 0x80);
|
||||
draw_text_wrap(20, 70, 0.5, 0.5, 0.5, colors[COLOR_WHITE_BACKGROUND], description, 363);
|
||||
draw_text_wrap(20, 70, 0.5, 0.5, 0.5, colors[COLOR_WHITE], description, 363);
|
||||
}
|
||||
|
||||
void draw_grid_interface(Entry_List_s * list, Instructions_s instructions, int extra_mode)
|
||||
@@ -558,7 +553,7 @@ void draw_grid_interface(Entry_List_s * list, Instructions_s instructions, int e
|
||||
&text[TEXT_THEMEPLAZA_BADGE_MODE],
|
||||
};
|
||||
|
||||
draw_c2d_text_center(GFX_TOP, 4, 0.5f, 0.5f, 0.5f, colors[COLOR_WHITE_ACCENT], mode_string[current_mode]);
|
||||
draw_c2d_text_center(GFX_TOP, 4, 0.5f, 0.5f, 0.5f, colors[COLOR_WHITE], mode_string[current_mode]);
|
||||
|
||||
draw_instructions(instructions);
|
||||
|
||||
@@ -568,22 +563,16 @@ void draw_grid_interface(Entry_List_s * list, Instructions_s instructions, int e
|
||||
|
||||
set_screen(bottom);
|
||||
|
||||
draw_c2d_text(7, 3, 0.5f, 0.6f, 0.6f, colors[COLOR_WHITE_ACCENT], &text[TEXT_SEARCH]);
|
||||
draw_c2d_text(7, 3, 0.5f, 0.6f, 0.6f, colors[COLOR_WHITE], &text[TEXT_SEARCH]);
|
||||
|
||||
C2D_ImageTint accent_tint;
|
||||
C2D_PlainImageTint(&accent_tint, colors[COLOR_WHITE_ACCENT], 1.0f);
|
||||
draw_image(sprites_back_idx, 320-96, 0);
|
||||
draw_image(sprites_exit_idx, 320-72, 0);
|
||||
draw_image(sprites_preview_idx, 320-48, 0);
|
||||
|
||||
draw_image_tint(sprites_back_idx, 320-96, 0, accent_tint);
|
||||
draw_image_tint(sprites_exit_idx, 320-72, 0, accent_tint);
|
||||
draw_image_tint(sprites_preview_idx, 320-48, 0, accent_tint);
|
||||
draw_text(320-24+2.5, -3, 0.6, 1.0f, 0.9f, colors[COLOR_WHITE], remote_mode_switch_char[current_mode]);
|
||||
|
||||
draw_text(320-24+2.5, -3, 0.6, 1.0f, 0.9f, colors[COLOR_WHITE_ACCENT], remote_mode_switch_char[current_mode]);
|
||||
|
||||
C2D_ImageTint background_tint;
|
||||
C2D_PlainImageTint(&background_tint, colors[COLOR_WHITE_BACKGROUND], 1.0f);
|
||||
|
||||
draw_image_tint(sprites_arrow_left_idx, 3, 114, background_tint);
|
||||
draw_image_tint(sprites_arrow_right_idx, 308, 114, background_tint);
|
||||
draw_image(sprites_arrow_left_idx, 3, 114);
|
||||
draw_image(sprites_arrow_right_idx, 308, 114);
|
||||
|
||||
for(int i = list->scroll; i < (list->entries_loaded + list->scroll); i++)
|
||||
{
|
||||
@@ -636,15 +625,15 @@ void draw_grid_interface(Entry_List_s * list, Instructions_s instructions, int e
|
||||
float width = 0;
|
||||
get_text_dimensions(entries_count_str, 0.6, 0.6, &width, NULL);
|
||||
x -= width;
|
||||
draw_text(x, 219, 0.5, 0.6, 0.6, colors[COLOR_WHITE_ACCENT], entries_count_str);
|
||||
draw_text(x, 219, 0.5, 0.6, 0.6, colors[COLOR_WHITE], entries_count_str);
|
||||
|
||||
char selected_entry_str[0x20] = {0};
|
||||
sprintf(selected_entry_str, "%" JSON_INTEGER_FORMAT, list->tp_current_page);
|
||||
get_text_dimensions(selected_entry_str, 0.6, 0.6, &width, NULL);
|
||||
x -= width;
|
||||
draw_text(x, 219, 0.5, 0.6, 0.6, colors[COLOR_WHITE_ACCENT], selected_entry_str);
|
||||
draw_text(x, 219, 0.5, 0.6, 0.6, colors[COLOR_WHITE], selected_entry_str);
|
||||
|
||||
draw_c2d_text(176, 219, 0.5, 0.6, 0.6, colors[COLOR_WHITE_ACCENT], &text[TEXT_PAGE]);
|
||||
draw_c2d_text(176, 219, 0.5, 0.6, 0.6, colors[COLOR_WHITE], &text[TEXT_PAGE]);
|
||||
}
|
||||
|
||||
void draw_interface(Entry_List_s * list, Instructions_s instructions, DrawMode draw_mode)
|
||||
@@ -657,10 +646,7 @@ void draw_interface(Entry_List_s * list, Instructions_s instructions, DrawMode d
|
||||
&text[TEXT_SPLASH_MODE],
|
||||
};
|
||||
|
||||
C2D_ImageTint accent_tint;
|
||||
C2D_PlainImageTint(&accent_tint, colors[COLOR_WHITE_ACCENT], 1.0f);
|
||||
|
||||
draw_c2d_text_center(GFX_TOP, 4, 0.5f, 0.5f, 0.5f, colors[COLOR_WHITE_ACCENT], mode_string[current_mode]);
|
||||
draw_c2d_text_center(GFX_TOP, 4, 0.5f, 0.5f, 0.5f, colors[COLOR_WHITE], mode_string[current_mode]);
|
||||
|
||||
if(list->entries == NULL || list->entries_count == 0)
|
||||
{
|
||||
@@ -689,11 +675,11 @@ void draw_interface(Entry_List_s * list, Instructions_s instructions, DrawMode d
|
||||
|
||||
set_screen(bottom);
|
||||
|
||||
draw_image_tint(sprites_qr_idx, 320-96, 0, accent_tint);
|
||||
draw_image_tint(sprites_browse_idx, 320-72, 0, accent_tint);
|
||||
draw_image_tint(sprites_exit_idx, 320-48, 0, accent_tint);
|
||||
draw_image(sprites_qr_idx, 320-96, 0);
|
||||
draw_image(sprites_browse_idx, 320-72, 0);
|
||||
draw_image(sprites_exit_idx, 320-48, 0);
|
||||
|
||||
draw_text(320-24+2.5, -3, 0.6, 1.0f, 0.9f, colors[COLOR_WHITE_ACCENT], mode_switch_char[!current_mode]);
|
||||
draw_text(320-24+2.5, -3, 0.6, 1.0f, 0.9f, colors[COLOR_WHITE], mode_switch_char[!current_mode]);
|
||||
|
||||
return;
|
||||
}
|
||||
@@ -710,48 +696,48 @@ void draw_interface(Entry_List_s * list, Instructions_s instructions, DrawMode d
|
||||
{
|
||||
char * shuffle_count_string = NULL;
|
||||
asprintf(&shuffle_count_string, language.draw.shuffle, list->shuffle_count);
|
||||
draw_text(30, 3, 0.6, 0.6, 0.6f, list->shuffle_count <= 10 && list->shuffle_count >= 2 ? colors[COLOR_WHITE_ACCENT] : colors[COLOR_RED_ACCENT], shuffle_count_string);
|
||||
draw_text(30, 3, 0.6, 0.6, 0.6f, list->shuffle_count <= 10 && list->shuffle_count >= 2 ? colors[COLOR_WHITE] : colors[COLOR_RED], shuffle_count_string);
|
||||
free(shuffle_count_string);
|
||||
}
|
||||
|
||||
if (draw_mode == DRAW_MODE_LIST)
|
||||
{
|
||||
draw_image_tint(sprites_install_idx, 320-120, 0, accent_tint);
|
||||
draw_image_tint(sprites_qr_idx, 320-96, 0, accent_tint);
|
||||
draw_image_tint(sprites_exit_idx, 320-72, 0, accent_tint);
|
||||
draw_image_tint(sprites_preview_idx, 320-48, 0, accent_tint);
|
||||
draw_text(320-24+2.5, -3, 0.6, 1.0f, 0.9f, colors[COLOR_WHITE_ACCENT], mode_switch_char[!current_mode]);
|
||||
draw_image_tint(sprites_menu_idx, 2, 0, accent_tint);
|
||||
draw_image(sprites_install_idx, 320-120, 0);
|
||||
draw_image(sprites_qr_idx, 320-96, 0);
|
||||
draw_image(sprites_exit_idx, 320-72, 0);
|
||||
draw_image(sprites_preview_idx, 320-48, 0);
|
||||
draw_text(320-24+2.5, -3, 0.6, 1.0f, 0.9f, colors[COLOR_WHITE], mode_switch_char[!current_mode]);
|
||||
draw_image(sprites_menu_idx, 2, 0);
|
||||
if (current_mode == MODE_THEMES)
|
||||
{
|
||||
draw_image_tint(sprites_shuffle_idx, 320-144, 0, accent_tint);
|
||||
draw_image(sprites_shuffle_idx, 320-144, 0);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (draw_mode == DRAW_MODE_INSTALL)
|
||||
{
|
||||
draw_image_tint(sprites_install_idx, 320-24, 0, accent_tint);
|
||||
draw_image_tint(sprites_shuffle_idx, 320-48, 0, accent_tint);
|
||||
draw_image_tint(sprites_shuffle_no_bgm_idx, 320-72, 0, accent_tint);
|
||||
draw_image_tint(sprites_bgm_only_idx, 320-96, 0, accent_tint);
|
||||
draw_image_tint(sprites_back_idx, 2, 0, accent_tint);
|
||||
draw_image(sprites_install_idx, 320-24, 0);
|
||||
draw_image(sprites_shuffle_idx, 320-48, 0);
|
||||
draw_image(sprites_shuffle_no_bgm_idx, 320-72, 0);
|
||||
draw_image(sprites_bgm_only_idx, 320-96, 0);
|
||||
draw_image(sprites_back_idx, 2, 0);
|
||||
} else if (draw_mode == DRAW_MODE_EXTRA)
|
||||
{
|
||||
draw_image_tint(sprites_browse_idx, 320-24, 0, accent_tint);
|
||||
draw_image_tint(sprites_dump_idx, 320-48, 0, accent_tint);
|
||||
draw_image_tint(sprites_sort_idx, 320-72, 0, accent_tint);
|
||||
draw_image_tint(sprites_badge_idx, 320-96, 0, accent_tint);
|
||||
draw_image_tint(sprites_back_idx, 2, 0, accent_tint);
|
||||
draw_image(sprites_browse_idx, 320-24, 0);
|
||||
draw_image(sprites_dump_idx, 320-48, 0);
|
||||
draw_image(sprites_sort_idx, 320-72, 0);
|
||||
draw_image(sprites_badge_idx, 320-96, 0);
|
||||
draw_image(sprites_back_idx, 2, 0);
|
||||
}
|
||||
}
|
||||
|
||||
// Show arrows if there are themes out of bounds
|
||||
//----------------------------------------------------------------
|
||||
if(list->scroll > 0)
|
||||
draw_image_tint(sprites_arrow_up_idx, 141, 220, accent_tint);
|
||||
draw_image(sprites_arrow_up_idx, 141, 220);
|
||||
if(list->scroll + list->entries_loaded < list->entries_count)
|
||||
draw_image_tint(sprites_arrow_down_idx, 157, 220, accent_tint);
|
||||
draw_image(sprites_arrow_down_idx, 157, 220);
|
||||
|
||||
for(int i = list->scroll; i < (list->entries_loaded + list->scroll); i++)
|
||||
{
|
||||
@@ -768,7 +754,7 @@ void draw_interface(Entry_List_s * list, Instructions_s instructions, DrawMode d
|
||||
vertical_offset *= list->entry_size;
|
||||
vertical_offset += 24;
|
||||
|
||||
u32 font_color = colors[COLOR_WHITE_BACKGROUND];
|
||||
u32 font_color = colors[COLOR_WHITE];
|
||||
|
||||
if(i == selected_entry)
|
||||
{
|
||||
@@ -822,18 +808,18 @@ void draw_interface(Entry_List_s * list, Instructions_s instructions, DrawMode d
|
||||
float width = 0;
|
||||
get_text_dimensions(entries_count_str, 0.6, 0.6, &width, NULL);
|
||||
x -= width;
|
||||
draw_text(x, 219, 0.5, 0.6, 0.6, colors[COLOR_WHITE_ACCENT], entries_count_str);
|
||||
draw_text(x, 219, 0.5, 0.6, 0.6, colors[COLOR_WHITE], entries_count_str);
|
||||
|
||||
char selected_entry_str[0x20] = {0};
|
||||
sprintf(selected_entry_str, "%i", selected_entry + 1);
|
||||
get_text_dimensions(selected_entry_str, 0.6, 0.6, &width, NULL);
|
||||
x -= width;
|
||||
draw_text(x, 219, 0.5, 0.6, 0.6, colors[COLOR_WHITE_ACCENT], selected_entry_str);
|
||||
draw_text(x, 219, 0.5, 0.6, 0.6, colors[COLOR_WHITE], selected_entry_str);
|
||||
|
||||
if(list->entries_count < 10000)
|
||||
draw_c2d_text(176, 219, 0.5, 0.6, 0.6, colors[COLOR_WHITE_ACCENT], &text[TEXT_SELECTED]);
|
||||
draw_c2d_text(176, 219, 0.5, 0.6, 0.6, colors[COLOR_WHITE], &text[TEXT_SELECTED]);
|
||||
else
|
||||
draw_c2d_text(176, 219, 0.5, 0.6, 0.6, colors[COLOR_WHITE_ACCENT], &text[TEXT_SELECTED_SHORT]);
|
||||
draw_c2d_text(176, 219, 0.5, 0.6, 0.6, colors[COLOR_WHITE], &text[TEXT_SELECTED_SHORT]);
|
||||
if(draw_mode != DRAW_MODE_LIST)
|
||||
{
|
||||
C2D_DrawRectSolid(0, 24, 1.0f, 320, 240-48, C2D_Color32(0, 0, 0, 128));
|
||||
|
||||
30
source/fs.c
30
source/fs.c
@@ -117,9 +117,10 @@ Result open_archives(void)
|
||||
archive2 = 0x00;
|
||||
}
|
||||
|
||||
FSUSER_CreateDirectory(ArchiveSD, fsMakePath(PATH_ASCII, main_paths[REMOTE_MODE_THEMES]), FS_ATTRIBUTE_DIRECTORY);
|
||||
FSUSER_CreateDirectory(ArchiveSD, fsMakePath(PATH_ASCII, main_paths[REMOTE_MODE_SPLASHES]), FS_ATTRIBUTE_DIRECTORY);
|
||||
FSUSER_CreateDirectory(ArchiveSD, fsMakePath(PATH_ASCII, main_paths[REMOTE_MODE_BADGES]), FS_ATTRIBUTE_DIRECTORY);
|
||||
FSUSER_CreateDirectory(ArchiveSD, fsMakePath(PATH_ASCII, "/Themes"), FS_ATTRIBUTE_DIRECTORY);
|
||||
FSUSER_CreateDirectory(ArchiveSD, fsMakePath(PATH_ASCII, "/Splashes"), FS_ATTRIBUTE_DIRECTORY);
|
||||
FSUSER_CreateDirectory(ArchiveSD, fsMakePath(PATH_ASCII, "/Badges"), FS_ATTRIBUTE_DIRECTORY);
|
||||
FSUSER_CreateDirectory(ArchiveSD, fsMakePath(PATH_ASCII, "/Badges/ThemePlaza Badges"), FS_ATTRIBUTE_DIRECTORY);
|
||||
|
||||
u32 homeMenuPath[3] = {MEDIATYPE_SD, archive2, 0};
|
||||
home.type = PATH_BINARY;
|
||||
@@ -188,12 +189,7 @@ Result open_badge_extdata()
|
||||
}
|
||||
FSFILE_Close(test_handle);
|
||||
|
||||
char tp_path[0x106] = {0};
|
||||
sprintf(tp_path, "%sThemePlaza Badges", main_paths[REMOTE_MODE_BADGES]);
|
||||
FSUSER_CreateDirectory(ArchiveSD, fsMakePath(PATH_ASCII, tp_path), FS_ATTRIBUTE_DIRECTORY);
|
||||
strcat(tp_path, "/_seticon.png");
|
||||
|
||||
if(R_FAILED(res = FSUSER_OpenFile(&test_handle, ArchiveSD, fsMakePath(PATH_ASCII, tp_path), FS_OPEN_READ, 0)))
|
||||
if(R_FAILED(res = FSUSER_OpenFile(&test_handle, ArchiveSD, fsMakePath(PATH_ASCII, "/Badges/ThemePlaza Badges/_seticon.png"), FS_OPEN_READ, 0)))
|
||||
{
|
||||
FILE *fp = fopen("romfs:/tp_set.png", "rb");
|
||||
fseek(fp, 0L, SEEK_END);
|
||||
@@ -202,8 +198,8 @@ Result open_badge_extdata()
|
||||
fseek(fp, 0L, SEEK_SET);
|
||||
fread(icon_buf, 1, size, fp);
|
||||
fclose(fp);
|
||||
remake_file(fsMakePath(PATH_ASCII, tp_path), ArchiveSD, size);
|
||||
buf_to_file(size, fsMakePath(PATH_ASCII, tp_path), ArchiveSD, icon_buf);
|
||||
remake_file(fsMakePath(PATH_ASCII, "/Badges/ThemePlaza Badges/_seticon.png"), ArchiveSD, size);
|
||||
buf_to_file(size, fsMakePath(PATH_ASCII, "/Badges/ThemePlaza Badges/_seticon.png"), ArchiveSD, icon_buf);
|
||||
DEBUG("res: 0x%08lx\n", res);
|
||||
free(icon_buf);
|
||||
}
|
||||
@@ -275,9 +271,6 @@ s16 for_each_file_zip(u16 *zip_path, u32 (*zip_iter_callback)(char *filebuf, u64
|
||||
if(r != ARCHIVE_OK)
|
||||
{
|
||||
DEBUG("Invalid zip being opened\n");
|
||||
char path[0x128] = {0};
|
||||
utf16_to_utf8((u8 *) path, zip_path, 0x128);
|
||||
DEBUG("%s\n", path);
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -353,9 +346,6 @@ u32 zip_file_to_buf(const char * file_name, const u16 * zip_path, char ** buf)
|
||||
if(r != ARCHIVE_OK)
|
||||
{
|
||||
DEBUG("Invalid zip being opened\n");
|
||||
char path[0x128] = {0};
|
||||
utf16_to_utf8((u8 *) path, zip_path, 0x128);
|
||||
DEBUG("%s\n", path);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -576,9 +566,9 @@ renamed:
|
||||
char * curr_filename;
|
||||
if (mode == REMOTE_MODE_BADGES)
|
||||
{
|
||||
sprintf(path_to_file, "%sThemePlaza Badges/%s", main_paths[REMOTE_MODE_BADGES], filename);
|
||||
DEBUG("Remote mode badges! Saving to %s/\n", path_to_file);
|
||||
curr_filename = path_to_file + strlen(main_paths[REMOTE_MODE_BADGES]) + strlen("ThemePlaza Badges/");
|
||||
DEBUG("Remote mode badges! Saving to /Badges/ThemePlaza Badges/\n");
|
||||
sprintf(path_to_file, "%s%s", "/Badges/ThemePlaza Badges/", filename);
|
||||
curr_filename = path_to_file + strlen("/Badges/ThemePlaza Badges/");
|
||||
} else
|
||||
{
|
||||
sprintf(path_to_file, "%s%s", main_paths[mode], filename);
|
||||
|
||||
@@ -61,12 +61,10 @@ Result archive_result;
|
||||
Result badge_archive_result;
|
||||
u32 old_time_limit;
|
||||
|
||||
const char * main_paths[REMOTE_MODE_AMOUNT] = {
|
||||
const char * main_paths[MODE_AMOUNT] = {
|
||||
"/Themes/",
|
||||
"/Splashes/",
|
||||
"/Badges/"
|
||||
};
|
||||
|
||||
const int entries_per_screen_v[MODE_AMOUNT] = {
|
||||
4,
|
||||
4,
|
||||
@@ -381,7 +379,8 @@ int main(void)
|
||||
{
|
||||
srand(time(NULL));
|
||||
init_services();
|
||||
const CFG_Language lang = get_system_language();
|
||||
CFG_Language lang;
|
||||
CFGU_GetSystemLanguage(&lang);
|
||||
language = init_strings(lang);
|
||||
init_screens();
|
||||
|
||||
@@ -536,7 +535,7 @@ int main(void)
|
||||
{
|
||||
enable_qr:
|
||||
draw_base_interface();
|
||||
draw_text_center(GFX_TOP, 100, 0.5f, 0.6f, 0.6f, colors[COLOR_WHITE_BACKGROUND], language.main.loading_qr);
|
||||
draw_text_center(GFX_TOP, 100, 0.5f, 0.6f, 0.6f, colors[COLOR_WHITE], language.main.loading_qr);
|
||||
end_frame();
|
||||
if(R_SUCCEEDED(camInit()))
|
||||
{
|
||||
|
||||
@@ -1180,43 +1180,22 @@ redirect: // goto here if we need to redirect
|
||||
break;
|
||||
case HTTPC_ERROR:
|
||||
DEBUG("httpc error %lx\n", _header.result_code);
|
||||
switch (_header.result_code)
|
||||
if (_header.result_code == 0xd8a0a03c)
|
||||
{
|
||||
case 0xd8a0a028: // bad zip file
|
||||
case 0xd8a0a03c: // SSL failure
|
||||
// try curl?
|
||||
// SSL failure - try curl?
|
||||
res = curl_http_get(url, filename, buf, size, acceptable_mime_types);
|
||||
if (R_SUCCEEDED(res))
|
||||
{
|
||||
return res;
|
||||
}
|
||||
|
||||
if(_header.result_code == 0xd8a0a028)
|
||||
} else if (res == -2)
|
||||
{
|
||||
snprintf(err_buf, ERROR_BUFFER_SIZE, zip_not_available);
|
||||
goto error;
|
||||
}
|
||||
else
|
||||
{
|
||||
snprintf(err_buf, ERROR_BUFFER_SIZE, language.remote.http_ssl_error, _header.result_code);
|
||||
}
|
||||
quit = false;
|
||||
break;
|
||||
case 0xd8a0a049:
|
||||
// Timeout (bad wifi/proxy)
|
||||
snprintf(err_buf, ERROR_BUFFER_SIZE, language.remote.http_timeout);
|
||||
quit = false;
|
||||
break;
|
||||
case 0xd8a0a046:
|
||||
// poor reception/no wifi/custom dns set
|
||||
snprintf(err_buf, ERROR_BUFFER_SIZE, language.remote.http_no_network);
|
||||
quit = false;
|
||||
break;
|
||||
default:
|
||||
snprintf(err_buf, ERROR_BUFFER_SIZE, language.remote.generic_httpc_error, _header.result_code);
|
||||
quit = true;
|
||||
break;
|
||||
}
|
||||
snprintf(err_buf, ERROR_BUFFER_SIZE, language.remote.generic_httpc_error, _header.result_code);
|
||||
throw_error(err_buf, ERROR_LEVEL_ERROR);
|
||||
quit = true;
|
||||
httpcCloseContext(&context);
|
||||
return _header.result_code;
|
||||
case SEE_OTHER:
|
||||
|
||||
@@ -378,7 +378,7 @@ Result dump_current_theme(void)
|
||||
}
|
||||
|
||||
u16 path[0x107] = { 0 };
|
||||
struacat(path, main_paths[REMOTE_MODE_THEMES]);
|
||||
struacat(path, "/themes/");
|
||||
struacat(path, output_dir);
|
||||
FSUSER_CreateDirectory(ArchiveSD, fsMakePath(PATH_UTF16, path), FS_ATTRIBUTE_DIRECTORY);
|
||||
|
||||
@@ -584,7 +584,7 @@ Result dump_all_themes(void)
|
||||
{
|
||||
if(i == 0) continue;
|
||||
AM_ContentInfo * content = &contentInfos[i];
|
||||
if((content->flags & (AM_CONTENT_INSTALLED | AM_CONTENT_OWNED)) == (AM_CONTENT_INSTALLED | AM_CONTENT_OWNED))
|
||||
if((content->flags & (AM_CONTENT_DOWNLOADED | AM_CONTENT_OWNED)) == (AM_CONTENT_DOWNLOADED | AM_CONTENT_OWNED))
|
||||
{
|
||||
long off = 0x8 + 0xC8 * i;
|
||||
fseek(fh, off, SEEK_SET);
|
||||
@@ -614,7 +614,7 @@ Result dump_all_themes(void)
|
||||
}
|
||||
|
||||
char path[0x107] = { 0 };
|
||||
sprintf(path, "%sDump-%02lx-%ld-%s", main_paths[REMOTE_MODE_THEMES], dlc_index, extra_index, themename);
|
||||
sprintf(path, "/Themes/Dump-%02lx-%ld-%s", dlc_index, extra_index, themename);
|
||||
DEBUG("theme folder to create: %s\n", path);
|
||||
FSUSER_CreateDirectory(ArchiveSD, fsMakePath(PATH_ASCII, path), FS_ATTRIBUTE_DIRECTORY);
|
||||
|
||||
|
||||
@@ -263,9 +263,6 @@ const Language_s language_english = {
|
||||
.parental_fail = "Parental Control validation failed!\nBrowser Access restricted.",
|
||||
.zip_not_found = "ZIP not found at this URL\nIf you believe this is an error, please\ncontact the site administrator",
|
||||
.generic_httpc_error = "Error in HTTPC sysmodule - 0x%08lx.\nIf you are seeing this, please contact an\nAnemone developer on the Theme Plaza Discord.",
|
||||
.http_timeout = "HTTP Timeout.\nCheck your Wi-Fi signal and remove\nany proxy settings if set and try again.",
|
||||
.http_no_network = "Unable to connect to the Internet.\nCheck your Internet settings in the\nSystem Settings and try again.",
|
||||
.http_ssl_error = "SSL Error - 0x%08lx.\nCheck if the date/time is correct,\nand that Anemone is up to date.",
|
||||
.http303_tp = "HTTP 303 See Other (Theme Plaza)\nHas this theme been approved?",
|
||||
.http303 = "HTTP 303 See Other\nDownload the resource directly\nor contact the site administrator.",
|
||||
.http404 = "HTTP 404 Not Found\nHas this theme been approved?",
|
||||
@@ -672,9 +669,6 @@ const Language_s language_spanish = {
|
||||
.parental_fail = "¡La validación del Control Parental falló!\nAcceso al navegador restringido.",
|
||||
.zip_not_found = "ZIP no encontrado en esta URL\nSi crees que esto es un error, por favor\ncontacta al administrador del sitio",
|
||||
.generic_httpc_error = "Error en el módulo sysmodule HTTPC - 0x%08lx.\nSi estás viendo esto, por favor contacta a un\ndesarrollador de Anemone en el Discord de Theme Plaza.",
|
||||
.http_timeout = "HTTP Timeout.\nCheck your Wi-Fi signal and remove\nany proxy settings if set and try again.",
|
||||
.http_no_network = "Unable to connect to the Internet.\nCheck your Internet settings in the\nSystem Settings and try again.",
|
||||
.http_ssl_error = "SSL Error - 0x%08lx.\nCheck if the date/time is correct,\nand that Anemone is up to date.",
|
||||
.http303_tp = "HTTP 303 Ver Otro (Theme Plaza)\n¿Se ha aprobado este tema?",
|
||||
.http303 = "HTTP 303 Ver Otro\nDescarga el recurso directamente\no contacta al administrador del sitio.",
|
||||
.http404 = "HTTP 404 No Encontrado\n¿Se ha aprobado este tema?",
|
||||
@@ -1082,9 +1076,6 @@ const Language_s language_french = {
|
||||
.parental_fail = "Échec de la verification du contrôle parental.\nL'accès au site est restreint.",
|
||||
.zip_not_found = "Le ZIP n'a pas été trouvé sur cette URL.\nSi vous pensez que c'est une erreur,\ncontactez l'administrateur du site.",
|
||||
.generic_httpc_error = "Error in HTTPC sysmodule - 0x%08lx.\nSi vous voyez ceci, merci de contacter\nun développeur d'Anemone sur le serveur\nDiscord de ThemePlaza.",
|
||||
.http_timeout = "HTTP Timeout.\nVérifiez la réception du signal Wifi et\nretirez les paramètres proxy si nécessaire,\npuis réessayez.",
|
||||
.http_no_network = "Impossible de se connecter à Internet.\nVérifiez les paramètres de connexion\ndans les paramètres de la console,\npuis réessayez.",
|
||||
.http_ssl_error = "SSL Error - 0x%08lx.\nVérifiez la date et l'heure\net que Anemone est à jour.",
|
||||
.http303_tp = "HTTP 303 See Other (Theme Plaza)\nLe thème est-il approuvé?",
|
||||
.http303 = "HTTP 303 See Other\nTéléchargez la ressource directement\nou contactez l'administrateur du site.",
|
||||
.http404 = "HTTP 404 Not Found\nLe thème est-il approuvé?",
|
||||
@@ -1491,9 +1482,6 @@ const Language_s language_portuguese = {
|
||||
.parental_fail = "A validação dos controles parentais falhou!\nNavegador restrito.",
|
||||
.zip_not_found = "ZIP não encontrado neste URL\nSe achar que isso é um erro,\ncontate o administrador do site",
|
||||
.generic_httpc_error = "Error in HTTPC sysmodule - 0x%08lx.\nSe estiver vendo isso, contate um\ndesenvolvedor do Anenome no discord Theme Plaza.",
|
||||
.http_timeout = "HTTP Timeout.\nCheck your Wi-Fi signal and remove\nany proxy settings if set and try again.",
|
||||
.http_no_network = "Unable to connect to the Internet.\nCheck your Internet settings in the\nSystem Settings and try again.",
|
||||
.http_ssl_error = "SSL Error - 0x%08lx.\nCheck if the date/time is correct,\nand that Anemone is up to date.",
|
||||
.http303_tp = "HTTP 303 See Other (Theme Plaza)\nEsse tema foi aprovado?",
|
||||
.http303 = "HTTP 303 See Other\nBaixe o recurso diretamente\nou contate o administrador do site.",
|
||||
.http404 = "HTTP 404 Not Found\nEsse tema foi aprovado?",
|
||||
@@ -1903,9 +1891,6 @@ const Language_s language_korean = {
|
||||
.parental_fail = "Parental Control validation failed!\nBrowser Access restricted.",
|
||||
.zip_not_found = "ZIP not found at this URL\nIf you believe this is an error, please\ncontact the site administrator",
|
||||
.generic_httpc_error = "Error in HTTPC sysmodule - 0x%08lx.\nIf you are seeing this, please contact an\nAnemone developer on the Theme Plaza Discord.",
|
||||
.http_timeout = "HTTP Timeout.\nCheck your Wi-Fi signal and remove\nany proxy settings if set and try again.",
|
||||
.http_no_network = "Unable to connect to the Internet.\nCheck your Internet settings in the\nSystem Settings and try again.",
|
||||
.http_ssl_error = "SSL Error - 0x%08lx.\nCheck if the date/time is correct,\nand that Anemone is up to date.",
|
||||
.http303_tp = "HTTP 303 See Other (Theme Plaza)\nHas this theme been approved?",
|
||||
.http303 = "HTTP 303 See Other\nDownload the resource directly\nor contact the site administrator.",
|
||||
.http404 = "HTTP 404 Not Found\nHas this theme been approved?",
|
||||
@@ -2076,415 +2061,6 @@ const Language_s language_korean = {
|
||||
}
|
||||
};
|
||||
|
||||
const Language_s language_SChinese = {
|
||||
.normal_instructions =
|
||||
{
|
||||
{
|
||||
.info_line = NULL,
|
||||
.instructions = {
|
||||
{
|
||||
"\uE000 安装主题",
|
||||
"\uE001 安装随机主题"
|
||||
},
|
||||
{
|
||||
"\uE002 更多选项",
|
||||
"\uE003 预览主题"
|
||||
},
|
||||
{
|
||||
"\uE004 选择开机图画",
|
||||
"\uE005 扫描QR码"
|
||||
},
|
||||
{
|
||||
"退出",
|
||||
"从SD卡删除"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
.info_line = NULL,
|
||||
.instructions = {
|
||||
{
|
||||
"\uE000 安装开机图画",
|
||||
"\uE001 删除已安装的开机图画"
|
||||
},
|
||||
{
|
||||
"\uE002 更多选项",
|
||||
"\uE003 预览开机图像"
|
||||
},
|
||||
{
|
||||
"\uE004 选择主题",
|
||||
"\uE005 扫描QR码"
|
||||
},
|
||||
{
|
||||
"退出",
|
||||
"从SD卡删除"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
.install_instructions =
|
||||
{
|
||||
.info_line = "\uE001 取消安装",
|
||||
.instructions = {
|
||||
{
|
||||
"\uE079 安装主题",
|
||||
"\uE07A 安装随机主题"
|
||||
},
|
||||
{
|
||||
"\uE07B 仅安装主题BGM",
|
||||
"\uE07C 仅安装主题背景"
|
||||
},
|
||||
{
|
||||
NULL,
|
||||
NULL
|
||||
},
|
||||
{
|
||||
"退出",
|
||||
NULL
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
.extra_instructions =
|
||||
{
|
||||
{
|
||||
.info_line = "\uE001 退出排序菜单",
|
||||
.instructions = {
|
||||
{
|
||||
"\uE079 按名字排序",
|
||||
"\uE07A 按作者排序"
|
||||
},
|
||||
{
|
||||
"\uE07B 按文件名排序",
|
||||
NULL
|
||||
},
|
||||
{
|
||||
NULL,
|
||||
NULL
|
||||
},
|
||||
{
|
||||
"退出",
|
||||
NULL
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
.info_line = "\uE001 退出更多选项",
|
||||
.instructions = {
|
||||
{
|
||||
"\uE079 跳转列表",
|
||||
"\uE07A 重新加载损坏图标"
|
||||
},
|
||||
{
|
||||
"\uE07B 浏览ThemePlaza",
|
||||
"\uE07C 安装徽章"
|
||||
},
|
||||
{
|
||||
"\uE004 排序菜单",
|
||||
"\uE005 导出菜单"
|
||||
},
|
||||
{
|
||||
"退出",
|
||||
NULL
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
.info_line = "\uE001 退出导出菜单",
|
||||
.instructions = {
|
||||
{
|
||||
"\uE079 导出当前主题",
|
||||
"\uE07A 导出所有主题"
|
||||
},
|
||||
{
|
||||
"\uE07B 导出徽章",
|
||||
NULL
|
||||
},
|
||||
{
|
||||
NULL,
|
||||
NULL
|
||||
},
|
||||
{
|
||||
"退出",
|
||||
NULL
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
.camera =
|
||||
{
|
||||
.quit = "按 \uE005 退出",
|
||||
.thread_error = "创建调用相机线程失败\n请把此问题报告给开发者",
|
||||
.zip_not_theme_splash = "下载的zip既不是主题也不是开机图画",
|
||||
.file_not_zip = "下载的文件不是zip",
|
||||
.download_failed = "下载失败",
|
||||
.badge_question = "未检查到主题或开机图画\n这是否是徽章?",
|
||||
},
|
||||
.draw =
|
||||
{
|
||||
.theme_mode = "主题",
|
||||
.splash_mode = "开机图画",
|
||||
.no_themes = "未发现主题",
|
||||
.no_splashes = "未发现开机图画",
|
||||
.qr_download = "按 \uE005 从QR码下载",
|
||||
.switch_splashes = "按 \uE004 选择开机图画",
|
||||
.switch_themes = "按 \uE004 查看主题",
|
||||
.quit = "或 退出",
|
||||
.start_pos = 164, // Adjust x pos of start glyph to line up with quit string
|
||||
.by = "作者: ",
|
||||
.selected = "已选:",
|
||||
.sel = "已选:",
|
||||
.tp_theme_mode = "ThemePlaza主题",
|
||||
.tp_splash_mode = "ThemePlaza开机图画",
|
||||
.tp_badge_mode = "ThemePlaza徽章",
|
||||
.search = "搜索...",
|
||||
.page = "页面:",
|
||||
.err_quit = "按 \uE000 退出",
|
||||
.warn_continue = "按 \uE000 继续",
|
||||
.yes_no = "\uE000 确认 \uE001 取消",
|
||||
.load_themes = "正在加载主题, 请稍等...",
|
||||
.load_splash = "正在加载开机图画, 请稍等...",
|
||||
.load_icons = "正在加载图标, 请稍等...",
|
||||
.install_splash = "正在安装开机图画...",
|
||||
.delete_splash = "正在删除安装的开机图画...",
|
||||
.install_theme = "正在安装主题...",
|
||||
.install_shuffle = "正在安装随机主题...",
|
||||
.install_bgm = "正在安装仅主题BGM...",
|
||||
.install_no_bgm = "正在安装仅主题背景...",
|
||||
.downloading = "下载中...",
|
||||
.checking_dl = "正在检查下载的文件...",
|
||||
.delete_sd = "正在从SD卡删除...",
|
||||
.download_themes = "正在下载主题列表, 请稍等...",
|
||||
.download_splashes = "正在下载开机图画列表, 请稍等...",
|
||||
.download_badges = "正在下载徽章列表, 请稍等...",
|
||||
.download_preview = "正在下载预览图, 请稍等...",
|
||||
.download_bgm = "正在下载BGM, 请稍等...",
|
||||
.dump_single = "正在导出主题, 请稍等...",
|
||||
.dump_all_official = "正在导出官方主题, 请稍等...",
|
||||
.dump_badges = "正在导出已安装的徽章, 请稍等...",
|
||||
.install_badges = "正在安装徽章, 请稍等...",
|
||||
.shuffle = "已选: %i/10",
|
||||
},
|
||||
.fs =
|
||||
{
|
||||
.illegal_input = "输入的文字不得含有:\n" ILLEGAL_CHARS,
|
||||
.new_or_overwrite = "重命名文件名或覆盖文件",
|
||||
.cancel = "取消",
|
||||
.overwrite = "覆盖",
|
||||
.rename = "重命名",
|
||||
.swkbd_fail = "???\n请尝试USB键盘", // Should never be used
|
||||
.sd_full = "储存空间已满\n请删除一些不需要的文件以空出储存",
|
||||
.fs_error = "Error:\n请更换储存卡",
|
||||
},
|
||||
.loading =
|
||||
{
|
||||
.no_preview = "没有发现预览图",
|
||||
},
|
||||
.main =
|
||||
{
|
||||
.position_too_big = "跳转项必须小于或等于跳转项!",
|
||||
.position_zero = "跳转项必须可用!",
|
||||
.jump_q = "请输入跳转项\n图标可能会重新加载",
|
||||
.cancel = "取消",
|
||||
.jump = "跳转",
|
||||
.no_theme_extdata = "主题的追加数据不存在!\n请从Home菜单设置一个主题",
|
||||
.loading_qr = "正在加载QR码相机...",
|
||||
.no_wifi = "请在扫描QR码前连接WiFi",
|
||||
.qr_homebrew = "无法在从HomebrewLauncher启动的Anemone中扫描QR码, \n请使用ThemePlaza代替",
|
||||
.camera_broke = "你的相机可能有问题,\n无法扫描QR码",
|
||||
.too_many_themes = "你选择了太多主题",
|
||||
.not_enough_themes = "你没有足够的主题可以选择",
|
||||
.uninstall_confirm = "真的要删除已安装的开机图画吗?",
|
||||
.delete_confirm = "真的要删除这个?",
|
||||
},
|
||||
.remote =
|
||||
{
|
||||
.no_results = "没有搜索到相关内容",
|
||||
.check_wifi = "无法下载ThemePlaza数据\n请确保WiFi已开启",
|
||||
.new_page_big = "新页面必须小于或等于页面数!",
|
||||
.new_page_zero = "新页面必须可用!",
|
||||
.jump_page = "请输入跳转页面?",
|
||||
.cancel = "取消",
|
||||
.jump = "跳转",
|
||||
.tags = "请输入想要搜索的关键词",
|
||||
.search = "搜索",
|
||||
.parental_fail = "家长控制验证失败!\n浏览器将会受限",
|
||||
.zip_not_found = "在此链接未发现ZIP\n如果你认为这是错误, \n请联系网站管理员",
|
||||
.generic_httpc_error = "错误HTTPC sysmodule - 0x%08lx.\n如果你看见了这个, \n请在ThemePlaza Discord联系Anemone开发者",
|
||||
.http_timeout = "HTTP超时\n请检查你的Wi-Fi然后移除设置的所有代理服务器选项并重试",
|
||||
.http_no_network = "无法连接到网络\n请检查你的网络设置并重试",
|
||||
.http_ssl_error = "SSL证书错误 - 0x%08lx.\n请检查主机的日期和时间是否正确\n以及Anemone是否已经更新到最新版本",
|
||||
.http303_tp = "HTTP 303 See Other (Theme Plaza)\n此主题是否已获得批准?",
|
||||
.http303 = "HTTP 303 See Other\n请直接下载文件或联系网站管理员",
|
||||
.http404 = "HTTP 404 Not Found\n此主题是否已获得批准?",
|
||||
.http_err_url = "HTTP %s\n检查此链接是否有误",
|
||||
.http_errcode_generic = "HTTP %s\n请联系网站管理员",
|
||||
.http401 = "401 Unauthorized",
|
||||
.http403 = "403 Forbidden",
|
||||
.http407 = "407 Proxy Authentication Required",
|
||||
.http414 = "HTTP 414 URL Too Long\nQR码指向一个非常长的链接\n请直接下载文件",
|
||||
.http418 = "HTTP 418 I'm a teapot\n请联系网站管理员",
|
||||
.http426 = "HTTP 426 Upgrade Required\n3DS无法连接到此服务器\n请联系网站管理员",
|
||||
.http451 = "HTTP 451 Unavailable for Legal Reasons\n出于某些法律原因阻止访问主机服务器",
|
||||
.http500 = "HTTP 500 Internal Server Error\n请联系网站管理员",
|
||||
.http502 = "HTTP 502 Bad Gateway\n请联系网站管理员",
|
||||
.http503 = "HTTP 503 Service Unavailable\n请联系网站管理员",
|
||||
.http504 = "HTTP 504 Gateway Timeout\n请联系网站管理员",
|
||||
.http_unexpected = "HTTP %u\n如果你认为这是错误, 请联系网站管理员",
|
||||
},
|
||||
.remote_instructions =
|
||||
{
|
||||
{
|
||||
.info_line = NULL,
|
||||
.instructions = {
|
||||
{
|
||||
"\uE000 下载主题",
|
||||
"\uE001 返回"
|
||||
},
|
||||
{
|
||||
"\uE002 更多选项",
|
||||
"\uE003 预览主题"
|
||||
},
|
||||
{
|
||||
"\uE004 上一页",
|
||||
"\uE005 下一页"
|
||||
},
|
||||
{
|
||||
"退出",
|
||||
NULL
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
.info_line = NULL,
|
||||
.instructions = {
|
||||
{
|
||||
"\uE000 下载开机图画",
|
||||
"\uE001 返回"
|
||||
},
|
||||
{
|
||||
"\uE002 更多选项",
|
||||
"\uE003 预览开机图画"
|
||||
},
|
||||
{
|
||||
"\uE004 上一页",
|
||||
"\uE005 下一页"
|
||||
},
|
||||
{
|
||||
"退出",
|
||||
NULL
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
.info_line = NULL,
|
||||
.instructions = {
|
||||
{
|
||||
"\uE000 下载徽章",
|
||||
"\uE001 返回"
|
||||
},
|
||||
{
|
||||
"\uE002 更多选项",
|
||||
"\uE003 预览徽章"
|
||||
},
|
||||
{
|
||||
"\uE004 上一页",
|
||||
"\uE005 下一页"
|
||||
},
|
||||
{
|
||||
"退出",
|
||||
NULL
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
.remote_extra_instructions =
|
||||
{
|
||||
{
|
||||
.info_line = "\uE001 退出更多选项",
|
||||
.instructions = {
|
||||
{
|
||||
"\uE079 跳转页面",
|
||||
"\uE07A 搜索关键词"
|
||||
},
|
||||
{
|
||||
NULL,
|
||||
"\uE07C 不使用缓存重载"
|
||||
},
|
||||
{
|
||||
"\uE004 选择徽章",
|
||||
"\uE005 选择开机画面"
|
||||
},
|
||||
{
|
||||
"退出",
|
||||
NULL
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
.info_line = "\uE001 退出更多选项",
|
||||
.instructions = {
|
||||
{
|
||||
"\uE079 跳转页面",
|
||||
"\uE07A 搜索关键词"
|
||||
},
|
||||
{
|
||||
NULL,
|
||||
"\uE07C 不使用缓存重载"
|
||||
},
|
||||
{
|
||||
"\uE004 选择主题",
|
||||
"\uE005 选择徽章"
|
||||
},
|
||||
{
|
||||
"退出",
|
||||
NULL
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
.info_line = "\uE001 退出更多选项",
|
||||
.instructions = {
|
||||
{
|
||||
"\uE079 跳转页面",
|
||||
"\uE07A 搜索关键词"
|
||||
},
|
||||
{
|
||||
NULL,
|
||||
"\uE07C 不使用缓存重载"
|
||||
},
|
||||
{
|
||||
"\uE004 选择开机图画",
|
||||
"\uE005 选择主题"
|
||||
},
|
||||
{
|
||||
"退出",
|
||||
NULL
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
.splashes =
|
||||
{
|
||||
.no_splash_found = "没有发现splash.bin或splashbottom.bin\n这是否是开机图画?",
|
||||
.splash_disabled = "WARNING: 未在Luma3DS配置界面启用此功能",
|
||||
},
|
||||
.themes =
|
||||
{
|
||||
.no_body_found = "没有发现body_LZ.bin\n这是否是主题?",
|
||||
.mono_warn = "已安装的一个或多个主题使用单声道音频\n单声道音频会导致许多问题\n查找Wiki以获取更多信息",
|
||||
.illegal_char = "使用了非法字符",
|
||||
.name_folder = "输出文件夹名",
|
||||
.cancel = "取消",
|
||||
.done = "完成"
|
||||
},
|
||||
.badges =
|
||||
{
|
||||
.extdata_locked = "追加数据被锁\n请尝试按下Home键, 然后返回 Anemone3DS, \n或使用cia版本代替\nDebug: 0x%08lx"
|
||||
}
|
||||
};
|
||||
|
||||
Language_s init_strings(CFG_Language lang)
|
||||
{
|
||||
switch (lang)
|
||||
@@ -2497,8 +2073,6 @@ Language_s init_strings(CFG_Language lang)
|
||||
case CFG_LANGUAGE_ES:
|
||||
return language_spanish;
|
||||
//case CFG_LANGUAGE_ZH:
|
||||
case CFG_LANGUAGE_ZH:
|
||||
return language_SChinese;
|
||||
case CFG_LANGUAGE_KO:
|
||||
return language_korean;
|
||||
//case CFG_LANGUAGE_NL:
|
||||
@@ -2512,12 +2086,3 @@ Language_s init_strings(CFG_Language lang)
|
||||
return language_english;
|
||||
}
|
||||
}
|
||||
|
||||
CFG_Language get_system_language(void)
|
||||
{
|
||||
u8 lang = CFG_LANGUAGE_EN;
|
||||
// can never fail, cfguInit is one of the very first thing that happens on start
|
||||
// and if it does anyway, default to english
|
||||
CFGU_GetSystemLanguage(&lang);
|
||||
return (CFG_Language)lang;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user