Revert "Formatting"

This reverts commit a441feec83.
This commit is contained in:
Willy-JL
2023-05-09 18:11:05 +01:00
parent 02a658e0c7
commit efe6dbf008
12 changed files with 18 additions and 50 deletions

View File

@@ -217,25 +217,25 @@ static bool animation_manager_check_blocking(AnimationManager* animation_manager
FS_Error sd_status = storage_sd_status(storage);
if(sd_status == FSE_INTERNAL) {
blocking_animation = animation_storage_find_animation(BAD_SD_ANIMATION_NAME, false);
blocking_animation = animation_storage_find_animation(BAD_SD_ANIMATION_NAME);
furi_assert(blocking_animation);
} else if(sd_status == FSE_NOT_READY) {
animation_manager->sd_shown_sd_ok = false;
animation_manager->sd_shown_no_db = false;
} else if(sd_status == FSE_OK) {
if(!animation_manager->sd_shown_sd_ok) {
blocking_animation = animation_storage_find_animation(SD_OK_ANIMATION_NAME, false);
blocking_animation = animation_storage_find_animation(SD_OK_ANIMATION_NAME);
furi_assert(blocking_animation);
animation_manager->sd_shown_sd_ok = true;
} else if(!animation_manager->sd_shown_no_db) {
if(!storage_file_exists(storage, EXT_PATH("Manifest"))) {
blocking_animation = animation_storage_find_animation(NO_DB_ANIMATION_NAME, false);
blocking_animation = animation_storage_find_animation(NO_DB_ANIMATION_NAME);
furi_assert(blocking_animation);
animation_manager->sd_shown_no_db = true;
animation_manager->sd_show_url = true;
}
} else if(animation_manager->sd_show_url) {
blocking_animation = animation_storage_find_animation(URL_ANIMATION_NAME, false);
blocking_animation = animation_storage_find_animation(URL_ANIMATION_NAME);
furi_assert(blocking_animation);
animation_manager->sd_show_url = false;
}
@@ -245,7 +245,7 @@ static bool animation_manager_check_blocking(AnimationManager* animation_manager
DolphinStats stats = dolphin_stats(dolphin);
furi_record_close(RECORD_DOLPHIN);
if(!blocking_animation && stats.level_up_is_pending) {
blocking_animation = animation_storage_find_animation(NEW_MAIL_ANIMATION_NAME, false);
blocking_animation = animation_storage_find_animation(NEW_MAIL_ANIMATION_NAME);
furi_check(blocking_animation);
animation_manager->levelup_pending = true;
}
@@ -446,22 +446,12 @@ static StorageAnimation*
/* cache animation, if failed - choose reliable animation */
if(selected == NULL) {
FURI_LOG_E(TAG, "Can't find valid animation in manifest");
selected = animation_storage_find_animation(HARDCODED_ANIMATION_NAME, false);
selected = animation_storage_find_animation(HARDCODED_ANIMATION_NAME);
} else if(!animation_storage_get_bubble_animation(selected)) {
const char* name = animation_storage_get_meta(selected)->name;
FURI_LOG_E(TAG, "Can't upload animation described in manifest: \'%s\'", name);
animation_storage_free_storage_animation(&selected);
selected = animation_storage_find_animation(HARDCODED_ANIMATION_NAME, false);
} else {
FuriHalRtcDateTime date;
furi_hal_rtc_get_datetime(&date);
if(date.month == 4 && date.day == 1 && furi_hal_random_get() % 2) {
animation_storage_free_storage_animation(&selected);
selected = animation_storage_find_animation("L3_Sunflower_128x64", true);
if(selected == NULL) {
selected = animation_storage_find_animation(HARDCODED_ANIMATION_NAME, false);
}
}
selected = animation_storage_find_animation(HARDCODED_ANIMATION_NAME);
}
furi_assert(selected);
@@ -520,7 +510,7 @@ void animation_manager_load_and_continue_animation(AnimationManager* animation_m
if(animation_manager->state == AnimationManagerStateFreezedBlocked) {
StorageAnimation* restore_animation = animation_storage_find_animation(
furi_string_get_cstr(animation_manager->freezed_animation_name), false);
furi_string_get_cstr(animation_manager->freezed_animation_name));
/* all blocked animations must be in flipper -> we can
* always find blocking animation */
furi_assert(restore_animation);
@@ -532,7 +522,7 @@ void animation_manager_load_and_continue_animation(AnimationManager* animation_m
if(!blocked) {
/* if no blocking - try restore last one idle */
StorageAnimation* restore_animation = animation_storage_find_animation(
furi_string_get_cstr(animation_manager->freezed_animation_name), false);
furi_string_get_cstr(animation_manager->freezed_animation_name));
if(restore_animation) {
Dolphin* dolphin = furi_record_open(RECORD_DOLPHIN);
DolphinStats stats = dolphin_stats(dolphin);

View File

@@ -30,11 +30,11 @@ static void animation_storage_free_frames(BubbleAnimation* animation);
static void animation_storage_free_animation(BubbleAnimation** storage_animation);
static BubbleAnimation* animation_storage_load_animation(const char* name);
void animation_handler_select_manifest(bool force_stock) {
void animation_handler_select_manifest() {
XtremeSettings* xtreme_settings = XTREME_SETTINGS();
FuriString* anim_dir = furi_string_alloc();
FuriString* manifest = furi_string_alloc();
bool use_asset_pack = !force_stock && xtreme_settings->asset_pack[0] != '\0';
bool use_asset_pack = xtreme_settings->asset_pack[0] != '\0';
if(use_asset_pack) {
furi_string_printf(
anim_dir, "%s/%s/Anims", XTREME_ASSETS_PATH, xtreme_settings->asset_pack);
@@ -61,10 +61,9 @@ void animation_handler_select_manifest(bool force_stock) {
static bool animation_storage_load_single_manifest_info(
StorageAnimationManifestInfo* manifest_info,
const char* name,
bool force_stock) {
const char* name) {
furi_assert(manifest_info);
animation_handler_select_manifest(force_stock);
animation_handler_select_manifest();
bool result = false;
Storage* storage = furi_record_open(RECORD_STORAGE);
FlipperFormat* file = flipper_format_file_alloc(storage);
@@ -120,7 +119,7 @@ static bool animation_storage_load_single_manifest_info(
void animation_storage_fill_animation_list(StorageAnimationList_t* animation_list) {
furi_assert(sizeof(StorageAnimationList_t) == sizeof(void*));
furi_assert(!StorageAnimationList_size(*animation_list));
animation_handler_select_manifest(false);
animation_handler_select_manifest();
Storage* storage = furi_record_open(RECORD_STORAGE);
FlipperFormat* file = flipper_format_file_alloc(storage);
@@ -176,7 +175,7 @@ void animation_storage_fill_animation_list(StorageAnimationList_t* animation_lis
furi_record_close(RECORD_STORAGE);
}
StorageAnimation* animation_storage_find_animation(const char* name, bool force_stock) {
StorageAnimation* animation_storage_find_animation(const char* name) {
furi_assert(name);
furi_assert(strlen(name));
StorageAnimation* storage_animation = NULL;
@@ -203,8 +202,8 @@ StorageAnimation* animation_storage_find_animation(const char* name, bool force_
storage_animation->external = true;
bool result = false;
result = animation_storage_load_single_manifest_info(
&storage_animation->manifest_info, name, force_stock);
result =
animation_storage_load_single_manifest_info(&storage_animation->manifest_info, name);
if(result) {
storage_animation->animation = animation_storage_load_animation(name);
result = !!storage_animation->animation;

View File

@@ -61,7 +61,7 @@ void animation_storage_cache_animation(StorageAnimation* storage_animation);
* @name name of animation
* @return found animation. NULL if nothing found.
*/
StorageAnimation* animation_storage_find_animation(const char* name, bool force_stock);
StorageAnimation* animation_storage_find_animation(const char* name);
/**
* Get meta information of storage animation.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 585 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 125 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 954 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

View File

@@ -1,14 +0,0 @@
Filetype: Flipper Animation
Version: 1
Width: 128
Height: 64
Passive frames: 16
Active frames: 0
Frames order: 0 1 2 3 4 5 5 5 6 6 6 6 6 6 3 3
Active cycles: 0
Frame rate: 1
Duration: 360
Active cooldown: 0
Bubble slots: 0

View File

@@ -133,10 +133,3 @@ Max butthurt: 10
Min level: 27
Max level: 30
Weight: 3
Name: L3_Sunflower_128x64
Min butthurt: 0
Max butthurt: 14
Min level: 1
Max level: 30
Weight: 0