mirror of
https://github.com/Next-Flip/Momentum-Firmware.git
synced 2026-05-16 04:24:45 -07:00
Rename char array def for xfw app
This commit is contained in:
@@ -16,10 +16,10 @@ static void xtreme_app_scene_graphics_asset_pack_changed(VariableItem* item) {
|
||||
XtremeApp* app = variable_item_get_context(item);
|
||||
uint8_t index = variable_item_get_current_value_index(item);
|
||||
variable_item_set_current_value_text(
|
||||
item, index == 0 ? "SFW" : *asset_packs_get(app->asset_packs, index - 1));
|
||||
item, index == 0 ? "SFW" : *CharList_get(app->asset_packs, index - 1));
|
||||
strlcpy(
|
||||
XTREME_SETTINGS()->asset_pack,
|
||||
index == 0 ? "" : *asset_packs_get(app->asset_packs, index - 1),
|
||||
index == 0 ? "" : *CharList_get(app->asset_packs, index - 1),
|
||||
MAX_PACK_NAME_LEN);
|
||||
app->asset_pack = index;
|
||||
app->save_settings = true;
|
||||
@@ -80,13 +80,13 @@ void xtreme_app_scene_graphics_on_enter(void* context) {
|
||||
item = variable_item_list_add(
|
||||
var_item_list,
|
||||
"Asset Pack",
|
||||
asset_packs_size(app->asset_packs) + 1,
|
||||
CharList_size(app->asset_packs) + 1,
|
||||
xtreme_app_scene_graphics_asset_pack_changed,
|
||||
app);
|
||||
variable_item_set_current_value_index(item, app->asset_pack);
|
||||
variable_item_set_current_value_text(
|
||||
item,
|
||||
app->asset_pack == 0 ? "SFW" : *asset_packs_get(app->asset_packs, app->asset_pack - 1));
|
||||
app->asset_pack == 0 ? "SFW" : *CharList_get(app->asset_packs, app->asset_pack - 1));
|
||||
|
||||
item = variable_item_list_add(
|
||||
var_item_list,
|
||||
|
||||
@@ -194,7 +194,7 @@ XtremeApp* xtreme_app_alloc() {
|
||||
strlcpy(app->device_name, furi_hal_version_get_name_ptr(), NAMECHANGER_TEXT_STORE_SIZE);
|
||||
|
||||
app->asset_pack = 0;
|
||||
asset_packs_init(app->asset_packs);
|
||||
CharList_init(app->asset_packs);
|
||||
File* folder = storage_file_alloc(storage);
|
||||
FileInfo info;
|
||||
char* name = malloc(MAX_PACK_NAME_LEN);
|
||||
@@ -205,14 +205,14 @@ XtremeApp* xtreme_app_alloc() {
|
||||
strlcpy(copy, name, MAX_PACK_NAME_LEN);
|
||||
uint idx = 0;
|
||||
if(strcmp(copy, "NSFW") != 0) {
|
||||
for(; idx < asset_packs_size(app->asset_packs); idx++) {
|
||||
char* comp = *asset_packs_get(app->asset_packs, idx);
|
||||
for(; idx < CharList_size(app->asset_packs); idx++) {
|
||||
char* comp = *CharList_get(app->asset_packs, idx);
|
||||
if(strcasecmp(copy, comp) < 0 && strcmp(comp, "NSFW") != 0) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
asset_packs_push_at(app->asset_packs, idx, copy);
|
||||
CharList_push_at(app->asset_packs, idx, copy);
|
||||
if(app->asset_pack != 0) {
|
||||
if(idx < app->asset_pack) app->asset_pack++;
|
||||
} else {
|
||||
@@ -251,11 +251,11 @@ void xtreme_app_free(XtremeApp* app) {
|
||||
FrequencyList_clear(app->subghz_static_frequencies);
|
||||
FrequencyList_clear(app->subghz_hopper_frequencies);
|
||||
|
||||
asset_packs_it_t it;
|
||||
for(asset_packs_it(it, app->asset_packs); !asset_packs_end_p(it); asset_packs_next(it)) {
|
||||
free(*asset_packs_cref(it));
|
||||
CharList_it_t it;
|
||||
for(CharList_it(it, app->asset_packs); !CharList_end_p(it); CharList_next(it)) {
|
||||
free(*CharList_cref(it));
|
||||
}
|
||||
asset_packs_clear(app->asset_packs);
|
||||
CharList_clear(app->asset_packs);
|
||||
|
||||
furi_string_free(app->version_tag);
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
|
||||
#define XTREME_SUBGHZ_FREQ_BUFFER_SIZE 6
|
||||
|
||||
ARRAY_DEF(asset_packs, char*)
|
||||
ARRAY_DEF(CharList, char*)
|
||||
|
||||
typedef struct {
|
||||
Gui* gui;
|
||||
@@ -43,7 +43,7 @@ typedef struct {
|
||||
int dolphin_level;
|
||||
char device_name[NAMECHANGER_TEXT_STORE_SIZE];
|
||||
uint asset_pack;
|
||||
asset_packs_t asset_packs;
|
||||
CharList_t asset_packs;
|
||||
FuriString* version_tag;
|
||||
bool save_subghz;
|
||||
bool save_subghz_frequencies;
|
||||
|
||||
Reference in New Issue
Block a user