TP Badge Browser. Incomplete - see notes
TODO: - Load icons for browser - Fix previews (max tex size 512x512 and preview image 512x1024?
This commit is contained in:
@@ -71,6 +71,14 @@ typedef enum {
|
||||
DRAW_MODE_AMOUNT,
|
||||
} DrawMode;
|
||||
|
||||
typedef enum {
|
||||
REMOTE_MODE_THEMES = 0,
|
||||
REMOTE_MODE_SPLASHES,
|
||||
REMOTE_MODE_BADGES,
|
||||
|
||||
REMOTE_MODE_AMOUNT,
|
||||
} RemoteMode;
|
||||
|
||||
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];
|
||||
|
||||
@@ -52,6 +52,7 @@ typedef enum InstallType_e {
|
||||
|
||||
INSTALL_LOADING_REMOTE_THEMES,
|
||||
INSTALL_LOADING_REMOTE_SPLASHES,
|
||||
INSTALL_LOADING_REMOTE_BADGES,
|
||||
INSTALL_LOADING_REMOTE_PREVIEW,
|
||||
INSTALL_LOADING_REMOTE_BGM,
|
||||
|
||||
@@ -82,6 +83,7 @@ typedef enum {
|
||||
|
||||
TEXT_INSTALL_LOADING_REMOTE_THEMES,
|
||||
TEXT_INSTALL_LOADING_REMOTE_SPLASHES,
|
||||
TEXT_INSTALL_LOADING_REMOTE_BADGES,
|
||||
TEXT_INSTALL_LOADING_REMOTE_PREVIEW,
|
||||
TEXT_INSTALL_LOADING_REMOTE_BGM,
|
||||
|
||||
@@ -111,6 +113,7 @@ typedef enum {
|
||||
|
||||
TEXT_THEMEPLAZA_THEME_MODE,
|
||||
TEXT_THEMEPLAZA_SPLASH_MODE,
|
||||
TEXT_THEMEPLAZA_BADGE_MODE,
|
||||
|
||||
TEXT_SEARCH,
|
||||
TEXT_PAGE,
|
||||
@@ -167,7 +170,7 @@ void set_screen(C3D_RenderTarget * screen);
|
||||
void throw_error(const char * error, ErrorLevel level);
|
||||
bool draw_confirm(const char * conf_msg, Entry_List_s * list, DrawMode draw_mode);
|
||||
|
||||
void draw_preview(C2D_Image preview, int preview_offset);
|
||||
void draw_preview(C2D_Image preview, int preview_offset, float preview_scale);
|
||||
|
||||
void draw_install(InstallType type);
|
||||
void draw_loading_bar(u32 current, u32 max, InstallType type);
|
||||
|
||||
@@ -66,6 +66,6 @@ u32 compress_lz_file_fast(FS_Path path, FS_Archive archive, char * in_buf, u32 s
|
||||
|
||||
Result buf_to_file(u32 size, FS_Path path, FS_Archive archive, char * buf);
|
||||
void remake_file(FS_Path path, FS_Archive archive, u32 size);
|
||||
void save_zip_to_sd(char * filename, u32 size, char * buf, EntryMode mode);
|
||||
void save_zip_to_sd(char * filename, u32 size, char * buf, RemoteMode mode);
|
||||
|
||||
#endif
|
||||
|
||||
@@ -39,6 +39,12 @@
|
||||
#define THEMEPLAZA_JSON_PAGE_COUNT "pages"
|
||||
#define THEMEPLAZA_JSON_PAGE_IDS "items"
|
||||
|
||||
#define THEMEPLAZA_QUERY_ENTRY_INFO THEMEPLAZA_BASE_API_URL "/query?item_id=%" JSON_INTEGER_FORMAT
|
||||
#define THEMEPLAZA_JSON_TITLE "title"
|
||||
#define THEMEPLAZA_JSON_AUTHOR "author"
|
||||
#define THEMEPLAZA_JSON_DESC "description"
|
||||
#define THEMEPLAZA_JSON_SUCCESS "success"
|
||||
|
||||
#define THEMEPLAZA_JSON_ERROR_MESSAGE "message"
|
||||
#define THEMEPLAZA_JSON_ERROR_MESSAGE_NOT_FOUND "No items found"
|
||||
|
||||
@@ -62,7 +68,7 @@ typedef struct {
|
||||
char *mime_type;
|
||||
} curl_header;
|
||||
|
||||
bool themeplaza_browser(EntryMode mode);
|
||||
bool themeplaza_browser(RemoteMode mode);
|
||||
Result http_get(const char * url, char ** filename, char ** buf, u32 * size, InstallType install_type, const char * acceptable_mime_types);
|
||||
|
||||
#endif
|
||||
|
||||
@@ -31,9 +31,6 @@
|
||||
#include "draw.h"
|
||||
#include "common.h"
|
||||
|
||||
#define SPLASHES_STRINGS 2
|
||||
#define THEMES_STRINGS 6
|
||||
|
||||
typedef struct {
|
||||
const char *quit;
|
||||
const char *thread_error;
|
||||
@@ -56,6 +53,7 @@ typedef struct {
|
||||
const char *sel;
|
||||
const char *tp_theme_mode;
|
||||
const char *tp_splash_mode;
|
||||
const char *tp_badge_mode;
|
||||
const char *search;
|
||||
const char *page;
|
||||
const char *err_quit;
|
||||
@@ -75,6 +73,7 @@ typedef struct {
|
||||
const char *delete_sd;
|
||||
const char *download_themes;
|
||||
const char *download_splashes;
|
||||
const char *download_badges;
|
||||
const char *download_preview;
|
||||
const char *download_bgm;
|
||||
const char *dump_single;
|
||||
@@ -176,7 +175,7 @@ typedef struct {
|
||||
Loading_Strings_s loading;
|
||||
Main_Strings_s main;
|
||||
Remote_Strings_s remote;
|
||||
Instructions_s remote_instructions[MODE_AMOUNT];
|
||||
Instructions_s remote_instructions[REMOTE_MODE_AMOUNT];
|
||||
Instructions_s remote_extra_instructions;
|
||||
Splashes_Strings_s splashes;
|
||||
Themes_Strings_s themes;
|
||||
|
||||
Reference in New Issue
Block a user