diff --git a/applications/services/desktop/animations/animation_manager.c b/applications/services/desktop/animations/animation_manager.c index 38496d6bd..f4bf320ff 100644 --- a/applications/services/desktop/animations/animation_manager.c +++ b/applications/services/desktop/animations/animation_manager.c @@ -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); + blocking_animation = animation_storage_find_animation(BAD_SD_ANIMATION_NAME, false); 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); + blocking_animation = animation_storage_find_animation(SD_OK_ANIMATION_NAME, false); 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); + blocking_animation = animation_storage_find_animation(NO_DB_ANIMATION_NAME, false); 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); + blocking_animation = animation_storage_find_animation(URL_ANIMATION_NAME, false); 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); + blocking_animation = animation_storage_find_animation(NEW_MAIL_ANIMATION_NAME, false); furi_check(blocking_animation); animation_manager->levelup_pending = true; } @@ -446,12 +446,22 @@ 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); + selected = animation_storage_find_animation(HARDCODED_ANIMATION_NAME, false); } 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); + 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); + } + } } furi_assert(selected); @@ -510,7 +520,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)); + furi_string_get_cstr(animation_manager->freezed_animation_name), false); /* all blocked animations must be in flipper -> we can * always find blocking animation */ furi_assert(restore_animation); @@ -522,7 +532,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)); + furi_string_get_cstr(animation_manager->freezed_animation_name), false); if(restore_animation) { Dolphin* dolphin = furi_record_open(RECORD_DOLPHIN); DolphinStats stats = dolphin_stats(dolphin); diff --git a/applications/services/desktop/animations/animation_storage.c b/applications/services/desktop/animations/animation_storage.c index d04871e62..30fa0c014 100644 --- a/applications/services/desktop/animations/animation_storage.c +++ b/applications/services/desktop/animations/animation_storage.c @@ -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() { +void animation_handler_select_manifest(bool force_stock) { XtremeSettings* xtreme_settings = XTREME_SETTINGS(); FuriString* anim_dir = furi_string_alloc(); FuriString* manifest = furi_string_alloc(); - bool use_asset_pack = xtreme_settings->asset_pack[0] != '\0'; + bool use_asset_pack = !force_stock && xtreme_settings->asset_pack[0] != '\0'; if(use_asset_pack) { furi_string_printf(anim_dir, "%s/%s/Anims", PACKS_DIR, xtreme_settings->asset_pack); furi_string_printf(manifest, "%s/manifest.txt", furi_string_get_cstr(anim_dir)); @@ -60,9 +60,10 @@ void animation_handler_select_manifest() { static bool animation_storage_load_single_manifest_info( StorageAnimationManifestInfo* manifest_info, - const char* name) { + const char* name, + bool force_stock) { furi_assert(manifest_info); - animation_handler_select_manifest(); + animation_handler_select_manifest(force_stock); bool result = false; Storage* storage = furi_record_open(RECORD_STORAGE); FlipperFormat* file = flipper_format_file_alloc(storage); @@ -118,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(); + animation_handler_select_manifest(false); Storage* storage = furi_record_open(RECORD_STORAGE); FlipperFormat* file = flipper_format_file_alloc(storage); @@ -174,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) { +StorageAnimation* animation_storage_find_animation(const char* name, bool force_stock) { furi_assert(name); furi_assert(strlen(name)); StorageAnimation* storage_animation = NULL; @@ -201,8 +202,8 @@ StorageAnimation* animation_storage_find_animation(const char* name) { storage_animation->external = true; bool result = false; - result = - animation_storage_load_single_manifest_info(&storage_animation->manifest_info, name); + result = animation_storage_load_single_manifest_info( + &storage_animation->manifest_info, name, force_stock); if(result) { storage_animation->animation = animation_storage_load_animation(name); result = !!storage_animation->animation; diff --git a/applications/services/desktop/animations/animation_storage.h b/applications/services/desktop/animations/animation_storage.h index 16c0feab4..55512e008 100644 --- a/applications/services/desktop/animations/animation_storage.h +++ b/applications/services/desktop/animations/animation_storage.h @@ -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); +StorageAnimation* animation_storage_find_animation(const char* name, bool force_stock); /** * Get meta information of storage animation. diff --git a/assets/dolphin/external/L3_Sunflower_128x64/frame_0.png b/assets/dolphin/external/L3_Sunflower_128x64/frame_0.png new file mode 100644 index 000000000..023da26d5 Binary files /dev/null and b/assets/dolphin/external/L3_Sunflower_128x64/frame_0.png differ diff --git a/assets/dolphin/external/L3_Sunflower_128x64/frame_1.png b/assets/dolphin/external/L3_Sunflower_128x64/frame_1.png new file mode 100644 index 000000000..999e5af17 Binary files /dev/null and b/assets/dolphin/external/L3_Sunflower_128x64/frame_1.png differ diff --git a/assets/dolphin/external/L3_Sunflower_128x64/frame_2.png b/assets/dolphin/external/L3_Sunflower_128x64/frame_2.png new file mode 100644 index 000000000..fa2782f2d Binary files /dev/null and b/assets/dolphin/external/L3_Sunflower_128x64/frame_2.png differ diff --git a/assets/dolphin/external/L3_Sunflower_128x64/frame_3.png b/assets/dolphin/external/L3_Sunflower_128x64/frame_3.png new file mode 100644 index 000000000..f86f35cec Binary files /dev/null and b/assets/dolphin/external/L3_Sunflower_128x64/frame_3.png differ diff --git a/assets/dolphin/external/L3_Sunflower_128x64/frame_4.png b/assets/dolphin/external/L3_Sunflower_128x64/frame_4.png new file mode 100644 index 000000000..b86eba07d Binary files /dev/null and b/assets/dolphin/external/L3_Sunflower_128x64/frame_4.png differ diff --git a/assets/dolphin/external/L3_Sunflower_128x64/frame_5.png b/assets/dolphin/external/L3_Sunflower_128x64/frame_5.png new file mode 100644 index 000000000..e8303b575 Binary files /dev/null and b/assets/dolphin/external/L3_Sunflower_128x64/frame_5.png differ diff --git a/assets/dolphin/external/L3_Sunflower_128x64/frame_6.png b/assets/dolphin/external/L3_Sunflower_128x64/frame_6.png new file mode 100644 index 000000000..aaaa2a5cd Binary files /dev/null and b/assets/dolphin/external/L3_Sunflower_128x64/frame_6.png differ diff --git a/assets/dolphin/external/L3_Sunflower_128x64/meta.txt b/assets/dolphin/external/L3_Sunflower_128x64/meta.txt new file mode 100644 index 000000000..f93fdaae7 --- /dev/null +++ b/assets/dolphin/external/L3_Sunflower_128x64/meta.txt @@ -0,0 +1,14 @@ +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 diff --git a/assets/dolphin/external/manifest.txt b/assets/dolphin/external/manifest.txt index f9303a6ff..52cc88a7e 100644 --- a/assets/dolphin/external/manifest.txt +++ b/assets/dolphin/external/manifest.txt @@ -133,3 +133,10 @@ 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