Move is_nsfw to xtreme_assets struct

This commit is contained in:
Willy-JL
2024-01-14 00:16:26 +00:00
parent 23ad52944b
commit f475bdd522
8 changed files with 22 additions and 14 deletions
+5 -1
View File
@@ -9,6 +9,10 @@
#define ICONS_FMT XTREME_ASSETS_PATH "/%s/Icons/%s"
XtremeAssets xtreme_assets = {
.is_nsfw = false,
};
void load_icon_animated(const Icon* replace, const char* name, FuriString* path, File* file) {
const char* pack = xtreme_settings.asset_pack;
furi_string_printf(path, ICONS_FMT "/meta", pack, name);
@@ -103,7 +107,7 @@ void free_icon(const Icon* icon) {
void XTREME_ASSETS_LOAD() {
const char* pack = xtreme_settings.asset_pack;
xtreme_settings.is_nsfw = !strncmp(pack, "NSFW", strlen("NSFW"));
xtreme_assets.is_nsfw = !strncmp(pack, "NSFW", strlen("NSFW"));
if(pack[0] == '\0') return;
Storage* storage = furi_record_open(RECORD_STORAGE);
+5 -2
View File
@@ -51,8 +51,6 @@ typedef enum {
} UARTChannel;
typedef struct {
bool is_nsfw; // TODO: replace with packs text support
char asset_pack[XTREME_ASSETS_PACK_NAME_LEN];
uint32_t anim_speed;
int32_t cycle_anims;
@@ -91,12 +89,17 @@ typedef struct {
UARTChannel uart_general_channel;
} XtremeSettings;
typedef struct {
bool is_nsfw; // TODO: replace with packs text support
} XtremeAssets;
void XTREME_SETTINGS_LOAD();
void XTREME_SETTINGS_SAVE();
extern XtremeSettings xtreme_settings;
void XTREME_ASSETS_LOAD();
void XTREME_ASSETS_FREE();
extern XtremeAssets xtreme_assets;
#ifdef __cplusplus
}