[FL-2183] [FL-2209] Dolphin Deeds, Level up, assets generation, refactoring (#965)
* Desktop: cleanup headers
* Get loader pubsub via record
* [FL-2183] Dolphin refactoring 2022.01
* Restruct animations assets structure
* Rename assets
* Cleanup headers
* Update Recording animation
* Add BadBattery animation
* Provide loader's pubsub via record
* Fix load/unload animations
* Scripts: add flipper format support, initial dolphin packager rework. Assets: internal and external dolphin.
* Sync internal meta.txt and manifest.txt
* Reorder, rename dolphin assets
* Split essential generated assets
* Add ReadMe for dolphin assets
* Separate essential blocking animations
* Scripts: full dolphin validation before packaging
* Assets, Scripts: dolphin external resources packer
* Github: update codeowners
* Scripts: proper slots handling in dolphin animation meta
* Scripts: correct frames enumeration and fix compiled assets.
* [FL-2209] Add Dolphin Deeds points and many more
* Remove excess frame_rate
* Change dolphin assets directory
* Scripts: add internal resource support to dolphin compiler
* Scripts: add internal assets generation, renaming
* Scripts: correct assert, renaming
* Code cleanup, documentation, fixes
* Update Levelup animations
* Rename essential -> blocking
* Fix Unlocked hint
* Scripts: rewrite Templite compiller, replace regexps with token parser, split block types into code and variable blocks. Update dolphin templates.
* Documentation: add key combos description and use information
* Scripts: cleanup templit, more debug info and add dev comment
Co-authored-by: あく <alleteam@gmail.com>
2022-01-29 12:20:41 +03:00
|
|
|
#include <gui/view_stack.h>
|
|
|
|
#include <stdint.h>
|
|
|
|
#include <furi.h>
|
2022-05-11 12:45:01 +03:00
|
|
|
#include <furi_hal.h>
|
[FL-2183] [FL-2209] Dolphin Deeds, Level up, assets generation, refactoring (#965)
* Desktop: cleanup headers
* Get loader pubsub via record
* [FL-2183] Dolphin refactoring 2022.01
* Restruct animations assets structure
* Rename assets
* Cleanup headers
* Update Recording animation
* Add BadBattery animation
* Provide loader's pubsub via record
* Fix load/unload animations
* Scripts: add flipper format support, initial dolphin packager rework. Assets: internal and external dolphin.
* Sync internal meta.txt and manifest.txt
* Reorder, rename dolphin assets
* Split essential generated assets
* Add ReadMe for dolphin assets
* Separate essential blocking animations
* Scripts: full dolphin validation before packaging
* Assets, Scripts: dolphin external resources packer
* Github: update codeowners
* Scripts: proper slots handling in dolphin animation meta
* Scripts: correct frames enumeration and fix compiled assets.
* [FL-2209] Add Dolphin Deeds points and many more
* Remove excess frame_rate
* Change dolphin assets directory
* Scripts: add internal resource support to dolphin compiler
* Scripts: add internal assets generation, renaming
* Scripts: correct assert, renaming
* Code cleanup, documentation, fixes
* Update Levelup animations
* Rename essential -> blocking
* Fix Unlocked hint
* Scripts: rewrite Templite compiller, replace regexps with token parser, split block types into code and variable blocks. Update dolphin templates.
* Documentation: add key combos description and use information
* Scripts: cleanup templit, more debug info and add dev comment
Co-authored-by: あく <alleteam@gmail.com>
2022-01-29 12:20:41 +03:00
|
|
|
#include <portmacro.h>
|
|
|
|
#include <dolphin/dolphin.h>
|
2022-01-03 00:39:56 +03:00
|
|
|
#include <power/power_service/power.h>
|
|
|
|
#include <storage/storage.h>
|
[FL-2183] [FL-2209] Dolphin Deeds, Level up, assets generation, refactoring (#965)
* Desktop: cleanup headers
* Get loader pubsub via record
* [FL-2183] Dolphin refactoring 2022.01
* Restruct animations assets structure
* Rename assets
* Cleanup headers
* Update Recording animation
* Add BadBattery animation
* Provide loader's pubsub via record
* Fix load/unload animations
* Scripts: add flipper format support, initial dolphin packager rework. Assets: internal and external dolphin.
* Sync internal meta.txt and manifest.txt
* Reorder, rename dolphin assets
* Split essential generated assets
* Add ReadMe for dolphin assets
* Separate essential blocking animations
* Scripts: full dolphin validation before packaging
* Assets, Scripts: dolphin external resources packer
* Github: update codeowners
* Scripts: proper slots handling in dolphin animation meta
* Scripts: correct frames enumeration and fix compiled assets.
* [FL-2209] Add Dolphin Deeds points and many more
* Remove excess frame_rate
* Change dolphin assets directory
* Scripts: add internal resource support to dolphin compiler
* Scripts: add internal assets generation, renaming
* Scripts: correct assert, renaming
* Code cleanup, documentation, fixes
* Update Levelup animations
* Rename essential -> blocking
* Fix Unlocked hint
* Scripts: rewrite Templite compiller, replace regexps with token parser, split block types into code and variable blocks. Update dolphin templates.
* Documentation: add key combos description and use information
* Scripts: cleanup templit, more debug info and add dev comment
Co-authored-by: あく <alleteam@gmail.com>
2022-01-29 12:20:41 +03:00
|
|
|
#include <assets_icons.h>
|
|
|
|
|
|
|
|
#include "views/bubble_animation_view.h"
|
|
|
|
#include "views/one_shot_animation_view.h"
|
|
|
|
#include "animation_storage.h"
|
|
|
|
#include "animation_manager.h"
|
2022-01-03 00:39:56 +03:00
|
|
|
|
|
|
|
#define TAG "AnimationManager"
|
|
|
|
|
[FL-2183] [FL-2209] Dolphin Deeds, Level up, assets generation, refactoring (#965)
* Desktop: cleanup headers
* Get loader pubsub via record
* [FL-2183] Dolphin refactoring 2022.01
* Restruct animations assets structure
* Rename assets
* Cleanup headers
* Update Recording animation
* Add BadBattery animation
* Provide loader's pubsub via record
* Fix load/unload animations
* Scripts: add flipper format support, initial dolphin packager rework. Assets: internal and external dolphin.
* Sync internal meta.txt and manifest.txt
* Reorder, rename dolphin assets
* Split essential generated assets
* Add ReadMe for dolphin assets
* Separate essential blocking animations
* Scripts: full dolphin validation before packaging
* Assets, Scripts: dolphin external resources packer
* Github: update codeowners
* Scripts: proper slots handling in dolphin animation meta
* Scripts: correct frames enumeration and fix compiled assets.
* [FL-2209] Add Dolphin Deeds points and many more
* Remove excess frame_rate
* Change dolphin assets directory
* Scripts: add internal resource support to dolphin compiler
* Scripts: add internal assets generation, renaming
* Scripts: correct assert, renaming
* Code cleanup, documentation, fixes
* Update Levelup animations
* Rename essential -> blocking
* Fix Unlocked hint
* Scripts: rewrite Templite compiller, replace regexps with token parser, split block types into code and variable blocks. Update dolphin templates.
* Documentation: add key combos description and use information
* Scripts: cleanup templit, more debug info and add dev comment
Co-authored-by: あく <alleteam@gmail.com>
2022-01-29 12:20:41 +03:00
|
|
|
#define HARDCODED_ANIMATION_NAME "L1_Tv_128x47"
|
|
|
|
#define NO_SD_ANIMATION_NAME "L1_NoSd_128x49"
|
|
|
|
#define BAD_BATTERY_ANIMATION_NAME "L1_BadBattery_128x47"
|
|
|
|
|
|
|
|
#define NO_DB_ANIMATION_NAME "L0_NoDb_128x51"
|
|
|
|
#define BAD_SD_ANIMATION_NAME "L0_SdBad_128x51"
|
|
|
|
#define SD_OK_ANIMATION_NAME "L0_SdOk_128x51"
|
|
|
|
#define URL_ANIMATION_NAME "L0_Url_128x51"
|
|
|
|
#define NEW_MAIL_ANIMATION_NAME "L0_NewMail_128x51"
|
|
|
|
|
2022-01-03 00:39:56 +03:00
|
|
|
typedef enum {
|
|
|
|
AnimationManagerStateIdle,
|
|
|
|
AnimationManagerStateBlocked,
|
|
|
|
AnimationManagerStateFreezedIdle,
|
|
|
|
AnimationManagerStateFreezedBlocked,
|
|
|
|
} AnimationManagerState;
|
|
|
|
|
|
|
|
struct AnimationManager {
|
|
|
|
bool sd_show_url;
|
|
|
|
bool sd_shown_no_db;
|
|
|
|
bool sd_shown_sd_ok;
|
[FL-2183] [FL-2209] Dolphin Deeds, Level up, assets generation, refactoring (#965)
* Desktop: cleanup headers
* Get loader pubsub via record
* [FL-2183] Dolphin refactoring 2022.01
* Restruct animations assets structure
* Rename assets
* Cleanup headers
* Update Recording animation
* Add BadBattery animation
* Provide loader's pubsub via record
* Fix load/unload animations
* Scripts: add flipper format support, initial dolphin packager rework. Assets: internal and external dolphin.
* Sync internal meta.txt and manifest.txt
* Reorder, rename dolphin assets
* Split essential generated assets
* Add ReadMe for dolphin assets
* Separate essential blocking animations
* Scripts: full dolphin validation before packaging
* Assets, Scripts: dolphin external resources packer
* Github: update codeowners
* Scripts: proper slots handling in dolphin animation meta
* Scripts: correct frames enumeration and fix compiled assets.
* [FL-2209] Add Dolphin Deeds points and many more
* Remove excess frame_rate
* Change dolphin assets directory
* Scripts: add internal resource support to dolphin compiler
* Scripts: add internal assets generation, renaming
* Scripts: correct assert, renaming
* Code cleanup, documentation, fixes
* Update Levelup animations
* Rename essential -> blocking
* Fix Unlocked hint
* Scripts: rewrite Templite compiller, replace regexps with token parser, split block types into code and variable blocks. Update dolphin templates.
* Documentation: add key combos description and use information
* Scripts: cleanup templit, more debug info and add dev comment
Co-authored-by: あく <alleteam@gmail.com>
2022-01-29 12:20:41 +03:00
|
|
|
bool levelup_pending;
|
|
|
|
bool levelup_active;
|
2022-01-03 00:39:56 +03:00
|
|
|
AnimationManagerState state;
|
|
|
|
FuriPubSubSubscription* pubsub_subscription_storage;
|
|
|
|
FuriPubSubSubscription* pubsub_subscription_dolphin;
|
|
|
|
BubbleAnimationView* animation_view;
|
[FL-2183] [FL-2209] Dolphin Deeds, Level up, assets generation, refactoring (#965)
* Desktop: cleanup headers
* Get loader pubsub via record
* [FL-2183] Dolphin refactoring 2022.01
* Restruct animations assets structure
* Rename assets
* Cleanup headers
* Update Recording animation
* Add BadBattery animation
* Provide loader's pubsub via record
* Fix load/unload animations
* Scripts: add flipper format support, initial dolphin packager rework. Assets: internal and external dolphin.
* Sync internal meta.txt and manifest.txt
* Reorder, rename dolphin assets
* Split essential generated assets
* Add ReadMe for dolphin assets
* Separate essential blocking animations
* Scripts: full dolphin validation before packaging
* Assets, Scripts: dolphin external resources packer
* Github: update codeowners
* Scripts: proper slots handling in dolphin animation meta
* Scripts: correct frames enumeration and fix compiled assets.
* [FL-2209] Add Dolphin Deeds points and many more
* Remove excess frame_rate
* Change dolphin assets directory
* Scripts: add internal resource support to dolphin compiler
* Scripts: add internal assets generation, renaming
* Scripts: correct assert, renaming
* Code cleanup, documentation, fixes
* Update Levelup animations
* Rename essential -> blocking
* Fix Unlocked hint
* Scripts: rewrite Templite compiller, replace regexps with token parser, split block types into code and variable blocks. Update dolphin templates.
* Documentation: add key combos description and use information
* Scripts: cleanup templit, more debug info and add dev comment
Co-authored-by: あく <alleteam@gmail.com>
2022-01-29 12:20:41 +03:00
|
|
|
OneShotView* one_shot_view;
|
2022-07-20 13:56:33 +03:00
|
|
|
FuriTimer* idle_animation_timer;
|
2022-01-03 00:39:56 +03:00
|
|
|
StorageAnimation* current_animation;
|
|
|
|
AnimationManagerInteractCallback interact_callback;
|
|
|
|
AnimationManagerSetNewIdleAnimationCallback new_idle_callback;
|
|
|
|
AnimationManagerSetNewIdleAnimationCallback check_blocking_callback;
|
|
|
|
void* context;
|
2022-10-05 18:15:23 +03:00
|
|
|
FuriString* freezed_animation_name;
|
2022-01-03 00:39:56 +03:00
|
|
|
int32_t freezed_animation_time_left;
|
[FL-2183] [FL-2209] Dolphin Deeds, Level up, assets generation, refactoring (#965)
* Desktop: cleanup headers
* Get loader pubsub via record
* [FL-2183] Dolphin refactoring 2022.01
* Restruct animations assets structure
* Rename assets
* Cleanup headers
* Update Recording animation
* Add BadBattery animation
* Provide loader's pubsub via record
* Fix load/unload animations
* Scripts: add flipper format support, initial dolphin packager rework. Assets: internal and external dolphin.
* Sync internal meta.txt and manifest.txt
* Reorder, rename dolphin assets
* Split essential generated assets
* Add ReadMe for dolphin assets
* Separate essential blocking animations
* Scripts: full dolphin validation before packaging
* Assets, Scripts: dolphin external resources packer
* Github: update codeowners
* Scripts: proper slots handling in dolphin animation meta
* Scripts: correct frames enumeration and fix compiled assets.
* [FL-2209] Add Dolphin Deeds points and many more
* Remove excess frame_rate
* Change dolphin assets directory
* Scripts: add internal resource support to dolphin compiler
* Scripts: add internal assets generation, renaming
* Scripts: correct assert, renaming
* Code cleanup, documentation, fixes
* Update Levelup animations
* Rename essential -> blocking
* Fix Unlocked hint
* Scripts: rewrite Templite compiller, replace regexps with token parser, split block types into code and variable blocks. Update dolphin templates.
* Documentation: add key combos description and use information
* Scripts: cleanup templit, more debug info and add dev comment
Co-authored-by: あく <alleteam@gmail.com>
2022-01-29 12:20:41 +03:00
|
|
|
ViewStack* view_stack;
|
2022-01-03 00:39:56 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
static StorageAnimation*
|
|
|
|
animation_manager_select_idle_animation(AnimationManager* animation_manager);
|
|
|
|
static void animation_manager_replace_current_animation(
|
|
|
|
AnimationManager* animation_manager,
|
|
|
|
StorageAnimation* storage_animation);
|
|
|
|
static void animation_manager_start_new_idle(AnimationManager* animation_manager);
|
|
|
|
static bool animation_manager_check_blocking(AnimationManager* animation_manager);
|
[FL-2183] [FL-2209] Dolphin Deeds, Level up, assets generation, refactoring (#965)
* Desktop: cleanup headers
* Get loader pubsub via record
* [FL-2183] Dolphin refactoring 2022.01
* Restruct animations assets structure
* Rename assets
* Cleanup headers
* Update Recording animation
* Add BadBattery animation
* Provide loader's pubsub via record
* Fix load/unload animations
* Scripts: add flipper format support, initial dolphin packager rework. Assets: internal and external dolphin.
* Sync internal meta.txt and manifest.txt
* Reorder, rename dolphin assets
* Split essential generated assets
* Add ReadMe for dolphin assets
* Separate essential blocking animations
* Scripts: full dolphin validation before packaging
* Assets, Scripts: dolphin external resources packer
* Github: update codeowners
* Scripts: proper slots handling in dolphin animation meta
* Scripts: correct frames enumeration and fix compiled assets.
* [FL-2209] Add Dolphin Deeds points and many more
* Remove excess frame_rate
* Change dolphin assets directory
* Scripts: add internal resource support to dolphin compiler
* Scripts: add internal assets generation, renaming
* Scripts: correct assert, renaming
* Code cleanup, documentation, fixes
* Update Levelup animations
* Rename essential -> blocking
* Fix Unlocked hint
* Scripts: rewrite Templite compiller, replace regexps with token parser, split block types into code and variable blocks. Update dolphin templates.
* Documentation: add key combos description and use information
* Scripts: cleanup templit, more debug info and add dev comment
Co-authored-by: あく <alleteam@gmail.com>
2022-01-29 12:20:41 +03:00
|
|
|
static bool animation_manager_is_valid_idle_animation(
|
|
|
|
const StorageAnimationManifestInfo* info,
|
|
|
|
const DolphinStats* stats);
|
|
|
|
static void animation_manager_switch_to_one_shot_view(AnimationManager* animation_manager);
|
|
|
|
static void animation_manager_switch_to_animation_view(AnimationManager* animation_manager);
|
2022-01-03 00:39:56 +03:00
|
|
|
|
|
|
|
void animation_manager_set_context(AnimationManager* animation_manager, void* context) {
|
|
|
|
furi_assert(animation_manager);
|
|
|
|
animation_manager->context = context;
|
|
|
|
}
|
|
|
|
|
|
|
|
void animation_manager_set_new_idle_callback(
|
|
|
|
AnimationManager* animation_manager,
|
|
|
|
AnimationManagerSetNewIdleAnimationCallback callback) {
|
|
|
|
furi_assert(animation_manager);
|
|
|
|
animation_manager->new_idle_callback = callback;
|
|
|
|
}
|
|
|
|
|
|
|
|
void animation_manager_set_check_callback(
|
|
|
|
AnimationManager* animation_manager,
|
|
|
|
AnimationManagerCheckBlockingCallback callback) {
|
|
|
|
furi_assert(animation_manager);
|
|
|
|
animation_manager->check_blocking_callback = callback;
|
|
|
|
}
|
|
|
|
|
|
|
|
void animation_manager_set_interact_callback(
|
|
|
|
AnimationManager* animation_manager,
|
|
|
|
AnimationManagerInteractCallback callback) {
|
|
|
|
furi_assert(animation_manager);
|
|
|
|
animation_manager->interact_callback = callback;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void animation_manager_check_blocking_callback(const void* message, void* context) {
|
2022-04-01 15:21:31 +03:00
|
|
|
const StorageEvent* storage_event = message;
|
|
|
|
|
|
|
|
switch(storage_event->type) {
|
|
|
|
case StorageEventTypeCardMount:
|
|
|
|
case StorageEventTypeCardUnmount:
|
|
|
|
case StorageEventTypeCardMountError:
|
|
|
|
furi_assert(context);
|
|
|
|
AnimationManager* animation_manager = context;
|
|
|
|
if(animation_manager->check_blocking_callback) {
|
|
|
|
animation_manager->check_blocking_callback(animation_manager->context);
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
|
|
|
break;
|
2022-01-03 00:39:56 +03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void animation_manager_timer_callback(void* context) {
|
|
|
|
furi_assert(context);
|
|
|
|
AnimationManager* animation_manager = context;
|
|
|
|
if(animation_manager->new_idle_callback) {
|
|
|
|
animation_manager->new_idle_callback(animation_manager->context);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void animation_manager_interact_callback(void* context) {
|
|
|
|
furi_assert(context);
|
|
|
|
AnimationManager* animation_manager = context;
|
|
|
|
if(animation_manager->interact_callback) {
|
|
|
|
animation_manager->interact_callback(animation_manager->context);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
[FL-2183] [FL-2209] Dolphin Deeds, Level up, assets generation, refactoring (#965)
* Desktop: cleanup headers
* Get loader pubsub via record
* [FL-2183] Dolphin refactoring 2022.01
* Restruct animations assets structure
* Rename assets
* Cleanup headers
* Update Recording animation
* Add BadBattery animation
* Provide loader's pubsub via record
* Fix load/unload animations
* Scripts: add flipper format support, initial dolphin packager rework. Assets: internal and external dolphin.
* Sync internal meta.txt and manifest.txt
* Reorder, rename dolphin assets
* Split essential generated assets
* Add ReadMe for dolphin assets
* Separate essential blocking animations
* Scripts: full dolphin validation before packaging
* Assets, Scripts: dolphin external resources packer
* Github: update codeowners
* Scripts: proper slots handling in dolphin animation meta
* Scripts: correct frames enumeration and fix compiled assets.
* [FL-2209] Add Dolphin Deeds points and many more
* Remove excess frame_rate
* Change dolphin assets directory
* Scripts: add internal resource support to dolphin compiler
* Scripts: add internal assets generation, renaming
* Scripts: correct assert, renaming
* Code cleanup, documentation, fixes
* Update Levelup animations
* Rename essential -> blocking
* Fix Unlocked hint
* Scripts: rewrite Templite compiller, replace regexps with token parser, split block types into code and variable blocks. Update dolphin templates.
* Documentation: add key combos description and use information
* Scripts: cleanup templit, more debug info and add dev comment
Co-authored-by: あく <alleteam@gmail.com>
2022-01-29 12:20:41 +03:00
|
|
|
/* reaction to animation_manager->check_blocking_callback() */
|
2022-01-03 00:39:56 +03:00
|
|
|
void animation_manager_check_blocking_process(AnimationManager* animation_manager) {
|
|
|
|
furi_assert(animation_manager);
|
|
|
|
|
|
|
|
if(animation_manager->state == AnimationManagerStateIdle) {
|
[FL-2183] [FL-2209] Dolphin Deeds, Level up, assets generation, refactoring (#965)
* Desktop: cleanup headers
* Get loader pubsub via record
* [FL-2183] Dolphin refactoring 2022.01
* Restruct animations assets structure
* Rename assets
* Cleanup headers
* Update Recording animation
* Add BadBattery animation
* Provide loader's pubsub via record
* Fix load/unload animations
* Scripts: add flipper format support, initial dolphin packager rework. Assets: internal and external dolphin.
* Sync internal meta.txt and manifest.txt
* Reorder, rename dolphin assets
* Split essential generated assets
* Add ReadMe for dolphin assets
* Separate essential blocking animations
* Scripts: full dolphin validation before packaging
* Assets, Scripts: dolphin external resources packer
* Github: update codeowners
* Scripts: proper slots handling in dolphin animation meta
* Scripts: correct frames enumeration and fix compiled assets.
* [FL-2209] Add Dolphin Deeds points and many more
* Remove excess frame_rate
* Change dolphin assets directory
* Scripts: add internal resource support to dolphin compiler
* Scripts: add internal assets generation, renaming
* Scripts: correct assert, renaming
* Code cleanup, documentation, fixes
* Update Levelup animations
* Rename essential -> blocking
* Fix Unlocked hint
* Scripts: rewrite Templite compiller, replace regexps with token parser, split block types into code and variable blocks. Update dolphin templates.
* Documentation: add key combos description and use information
* Scripts: cleanup templit, more debug info and add dev comment
Co-authored-by: あく <alleteam@gmail.com>
2022-01-29 12:20:41 +03:00
|
|
|
bool blocked = animation_manager_check_blocking(animation_manager);
|
|
|
|
|
|
|
|
if(!blocked) {
|
2022-07-26 15:21:51 +03:00
|
|
|
Dolphin* dolphin = furi_record_open(RECORD_DOLPHIN);
|
[FL-2183] [FL-2209] Dolphin Deeds, Level up, assets generation, refactoring (#965)
* Desktop: cleanup headers
* Get loader pubsub via record
* [FL-2183] Dolphin refactoring 2022.01
* Restruct animations assets structure
* Rename assets
* Cleanup headers
* Update Recording animation
* Add BadBattery animation
* Provide loader's pubsub via record
* Fix load/unload animations
* Scripts: add flipper format support, initial dolphin packager rework. Assets: internal and external dolphin.
* Sync internal meta.txt and manifest.txt
* Reorder, rename dolphin assets
* Split essential generated assets
* Add ReadMe for dolphin assets
* Separate essential blocking animations
* Scripts: full dolphin validation before packaging
* Assets, Scripts: dolphin external resources packer
* Github: update codeowners
* Scripts: proper slots handling in dolphin animation meta
* Scripts: correct frames enumeration and fix compiled assets.
* [FL-2209] Add Dolphin Deeds points and many more
* Remove excess frame_rate
* Change dolphin assets directory
* Scripts: add internal resource support to dolphin compiler
* Scripts: add internal assets generation, renaming
* Scripts: correct assert, renaming
* Code cleanup, documentation, fixes
* Update Levelup animations
* Rename essential -> blocking
* Fix Unlocked hint
* Scripts: rewrite Templite compiller, replace regexps with token parser, split block types into code and variable blocks. Update dolphin templates.
* Documentation: add key combos description and use information
* Scripts: cleanup templit, more debug info and add dev comment
Co-authored-by: あく <alleteam@gmail.com>
2022-01-29 12:20:41 +03:00
|
|
|
DolphinStats stats = dolphin_stats(dolphin);
|
2022-07-26 15:21:51 +03:00
|
|
|
furi_record_close(RECORD_DOLPHIN);
|
[FL-2183] [FL-2209] Dolphin Deeds, Level up, assets generation, refactoring (#965)
* Desktop: cleanup headers
* Get loader pubsub via record
* [FL-2183] Dolphin refactoring 2022.01
* Restruct animations assets structure
* Rename assets
* Cleanup headers
* Update Recording animation
* Add BadBattery animation
* Provide loader's pubsub via record
* Fix load/unload animations
* Scripts: add flipper format support, initial dolphin packager rework. Assets: internal and external dolphin.
* Sync internal meta.txt and manifest.txt
* Reorder, rename dolphin assets
* Split essential generated assets
* Add ReadMe for dolphin assets
* Separate essential blocking animations
* Scripts: full dolphin validation before packaging
* Assets, Scripts: dolphin external resources packer
* Github: update codeowners
* Scripts: proper slots handling in dolphin animation meta
* Scripts: correct frames enumeration and fix compiled assets.
* [FL-2209] Add Dolphin Deeds points and many more
* Remove excess frame_rate
* Change dolphin assets directory
* Scripts: add internal resource support to dolphin compiler
* Scripts: add internal assets generation, renaming
* Scripts: correct assert, renaming
* Code cleanup, documentation, fixes
* Update Levelup animations
* Rename essential -> blocking
* Fix Unlocked hint
* Scripts: rewrite Templite compiller, replace regexps with token parser, split block types into code and variable blocks. Update dolphin templates.
* Documentation: add key combos description and use information
* Scripts: cleanup templit, more debug info and add dev comment
Co-authored-by: あく <alleteam@gmail.com>
2022-01-29 12:20:41 +03:00
|
|
|
|
|
|
|
const StorageAnimationManifestInfo* manifest_info =
|
|
|
|
animation_storage_get_meta(animation_manager->current_animation);
|
|
|
|
bool valid = animation_manager_is_valid_idle_animation(manifest_info, &stats);
|
|
|
|
|
|
|
|
if(!valid) {
|
|
|
|
animation_manager_start_new_idle(animation_manager);
|
|
|
|
}
|
|
|
|
}
|
2022-01-03 00:39:56 +03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* reaction to animation_manager->new_idle_callback() */
|
|
|
|
void animation_manager_new_idle_process(AnimationManager* animation_manager) {
|
|
|
|
furi_assert(animation_manager);
|
|
|
|
|
|
|
|
if(animation_manager->state == AnimationManagerStateIdle) {
|
|
|
|
animation_manager_start_new_idle(animation_manager);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
[FL-2183] [FL-2209] Dolphin Deeds, Level up, assets generation, refactoring (#965)
* Desktop: cleanup headers
* Get loader pubsub via record
* [FL-2183] Dolphin refactoring 2022.01
* Restruct animations assets structure
* Rename assets
* Cleanup headers
* Update Recording animation
* Add BadBattery animation
* Provide loader's pubsub via record
* Fix load/unload animations
* Scripts: add flipper format support, initial dolphin packager rework. Assets: internal and external dolphin.
* Sync internal meta.txt and manifest.txt
* Reorder, rename dolphin assets
* Split essential generated assets
* Add ReadMe for dolphin assets
* Separate essential blocking animations
* Scripts: full dolphin validation before packaging
* Assets, Scripts: dolphin external resources packer
* Github: update codeowners
* Scripts: proper slots handling in dolphin animation meta
* Scripts: correct frames enumeration and fix compiled assets.
* [FL-2209] Add Dolphin Deeds points and many more
* Remove excess frame_rate
* Change dolphin assets directory
* Scripts: add internal resource support to dolphin compiler
* Scripts: add internal assets generation, renaming
* Scripts: correct assert, renaming
* Code cleanup, documentation, fixes
* Update Levelup animations
* Rename essential -> blocking
* Fix Unlocked hint
* Scripts: rewrite Templite compiller, replace regexps with token parser, split block types into code and variable blocks. Update dolphin templates.
* Documentation: add key combos description and use information
* Scripts: cleanup templit, more debug info and add dev comment
Co-authored-by: あく <alleteam@gmail.com>
2022-01-29 12:20:41 +03:00
|
|
|
/* reaction to animation_manager->interact_callback() */
|
2022-04-18 15:34:18 +03:00
|
|
|
bool animation_manager_interact_process(AnimationManager* animation_manager) {
|
2022-01-03 00:39:56 +03:00
|
|
|
furi_assert(animation_manager);
|
2022-04-18 15:34:18 +03:00
|
|
|
bool consumed = true;
|
2022-01-03 00:39:56 +03:00
|
|
|
|
[FL-2183] [FL-2209] Dolphin Deeds, Level up, assets generation, refactoring (#965)
* Desktop: cleanup headers
* Get loader pubsub via record
* [FL-2183] Dolphin refactoring 2022.01
* Restruct animations assets structure
* Rename assets
* Cleanup headers
* Update Recording animation
* Add BadBattery animation
* Provide loader's pubsub via record
* Fix load/unload animations
* Scripts: add flipper format support, initial dolphin packager rework. Assets: internal and external dolphin.
* Sync internal meta.txt and manifest.txt
* Reorder, rename dolphin assets
* Split essential generated assets
* Add ReadMe for dolphin assets
* Separate essential blocking animations
* Scripts: full dolphin validation before packaging
* Assets, Scripts: dolphin external resources packer
* Github: update codeowners
* Scripts: proper slots handling in dolphin animation meta
* Scripts: correct frames enumeration and fix compiled assets.
* [FL-2209] Add Dolphin Deeds points and many more
* Remove excess frame_rate
* Change dolphin assets directory
* Scripts: add internal resource support to dolphin compiler
* Scripts: add internal assets generation, renaming
* Scripts: correct assert, renaming
* Code cleanup, documentation, fixes
* Update Levelup animations
* Rename essential -> blocking
* Fix Unlocked hint
* Scripts: rewrite Templite compiller, replace regexps with token parser, split block types into code and variable blocks. Update dolphin templates.
* Documentation: add key combos description and use information
* Scripts: cleanup templit, more debug info and add dev comment
Co-authored-by: あく <alleteam@gmail.com>
2022-01-29 12:20:41 +03:00
|
|
|
if(animation_manager->levelup_pending) {
|
|
|
|
animation_manager->levelup_pending = false;
|
|
|
|
animation_manager->levelup_active = true;
|
|
|
|
animation_manager_switch_to_one_shot_view(animation_manager);
|
2022-07-26 15:21:51 +03:00
|
|
|
Dolphin* dolphin = furi_record_open(RECORD_DOLPHIN);
|
[FL-2183] [FL-2209] Dolphin Deeds, Level up, assets generation, refactoring (#965)
* Desktop: cleanup headers
* Get loader pubsub via record
* [FL-2183] Dolphin refactoring 2022.01
* Restruct animations assets structure
* Rename assets
* Cleanup headers
* Update Recording animation
* Add BadBattery animation
* Provide loader's pubsub via record
* Fix load/unload animations
* Scripts: add flipper format support, initial dolphin packager rework. Assets: internal and external dolphin.
* Sync internal meta.txt and manifest.txt
* Reorder, rename dolphin assets
* Split essential generated assets
* Add ReadMe for dolphin assets
* Separate essential blocking animations
* Scripts: full dolphin validation before packaging
* Assets, Scripts: dolphin external resources packer
* Github: update codeowners
* Scripts: proper slots handling in dolphin animation meta
* Scripts: correct frames enumeration and fix compiled assets.
* [FL-2209] Add Dolphin Deeds points and many more
* Remove excess frame_rate
* Change dolphin assets directory
* Scripts: add internal resource support to dolphin compiler
* Scripts: add internal assets generation, renaming
* Scripts: correct assert, renaming
* Code cleanup, documentation, fixes
* Update Levelup animations
* Rename essential -> blocking
* Fix Unlocked hint
* Scripts: rewrite Templite compiller, replace regexps with token parser, split block types into code and variable blocks. Update dolphin templates.
* Documentation: add key combos description and use information
* Scripts: cleanup templit, more debug info and add dev comment
Co-authored-by: あく <alleteam@gmail.com>
2022-01-29 12:20:41 +03:00
|
|
|
dolphin_upgrade_level(dolphin);
|
2022-07-26 15:21:51 +03:00
|
|
|
furi_record_close(RECORD_DOLPHIN);
|
[FL-2183] [FL-2209] Dolphin Deeds, Level up, assets generation, refactoring (#965)
* Desktop: cleanup headers
* Get loader pubsub via record
* [FL-2183] Dolphin refactoring 2022.01
* Restruct animations assets structure
* Rename assets
* Cleanup headers
* Update Recording animation
* Add BadBattery animation
* Provide loader's pubsub via record
* Fix load/unload animations
* Scripts: add flipper format support, initial dolphin packager rework. Assets: internal and external dolphin.
* Sync internal meta.txt and manifest.txt
* Reorder, rename dolphin assets
* Split essential generated assets
* Add ReadMe for dolphin assets
* Separate essential blocking animations
* Scripts: full dolphin validation before packaging
* Assets, Scripts: dolphin external resources packer
* Github: update codeowners
* Scripts: proper slots handling in dolphin animation meta
* Scripts: correct frames enumeration and fix compiled assets.
* [FL-2209] Add Dolphin Deeds points and many more
* Remove excess frame_rate
* Change dolphin assets directory
* Scripts: add internal resource support to dolphin compiler
* Scripts: add internal assets generation, renaming
* Scripts: correct assert, renaming
* Code cleanup, documentation, fixes
* Update Levelup animations
* Rename essential -> blocking
* Fix Unlocked hint
* Scripts: rewrite Templite compiller, replace regexps with token parser, split block types into code and variable blocks. Update dolphin templates.
* Documentation: add key combos description and use information
* Scripts: cleanup templit, more debug info and add dev comment
Co-authored-by: あく <alleteam@gmail.com>
2022-01-29 12:20:41 +03:00
|
|
|
} else if(animation_manager->levelup_active) {
|
|
|
|
animation_manager->levelup_active = false;
|
|
|
|
animation_manager_start_new_idle(animation_manager);
|
|
|
|
animation_manager_switch_to_animation_view(animation_manager);
|
|
|
|
} else if(animation_manager->state == AnimationManagerStateBlocked) {
|
2022-01-03 00:39:56 +03:00
|
|
|
bool blocked = animation_manager_check_blocking(animation_manager);
|
[FL-2183] [FL-2209] Dolphin Deeds, Level up, assets generation, refactoring (#965)
* Desktop: cleanup headers
* Get loader pubsub via record
* [FL-2183] Dolphin refactoring 2022.01
* Restruct animations assets structure
* Rename assets
* Cleanup headers
* Update Recording animation
* Add BadBattery animation
* Provide loader's pubsub via record
* Fix load/unload animations
* Scripts: add flipper format support, initial dolphin packager rework. Assets: internal and external dolphin.
* Sync internal meta.txt and manifest.txt
* Reorder, rename dolphin assets
* Split essential generated assets
* Add ReadMe for dolphin assets
* Separate essential blocking animations
* Scripts: full dolphin validation before packaging
* Assets, Scripts: dolphin external resources packer
* Github: update codeowners
* Scripts: proper slots handling in dolphin animation meta
* Scripts: correct frames enumeration and fix compiled assets.
* [FL-2209] Add Dolphin Deeds points and many more
* Remove excess frame_rate
* Change dolphin assets directory
* Scripts: add internal resource support to dolphin compiler
* Scripts: add internal assets generation, renaming
* Scripts: correct assert, renaming
* Code cleanup, documentation, fixes
* Update Levelup animations
* Rename essential -> blocking
* Fix Unlocked hint
* Scripts: rewrite Templite compiller, replace regexps with token parser, split block types into code and variable blocks. Update dolphin templates.
* Documentation: add key combos description and use information
* Scripts: cleanup templit, more debug info and add dev comment
Co-authored-by: あく <alleteam@gmail.com>
2022-01-29 12:20:41 +03:00
|
|
|
|
2022-01-03 00:39:56 +03:00
|
|
|
if(!blocked) {
|
|
|
|
animation_manager_start_new_idle(animation_manager);
|
|
|
|
}
|
2022-04-18 15:34:18 +03:00
|
|
|
} else {
|
|
|
|
consumed = false;
|
2022-01-03 00:39:56 +03:00
|
|
|
}
|
2022-04-18 15:34:18 +03:00
|
|
|
|
|
|
|
return consumed;
|
2022-01-03 00:39:56 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
static void animation_manager_start_new_idle(AnimationManager* animation_manager) {
|
|
|
|
furi_assert(animation_manager);
|
|
|
|
|
|
|
|
StorageAnimation* new_animation = animation_manager_select_idle_animation(animation_manager);
|
|
|
|
animation_manager_replace_current_animation(animation_manager, new_animation);
|
|
|
|
const BubbleAnimation* bubble_animation =
|
|
|
|
animation_storage_get_bubble_animation(animation_manager->current_animation);
|
|
|
|
animation_manager->state = AnimationManagerStateIdle;
|
2022-07-20 13:56:33 +03:00
|
|
|
furi_timer_start(animation_manager->idle_animation_timer, bubble_animation->duration * 1000);
|
2022-01-03 00:39:56 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
static bool animation_manager_check_blocking(AnimationManager* animation_manager) {
|
|
|
|
furi_assert(animation_manager);
|
|
|
|
|
|
|
|
StorageAnimation* blocking_animation = NULL;
|
2022-07-26 15:21:51 +03:00
|
|
|
Storage* storage = furi_record_open(RECORD_STORAGE);
|
2022-01-03 00:39:56 +03:00
|
|
|
FS_Error sd_status = storage_sd_status(storage);
|
|
|
|
|
|
|
|
if(sd_status == FSE_INTERNAL) {
|
|
|
|
blocking_animation = animation_storage_find_animation(BAD_SD_ANIMATION_NAME);
|
[FL-2183] [FL-2209] Dolphin Deeds, Level up, assets generation, refactoring (#965)
* Desktop: cleanup headers
* Get loader pubsub via record
* [FL-2183] Dolphin refactoring 2022.01
* Restruct animations assets structure
* Rename assets
* Cleanup headers
* Update Recording animation
* Add BadBattery animation
* Provide loader's pubsub via record
* Fix load/unload animations
* Scripts: add flipper format support, initial dolphin packager rework. Assets: internal and external dolphin.
* Sync internal meta.txt and manifest.txt
* Reorder, rename dolphin assets
* Split essential generated assets
* Add ReadMe for dolphin assets
* Separate essential blocking animations
* Scripts: full dolphin validation before packaging
* Assets, Scripts: dolphin external resources packer
* Github: update codeowners
* Scripts: proper slots handling in dolphin animation meta
* Scripts: correct frames enumeration and fix compiled assets.
* [FL-2209] Add Dolphin Deeds points and many more
* Remove excess frame_rate
* Change dolphin assets directory
* Scripts: add internal resource support to dolphin compiler
* Scripts: add internal assets generation, renaming
* Scripts: correct assert, renaming
* Code cleanup, documentation, fixes
* Update Levelup animations
* Rename essential -> blocking
* Fix Unlocked hint
* Scripts: rewrite Templite compiller, replace regexps with token parser, split block types into code and variable blocks. Update dolphin templates.
* Documentation: add key combos description and use information
* Scripts: cleanup templit, more debug info and add dev comment
Co-authored-by: あく <alleteam@gmail.com>
2022-01-29 12:20:41 +03:00
|
|
|
furi_assert(blocking_animation);
|
2022-01-03 00:39:56 +03:00
|
|
|
} 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);
|
[FL-2183] [FL-2209] Dolphin Deeds, Level up, assets generation, refactoring (#965)
* Desktop: cleanup headers
* Get loader pubsub via record
* [FL-2183] Dolphin refactoring 2022.01
* Restruct animations assets structure
* Rename assets
* Cleanup headers
* Update Recording animation
* Add BadBattery animation
* Provide loader's pubsub via record
* Fix load/unload animations
* Scripts: add flipper format support, initial dolphin packager rework. Assets: internal and external dolphin.
* Sync internal meta.txt and manifest.txt
* Reorder, rename dolphin assets
* Split essential generated assets
* Add ReadMe for dolphin assets
* Separate essential blocking animations
* Scripts: full dolphin validation before packaging
* Assets, Scripts: dolphin external resources packer
* Github: update codeowners
* Scripts: proper slots handling in dolphin animation meta
* Scripts: correct frames enumeration and fix compiled assets.
* [FL-2209] Add Dolphin Deeds points and many more
* Remove excess frame_rate
* Change dolphin assets directory
* Scripts: add internal resource support to dolphin compiler
* Scripts: add internal assets generation, renaming
* Scripts: correct assert, renaming
* Code cleanup, documentation, fixes
* Update Levelup animations
* Rename essential -> blocking
* Fix Unlocked hint
* Scripts: rewrite Templite compiller, replace regexps with token parser, split block types into code and variable blocks. Update dolphin templates.
* Documentation: add key combos description and use information
* Scripts: cleanup templit, more debug info and add dev comment
Co-authored-by: あく <alleteam@gmail.com>
2022-01-29 12:20:41 +03:00
|
|
|
furi_assert(blocking_animation);
|
2022-01-03 00:39:56 +03:00
|
|
|
animation_manager->sd_shown_sd_ok = true;
|
|
|
|
} else if(!animation_manager->sd_shown_no_db) {
|
[FL-2529][FL-1628] New LF-RFID subsystem (#1601)
* Makefile: unit tests pack
* RFID: pulse joiner and its unit test
* Move pulse protocol helpers to appropriate place
* Drop pulse_joiner tests
* Generic protocol, protocols dictionary, unit test
* Protocol dict unit test
* iButton: protocols dictionary
* Lib: varint
* Lib: profiler
* Unit test: varint
* rfid: worker mockup
* LFRFID: em4100 unit test
* Storage: file_exist function
* rfid: fsk osc
* rfid: generic fsk demodulator
* rfid: protocol em4100
* rfid: protocol h10301
* rfid: protocol io prox xsf
* Unit test: rfid protocols
* rfid: new hal
* rfid: raw worker
* Unit test: fix error output
* rfid: worker
* rfid: plain c cli
* fw: migrate to scons
* lfrfid: full io prox support
* unit test: io prox protocol
* SubGHZ: move bit defines to source
* FSK oscillator: level duration compability
* libs: bit manipulation library
* lfrfid: ioprox protocol, use bit library and new level duration method of FSK ocillator
* bit lib: unit tests
* Bit lib: parity tests, remove every nth bit, copy bits
* Lfrfid: awid protocol
* bit lib: uint16 and uint32 getters, unit tests
* lfrfid: FDX-B read, draft version
* Minunit: better memeq assert
* bit lib: reverse, print, print regions
* Protocol dict: get protocol features, get protocol validate count
* lfrfid worker: improved read
* lfrfid raw worker: psk support
* Cli: rfid plain C cli
* protocol AWID: render
* protocol em4100: render
* protocol h10301: render
* protocol indala26: support every indala 26 scramble
* Protocol IO Prox: render
* Protocol FDX-B: advanced read
* lfrfid: remove unused test function
* lfrfid: fix os primitives
* bit lib: crc16 and unit tests
* FDX-B: save data
* lfrfid worker: increase stream size. Alloc raw worker only when needed.
* lfrfid: indala26 emulation
* lfrfid: prepare to write
* lfrfid: fdx-b emulation
* lfrfid: awid, ioprox write
* lfrfid: write t55xx w\o validation
* lfrfid: better t55xx block0 handling
* lfrfid: use new t5577 functions in worker
* lfrfid: improve protocol description
* lfrfid: write and verify
* lfrfid: delete cpp cli
* lfrfid: improve worker usage
* lfrfid-app: step to new worker
* lfrfid: old indala (I40134) load fallback
* lfrfid: indala26, recover wrong synced data
* lfrfid: remove old worker
* lfrfid app: dummy read screen
* lfrfid app: less dummy read screen
* lfrfid: generic 96-bit HID protocol (covers up to HID 37-bit)
* rename
* lfrfid: improve indala26 read
* lfrfid: generic 192-bit HID protocol (covers all HID extended)
* lfrfid: TODO about HID render
* lfrfid: new protocol FDX-A
* lfrfid-app: correct worker stop on exit
* misc fixes
* lfrfid: FDX-A and HID distinguishability has been fixed.
* lfrfid: decode HID size header and render it (#1612)
* lfrfid: rename HID96 and HID192 to HIDProx and HIDExt
* lfrfid: extra actions scene
* lfrfid: decode generic HID Proximity size lazily (#1618)
* lib: stream of data buffers concept
* lfrfid: raw file helper
* lfrfid: changed raw worker api
* lfrfid: packed varint pair
* lfrfid: read stream speedup
* lfrfid app: show read mode
* Documentation
* lfrfid app: raw read gui
* lfrfid app: storage check for raw read
* memleak fix
* review fixes
* lfrfid app: read blink color
* lfrfid app: reset key name after read
* review fixes
* lfrfid app: fix copypasted text
* review fixes
* lfrfid: disable debug gpio
* lfrfid: card detection events
* lfrfid: change validation color from magenta to green
* Update core_defines.
* lfrfid: prefix fdx-b id by zeroes
* lfrfid: parse up to 43-bit HID Proximity keys (#1640)
* Fbt: downgrade toolchain and fix PS1
* lfrfid: fix unit tests
* lfrfid app: remove printf
* lfrfid: indala26, use bit 55 as data
* lfrfid: indala26, better brief format
* lfrfid: indala26, loading fallback
* lfrfid: read timing tuning
Co-authored-by: James Ide <ide@users.noreply.github.com>
Co-authored-by: あく <alleteam@gmail.com>
2022-08-23 18:57:39 +03:00
|
|
|
if(!storage_file_exists(storage, EXT_PATH("Manifest"))) {
|
2022-01-03 00:39:56 +03:00
|
|
|
blocking_animation = animation_storage_find_animation(NO_DB_ANIMATION_NAME);
|
[FL-2183] [FL-2209] Dolphin Deeds, Level up, assets generation, refactoring (#965)
* Desktop: cleanup headers
* Get loader pubsub via record
* [FL-2183] Dolphin refactoring 2022.01
* Restruct animations assets structure
* Rename assets
* Cleanup headers
* Update Recording animation
* Add BadBattery animation
* Provide loader's pubsub via record
* Fix load/unload animations
* Scripts: add flipper format support, initial dolphin packager rework. Assets: internal and external dolphin.
* Sync internal meta.txt and manifest.txt
* Reorder, rename dolphin assets
* Split essential generated assets
* Add ReadMe for dolphin assets
* Separate essential blocking animations
* Scripts: full dolphin validation before packaging
* Assets, Scripts: dolphin external resources packer
* Github: update codeowners
* Scripts: proper slots handling in dolphin animation meta
* Scripts: correct frames enumeration and fix compiled assets.
* [FL-2209] Add Dolphin Deeds points and many more
* Remove excess frame_rate
* Change dolphin assets directory
* Scripts: add internal resource support to dolphin compiler
* Scripts: add internal assets generation, renaming
* Scripts: correct assert, renaming
* Code cleanup, documentation, fixes
* Update Levelup animations
* Rename essential -> blocking
* Fix Unlocked hint
* Scripts: rewrite Templite compiller, replace regexps with token parser, split block types into code and variable blocks. Update dolphin templates.
* Documentation: add key combos description and use information
* Scripts: cleanup templit, more debug info and add dev comment
Co-authored-by: あく <alleteam@gmail.com>
2022-01-29 12:20:41 +03:00
|
|
|
furi_assert(blocking_animation);
|
2022-01-03 00:39:56 +03:00
|
|
|
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);
|
[FL-2183] [FL-2209] Dolphin Deeds, Level up, assets generation, refactoring (#965)
* Desktop: cleanup headers
* Get loader pubsub via record
* [FL-2183] Dolphin refactoring 2022.01
* Restruct animations assets structure
* Rename assets
* Cleanup headers
* Update Recording animation
* Add BadBattery animation
* Provide loader's pubsub via record
* Fix load/unload animations
* Scripts: add flipper format support, initial dolphin packager rework. Assets: internal and external dolphin.
* Sync internal meta.txt and manifest.txt
* Reorder, rename dolphin assets
* Split essential generated assets
* Add ReadMe for dolphin assets
* Separate essential blocking animations
* Scripts: full dolphin validation before packaging
* Assets, Scripts: dolphin external resources packer
* Github: update codeowners
* Scripts: proper slots handling in dolphin animation meta
* Scripts: correct frames enumeration and fix compiled assets.
* [FL-2209] Add Dolphin Deeds points and many more
* Remove excess frame_rate
* Change dolphin assets directory
* Scripts: add internal resource support to dolphin compiler
* Scripts: add internal assets generation, renaming
* Scripts: correct assert, renaming
* Code cleanup, documentation, fixes
* Update Levelup animations
* Rename essential -> blocking
* Fix Unlocked hint
* Scripts: rewrite Templite compiller, replace regexps with token parser, split block types into code and variable blocks. Update dolphin templates.
* Documentation: add key combos description and use information
* Scripts: cleanup templit, more debug info and add dev comment
Co-authored-by: あく <alleteam@gmail.com>
2022-01-29 12:20:41 +03:00
|
|
|
furi_assert(blocking_animation);
|
2022-01-03 00:39:56 +03:00
|
|
|
animation_manager->sd_show_url = false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-07-26 15:21:51 +03:00
|
|
|
Dolphin* dolphin = furi_record_open(RECORD_DOLPHIN);
|
2022-01-03 00:39:56 +03:00
|
|
|
DolphinStats stats = dolphin_stats(dolphin);
|
2022-07-26 15:21:51 +03:00
|
|
|
furi_record_close(RECORD_DOLPHIN);
|
2022-01-03 00:39:56 +03:00
|
|
|
if(!blocking_animation && stats.level_up_is_pending) {
|
[FL-2183] [FL-2209] Dolphin Deeds, Level up, assets generation, refactoring (#965)
* Desktop: cleanup headers
* Get loader pubsub via record
* [FL-2183] Dolphin refactoring 2022.01
* Restruct animations assets structure
* Rename assets
* Cleanup headers
* Update Recording animation
* Add BadBattery animation
* Provide loader's pubsub via record
* Fix load/unload animations
* Scripts: add flipper format support, initial dolphin packager rework. Assets: internal and external dolphin.
* Sync internal meta.txt and manifest.txt
* Reorder, rename dolphin assets
* Split essential generated assets
* Add ReadMe for dolphin assets
* Separate essential blocking animations
* Scripts: full dolphin validation before packaging
* Assets, Scripts: dolphin external resources packer
* Github: update codeowners
* Scripts: proper slots handling in dolphin animation meta
* Scripts: correct frames enumeration and fix compiled assets.
* [FL-2209] Add Dolphin Deeds points and many more
* Remove excess frame_rate
* Change dolphin assets directory
* Scripts: add internal resource support to dolphin compiler
* Scripts: add internal assets generation, renaming
* Scripts: correct assert, renaming
* Code cleanup, documentation, fixes
* Update Levelup animations
* Rename essential -> blocking
* Fix Unlocked hint
* Scripts: rewrite Templite compiller, replace regexps with token parser, split block types into code and variable blocks. Update dolphin templates.
* Documentation: add key combos description and use information
* Scripts: cleanup templit, more debug info and add dev comment
Co-authored-by: あく <alleteam@gmail.com>
2022-01-29 12:20:41 +03:00
|
|
|
blocking_animation = animation_storage_find_animation(NEW_MAIL_ANIMATION_NAME);
|
|
|
|
furi_assert(blocking_animation);
|
|
|
|
if(blocking_animation) {
|
|
|
|
animation_manager->levelup_pending = true;
|
|
|
|
}
|
2022-01-03 00:39:56 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
if(blocking_animation) {
|
2022-07-20 13:56:33 +03:00
|
|
|
furi_timer_stop(animation_manager->idle_animation_timer);
|
2022-01-03 00:39:56 +03:00
|
|
|
animation_manager_replace_current_animation(animation_manager, blocking_animation);
|
[FL-2183] [FL-2209] Dolphin Deeds, Level up, assets generation, refactoring (#965)
* Desktop: cleanup headers
* Get loader pubsub via record
* [FL-2183] Dolphin refactoring 2022.01
* Restruct animations assets structure
* Rename assets
* Cleanup headers
* Update Recording animation
* Add BadBattery animation
* Provide loader's pubsub via record
* Fix load/unload animations
* Scripts: add flipper format support, initial dolphin packager rework. Assets: internal and external dolphin.
* Sync internal meta.txt and manifest.txt
* Reorder, rename dolphin assets
* Split essential generated assets
* Add ReadMe for dolphin assets
* Separate essential blocking animations
* Scripts: full dolphin validation before packaging
* Assets, Scripts: dolphin external resources packer
* Github: update codeowners
* Scripts: proper slots handling in dolphin animation meta
* Scripts: correct frames enumeration and fix compiled assets.
* [FL-2209] Add Dolphin Deeds points and many more
* Remove excess frame_rate
* Change dolphin assets directory
* Scripts: add internal resource support to dolphin compiler
* Scripts: add internal assets generation, renaming
* Scripts: correct assert, renaming
* Code cleanup, documentation, fixes
* Update Levelup animations
* Rename essential -> blocking
* Fix Unlocked hint
* Scripts: rewrite Templite compiller, replace regexps with token parser, split block types into code and variable blocks. Update dolphin templates.
* Documentation: add key combos description and use information
* Scripts: cleanup templit, more debug info and add dev comment
Co-authored-by: あく <alleteam@gmail.com>
2022-01-29 12:20:41 +03:00
|
|
|
/* no timer starting because this is blocking animation */
|
2022-01-03 00:39:56 +03:00
|
|
|
animation_manager->state = AnimationManagerStateBlocked;
|
|
|
|
}
|
|
|
|
|
2022-07-26 15:21:51 +03:00
|
|
|
furi_record_close(RECORD_STORAGE);
|
2022-01-03 00:39:56 +03:00
|
|
|
|
|
|
|
return !!blocking_animation;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void animation_manager_replace_current_animation(
|
|
|
|
AnimationManager* animation_manager,
|
|
|
|
StorageAnimation* storage_animation) {
|
|
|
|
furi_assert(storage_animation);
|
|
|
|
StorageAnimation* previous_animation = animation_manager->current_animation;
|
|
|
|
|
|
|
|
const BubbleAnimation* animation = animation_storage_get_bubble_animation(storage_animation);
|
|
|
|
bubble_animation_view_set_animation(animation_manager->animation_view, animation);
|
[FL-2183] [FL-2209] Dolphin Deeds, Level up, assets generation, refactoring (#965)
* Desktop: cleanup headers
* Get loader pubsub via record
* [FL-2183] Dolphin refactoring 2022.01
* Restruct animations assets structure
* Rename assets
* Cleanup headers
* Update Recording animation
* Add BadBattery animation
* Provide loader's pubsub via record
* Fix load/unload animations
* Scripts: add flipper format support, initial dolphin packager rework. Assets: internal and external dolphin.
* Sync internal meta.txt and manifest.txt
* Reorder, rename dolphin assets
* Split essential generated assets
* Add ReadMe for dolphin assets
* Separate essential blocking animations
* Scripts: full dolphin validation before packaging
* Assets, Scripts: dolphin external resources packer
* Github: update codeowners
* Scripts: proper slots handling in dolphin animation meta
* Scripts: correct frames enumeration and fix compiled assets.
* [FL-2209] Add Dolphin Deeds points and many more
* Remove excess frame_rate
* Change dolphin assets directory
* Scripts: add internal resource support to dolphin compiler
* Scripts: add internal assets generation, renaming
* Scripts: correct assert, renaming
* Code cleanup, documentation, fixes
* Update Levelup animations
* Rename essential -> blocking
* Fix Unlocked hint
* Scripts: rewrite Templite compiller, replace regexps with token parser, split block types into code and variable blocks. Update dolphin templates.
* Documentation: add key combos description and use information
* Scripts: cleanup templit, more debug info and add dev comment
Co-authored-by: あく <alleteam@gmail.com>
2022-01-29 12:20:41 +03:00
|
|
|
const char* new_name = animation_storage_get_meta(storage_animation)->name;
|
2022-01-03 00:39:56 +03:00
|
|
|
FURI_LOG_I(TAG, "Select \'%s\' animation", new_name);
|
|
|
|
animation_manager->current_animation = storage_animation;
|
|
|
|
|
|
|
|
if(previous_animation) {
|
|
|
|
animation_storage_free_storage_animation(&previous_animation);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
AnimationManager* animation_manager_alloc(void) {
|
2022-02-18 22:53:46 +03:00
|
|
|
AnimationManager* animation_manager = malloc(sizeof(AnimationManager));
|
2022-01-03 00:39:56 +03:00
|
|
|
animation_manager->animation_view = bubble_animation_view_alloc();
|
[FL-2183] [FL-2209] Dolphin Deeds, Level up, assets generation, refactoring (#965)
* Desktop: cleanup headers
* Get loader pubsub via record
* [FL-2183] Dolphin refactoring 2022.01
* Restruct animations assets structure
* Rename assets
* Cleanup headers
* Update Recording animation
* Add BadBattery animation
* Provide loader's pubsub via record
* Fix load/unload animations
* Scripts: add flipper format support, initial dolphin packager rework. Assets: internal and external dolphin.
* Sync internal meta.txt and manifest.txt
* Reorder, rename dolphin assets
* Split essential generated assets
* Add ReadMe for dolphin assets
* Separate essential blocking animations
* Scripts: full dolphin validation before packaging
* Assets, Scripts: dolphin external resources packer
* Github: update codeowners
* Scripts: proper slots handling in dolphin animation meta
* Scripts: correct frames enumeration and fix compiled assets.
* [FL-2209] Add Dolphin Deeds points and many more
* Remove excess frame_rate
* Change dolphin assets directory
* Scripts: add internal resource support to dolphin compiler
* Scripts: add internal assets generation, renaming
* Scripts: correct assert, renaming
* Code cleanup, documentation, fixes
* Update Levelup animations
* Rename essential -> blocking
* Fix Unlocked hint
* Scripts: rewrite Templite compiller, replace regexps with token parser, split block types into code and variable blocks. Update dolphin templates.
* Documentation: add key combos description and use information
* Scripts: cleanup templit, more debug info and add dev comment
Co-authored-by: あく <alleteam@gmail.com>
2022-01-29 12:20:41 +03:00
|
|
|
animation_manager->view_stack = view_stack_alloc();
|
|
|
|
View* animation_view = bubble_animation_get_view(animation_manager->animation_view);
|
|
|
|
view_stack_add_view(animation_manager->view_stack, animation_view);
|
2022-10-05 18:15:23 +03:00
|
|
|
animation_manager->freezed_animation_name = furi_string_alloc();
|
2022-01-03 00:39:56 +03:00
|
|
|
|
|
|
|
animation_manager->idle_animation_timer =
|
2022-07-20 13:56:33 +03:00
|
|
|
furi_timer_alloc(animation_manager_timer_callback, FuriTimerTypeOnce, animation_manager);
|
2022-01-03 00:39:56 +03:00
|
|
|
bubble_animation_view_set_interact_callback(
|
|
|
|
animation_manager->animation_view, animation_manager_interact_callback, animation_manager);
|
|
|
|
|
2022-07-26 15:21:51 +03:00
|
|
|
Storage* storage = furi_record_open(RECORD_STORAGE);
|
2022-01-03 00:39:56 +03:00
|
|
|
animation_manager->pubsub_subscription_storage = furi_pubsub_subscribe(
|
|
|
|
storage_get_pubsub(storage), animation_manager_check_blocking_callback, animation_manager);
|
2022-07-26 15:21:51 +03:00
|
|
|
furi_record_close(RECORD_STORAGE);
|
2022-01-03 00:39:56 +03:00
|
|
|
|
2022-07-26 15:21:51 +03:00
|
|
|
Dolphin* dolphin = furi_record_open(RECORD_DOLPHIN);
|
2022-01-03 00:39:56 +03:00
|
|
|
animation_manager->pubsub_subscription_dolphin = furi_pubsub_subscribe(
|
|
|
|
dolphin_get_pubsub(dolphin), animation_manager_check_blocking_callback, animation_manager);
|
2022-07-26 15:21:51 +03:00
|
|
|
furi_record_close(RECORD_DOLPHIN);
|
2022-01-03 00:39:56 +03:00
|
|
|
|
|
|
|
animation_manager->sd_shown_sd_ok = true;
|
|
|
|
if(!animation_manager_check_blocking(animation_manager)) {
|
|
|
|
animation_manager_start_new_idle(animation_manager);
|
|
|
|
}
|
|
|
|
|
|
|
|
return animation_manager;
|
|
|
|
}
|
|
|
|
|
|
|
|
void animation_manager_free(AnimationManager* animation_manager) {
|
|
|
|
furi_assert(animation_manager);
|
|
|
|
|
2022-07-26 15:21:51 +03:00
|
|
|
Dolphin* dolphin = furi_record_open(RECORD_DOLPHIN);
|
2022-01-03 00:39:56 +03:00
|
|
|
furi_pubsub_unsubscribe(
|
|
|
|
dolphin_get_pubsub(dolphin), animation_manager->pubsub_subscription_dolphin);
|
2022-07-26 15:21:51 +03:00
|
|
|
furi_record_close(RECORD_DOLPHIN);
|
2022-01-03 00:39:56 +03:00
|
|
|
|
2022-07-26 15:21:51 +03:00
|
|
|
Storage* storage = furi_record_open(RECORD_STORAGE);
|
2022-01-03 00:39:56 +03:00
|
|
|
furi_pubsub_unsubscribe(
|
|
|
|
storage_get_pubsub(storage), animation_manager->pubsub_subscription_storage);
|
2022-07-26 15:21:51 +03:00
|
|
|
furi_record_close(RECORD_STORAGE);
|
2022-01-03 00:39:56 +03:00
|
|
|
|
2022-10-05 18:15:23 +03:00
|
|
|
furi_string_free(animation_manager->freezed_animation_name);
|
[FL-2183] [FL-2209] Dolphin Deeds, Level up, assets generation, refactoring (#965)
* Desktop: cleanup headers
* Get loader pubsub via record
* [FL-2183] Dolphin refactoring 2022.01
* Restruct animations assets structure
* Rename assets
* Cleanup headers
* Update Recording animation
* Add BadBattery animation
* Provide loader's pubsub via record
* Fix load/unload animations
* Scripts: add flipper format support, initial dolphin packager rework. Assets: internal and external dolphin.
* Sync internal meta.txt and manifest.txt
* Reorder, rename dolphin assets
* Split essential generated assets
* Add ReadMe for dolphin assets
* Separate essential blocking animations
* Scripts: full dolphin validation before packaging
* Assets, Scripts: dolphin external resources packer
* Github: update codeowners
* Scripts: proper slots handling in dolphin animation meta
* Scripts: correct frames enumeration and fix compiled assets.
* [FL-2209] Add Dolphin Deeds points and many more
* Remove excess frame_rate
* Change dolphin assets directory
* Scripts: add internal resource support to dolphin compiler
* Scripts: add internal assets generation, renaming
* Scripts: correct assert, renaming
* Code cleanup, documentation, fixes
* Update Levelup animations
* Rename essential -> blocking
* Fix Unlocked hint
* Scripts: rewrite Templite compiller, replace regexps with token parser, split block types into code and variable blocks. Update dolphin templates.
* Documentation: add key combos description and use information
* Scripts: cleanup templit, more debug info and add dev comment
Co-authored-by: あく <alleteam@gmail.com>
2022-01-29 12:20:41 +03:00
|
|
|
View* animation_view = bubble_animation_get_view(animation_manager->animation_view);
|
|
|
|
view_stack_remove_view(animation_manager->view_stack, animation_view);
|
2022-01-03 00:39:56 +03:00
|
|
|
bubble_animation_view_free(animation_manager->animation_view);
|
2022-07-20 13:56:33 +03:00
|
|
|
furi_timer_free(animation_manager->idle_animation_timer);
|
2022-01-03 00:39:56 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
View* animation_manager_get_animation_view(AnimationManager* animation_manager) {
|
|
|
|
furi_assert(animation_manager);
|
|
|
|
|
[FL-2183] [FL-2209] Dolphin Deeds, Level up, assets generation, refactoring (#965)
* Desktop: cleanup headers
* Get loader pubsub via record
* [FL-2183] Dolphin refactoring 2022.01
* Restruct animations assets structure
* Rename assets
* Cleanup headers
* Update Recording animation
* Add BadBattery animation
* Provide loader's pubsub via record
* Fix load/unload animations
* Scripts: add flipper format support, initial dolphin packager rework. Assets: internal and external dolphin.
* Sync internal meta.txt and manifest.txt
* Reorder, rename dolphin assets
* Split essential generated assets
* Add ReadMe for dolphin assets
* Separate essential blocking animations
* Scripts: full dolphin validation before packaging
* Assets, Scripts: dolphin external resources packer
* Github: update codeowners
* Scripts: proper slots handling in dolphin animation meta
* Scripts: correct frames enumeration and fix compiled assets.
* [FL-2209] Add Dolphin Deeds points and many more
* Remove excess frame_rate
* Change dolphin assets directory
* Scripts: add internal resource support to dolphin compiler
* Scripts: add internal assets generation, renaming
* Scripts: correct assert, renaming
* Code cleanup, documentation, fixes
* Update Levelup animations
* Rename essential -> blocking
* Fix Unlocked hint
* Scripts: rewrite Templite compiller, replace regexps with token parser, split block types into code and variable blocks. Update dolphin templates.
* Documentation: add key combos description and use information
* Scripts: cleanup templit, more debug info and add dev comment
Co-authored-by: あく <alleteam@gmail.com>
2022-01-29 12:20:41 +03:00
|
|
|
return view_stack_get_view(animation_manager->view_stack);
|
|
|
|
}
|
|
|
|
|
|
|
|
static bool animation_manager_is_valid_idle_animation(
|
|
|
|
const StorageAnimationManifestInfo* info,
|
|
|
|
const DolphinStats* stats) {
|
|
|
|
furi_assert(info);
|
|
|
|
furi_assert(info->name);
|
|
|
|
|
|
|
|
bool result = true;
|
|
|
|
|
|
|
|
if(!strcmp(info->name, BAD_BATTERY_ANIMATION_NAME)) {
|
2022-07-26 15:21:51 +03:00
|
|
|
Power* power = furi_record_open(RECORD_POWER);
|
[FL-2183] [FL-2209] Dolphin Deeds, Level up, assets generation, refactoring (#965)
* Desktop: cleanup headers
* Get loader pubsub via record
* [FL-2183] Dolphin refactoring 2022.01
* Restruct animations assets structure
* Rename assets
* Cleanup headers
* Update Recording animation
* Add BadBattery animation
* Provide loader's pubsub via record
* Fix load/unload animations
* Scripts: add flipper format support, initial dolphin packager rework. Assets: internal and external dolphin.
* Sync internal meta.txt and manifest.txt
* Reorder, rename dolphin assets
* Split essential generated assets
* Add ReadMe for dolphin assets
* Separate essential blocking animations
* Scripts: full dolphin validation before packaging
* Assets, Scripts: dolphin external resources packer
* Github: update codeowners
* Scripts: proper slots handling in dolphin animation meta
* Scripts: correct frames enumeration and fix compiled assets.
* [FL-2209] Add Dolphin Deeds points and many more
* Remove excess frame_rate
* Change dolphin assets directory
* Scripts: add internal resource support to dolphin compiler
* Scripts: add internal assets generation, renaming
* Scripts: correct assert, renaming
* Code cleanup, documentation, fixes
* Update Levelup animations
* Rename essential -> blocking
* Fix Unlocked hint
* Scripts: rewrite Templite compiller, replace regexps with token parser, split block types into code and variable blocks. Update dolphin templates.
* Documentation: add key combos description and use information
* Scripts: cleanup templit, more debug info and add dev comment
Co-authored-by: あく <alleteam@gmail.com>
2022-01-29 12:20:41 +03:00
|
|
|
bool battery_is_well = power_is_battery_healthy(power);
|
2022-07-26 15:21:51 +03:00
|
|
|
furi_record_close(RECORD_POWER);
|
[FL-2183] [FL-2209] Dolphin Deeds, Level up, assets generation, refactoring (#965)
* Desktop: cleanup headers
* Get loader pubsub via record
* [FL-2183] Dolphin refactoring 2022.01
* Restruct animations assets structure
* Rename assets
* Cleanup headers
* Update Recording animation
* Add BadBattery animation
* Provide loader's pubsub via record
* Fix load/unload animations
* Scripts: add flipper format support, initial dolphin packager rework. Assets: internal and external dolphin.
* Sync internal meta.txt and manifest.txt
* Reorder, rename dolphin assets
* Split essential generated assets
* Add ReadMe for dolphin assets
* Separate essential blocking animations
* Scripts: full dolphin validation before packaging
* Assets, Scripts: dolphin external resources packer
* Github: update codeowners
* Scripts: proper slots handling in dolphin animation meta
* Scripts: correct frames enumeration and fix compiled assets.
* [FL-2209] Add Dolphin Deeds points and many more
* Remove excess frame_rate
* Change dolphin assets directory
* Scripts: add internal resource support to dolphin compiler
* Scripts: add internal assets generation, renaming
* Scripts: correct assert, renaming
* Code cleanup, documentation, fixes
* Update Levelup animations
* Rename essential -> blocking
* Fix Unlocked hint
* Scripts: rewrite Templite compiller, replace regexps with token parser, split block types into code and variable blocks. Update dolphin templates.
* Documentation: add key combos description and use information
* Scripts: cleanup templit, more debug info and add dev comment
Co-authored-by: あく <alleteam@gmail.com>
2022-01-29 12:20:41 +03:00
|
|
|
|
|
|
|
result = !battery_is_well;
|
|
|
|
}
|
|
|
|
if(!strcmp(info->name, NO_SD_ANIMATION_NAME)) {
|
2022-07-26 15:21:51 +03:00
|
|
|
Storage* storage = furi_record_open(RECORD_STORAGE);
|
[FL-2183] [FL-2209] Dolphin Deeds, Level up, assets generation, refactoring (#965)
* Desktop: cleanup headers
* Get loader pubsub via record
* [FL-2183] Dolphin refactoring 2022.01
* Restruct animations assets structure
* Rename assets
* Cleanup headers
* Update Recording animation
* Add BadBattery animation
* Provide loader's pubsub via record
* Fix load/unload animations
* Scripts: add flipper format support, initial dolphin packager rework. Assets: internal and external dolphin.
* Sync internal meta.txt and manifest.txt
* Reorder, rename dolphin assets
* Split essential generated assets
* Add ReadMe for dolphin assets
* Separate essential blocking animations
* Scripts: full dolphin validation before packaging
* Assets, Scripts: dolphin external resources packer
* Github: update codeowners
* Scripts: proper slots handling in dolphin animation meta
* Scripts: correct frames enumeration and fix compiled assets.
* [FL-2209] Add Dolphin Deeds points and many more
* Remove excess frame_rate
* Change dolphin assets directory
* Scripts: add internal resource support to dolphin compiler
* Scripts: add internal assets generation, renaming
* Scripts: correct assert, renaming
* Code cleanup, documentation, fixes
* Update Levelup animations
* Rename essential -> blocking
* Fix Unlocked hint
* Scripts: rewrite Templite compiller, replace regexps with token parser, split block types into code and variable blocks. Update dolphin templates.
* Documentation: add key combos description and use information
* Scripts: cleanup templit, more debug info and add dev comment
Co-authored-by: あく <alleteam@gmail.com>
2022-01-29 12:20:41 +03:00
|
|
|
FS_Error sd_status = storage_sd_status(storage);
|
2022-07-26 15:21:51 +03:00
|
|
|
furi_record_close(RECORD_STORAGE);
|
[FL-2183] [FL-2209] Dolphin Deeds, Level up, assets generation, refactoring (#965)
* Desktop: cleanup headers
* Get loader pubsub via record
* [FL-2183] Dolphin refactoring 2022.01
* Restruct animations assets structure
* Rename assets
* Cleanup headers
* Update Recording animation
* Add BadBattery animation
* Provide loader's pubsub via record
* Fix load/unload animations
* Scripts: add flipper format support, initial dolphin packager rework. Assets: internal and external dolphin.
* Sync internal meta.txt and manifest.txt
* Reorder, rename dolphin assets
* Split essential generated assets
* Add ReadMe for dolphin assets
* Separate essential blocking animations
* Scripts: full dolphin validation before packaging
* Assets, Scripts: dolphin external resources packer
* Github: update codeowners
* Scripts: proper slots handling in dolphin animation meta
* Scripts: correct frames enumeration and fix compiled assets.
* [FL-2209] Add Dolphin Deeds points and many more
* Remove excess frame_rate
* Change dolphin assets directory
* Scripts: add internal resource support to dolphin compiler
* Scripts: add internal assets generation, renaming
* Scripts: correct assert, renaming
* Code cleanup, documentation, fixes
* Update Levelup animations
* Rename essential -> blocking
* Fix Unlocked hint
* Scripts: rewrite Templite compiller, replace regexps with token parser, split block types into code and variable blocks. Update dolphin templates.
* Documentation: add key combos description and use information
* Scripts: cleanup templit, more debug info and add dev comment
Co-authored-by: あく <alleteam@gmail.com>
2022-01-29 12:20:41 +03:00
|
|
|
|
|
|
|
result = (sd_status == FSE_NOT_READY);
|
|
|
|
}
|
|
|
|
if((stats->butthurt < info->min_butthurt) || (stats->butthurt > info->max_butthurt)) {
|
|
|
|
result = false;
|
|
|
|
}
|
|
|
|
if((stats->level < info->min_level) || (stats->level > info->max_level)) {
|
|
|
|
result = false;
|
|
|
|
}
|
|
|
|
|
|
|
|
return result;
|
2022-01-03 00:39:56 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
static StorageAnimation*
|
|
|
|
animation_manager_select_idle_animation(AnimationManager* animation_manager) {
|
2022-05-06 16:37:10 +03:00
|
|
|
UNUSED(animation_manager);
|
2022-01-03 00:39:56 +03:00
|
|
|
StorageAnimationList_t animation_list;
|
|
|
|
StorageAnimationList_init(animation_list);
|
|
|
|
animation_storage_fill_animation_list(&animation_list);
|
|
|
|
|
2022-07-26 15:21:51 +03:00
|
|
|
Dolphin* dolphin = furi_record_open(RECORD_DOLPHIN);
|
2022-01-03 00:39:56 +03:00
|
|
|
DolphinStats stats = dolphin_stats(dolphin);
|
2022-07-26 15:21:51 +03:00
|
|
|
furi_record_close(RECORD_DOLPHIN);
|
2022-01-03 00:39:56 +03:00
|
|
|
uint32_t whole_weight = 0;
|
|
|
|
|
|
|
|
StorageAnimationList_it_t it;
|
|
|
|
for(StorageAnimationList_it(it, animation_list); !StorageAnimationList_end_p(it);) {
|
|
|
|
StorageAnimation* storage_animation = *StorageAnimationList_ref(it);
|
[FL-2183] [FL-2209] Dolphin Deeds, Level up, assets generation, refactoring (#965)
* Desktop: cleanup headers
* Get loader pubsub via record
* [FL-2183] Dolphin refactoring 2022.01
* Restruct animations assets structure
* Rename assets
* Cleanup headers
* Update Recording animation
* Add BadBattery animation
* Provide loader's pubsub via record
* Fix load/unload animations
* Scripts: add flipper format support, initial dolphin packager rework. Assets: internal and external dolphin.
* Sync internal meta.txt and manifest.txt
* Reorder, rename dolphin assets
* Split essential generated assets
* Add ReadMe for dolphin assets
* Separate essential blocking animations
* Scripts: full dolphin validation before packaging
* Assets, Scripts: dolphin external resources packer
* Github: update codeowners
* Scripts: proper slots handling in dolphin animation meta
* Scripts: correct frames enumeration and fix compiled assets.
* [FL-2209] Add Dolphin Deeds points and many more
* Remove excess frame_rate
* Change dolphin assets directory
* Scripts: add internal resource support to dolphin compiler
* Scripts: add internal assets generation, renaming
* Scripts: correct assert, renaming
* Code cleanup, documentation, fixes
* Update Levelup animations
* Rename essential -> blocking
* Fix Unlocked hint
* Scripts: rewrite Templite compiller, replace regexps with token parser, split block types into code and variable blocks. Update dolphin templates.
* Documentation: add key combos description and use information
* Scripts: cleanup templit, more debug info and add dev comment
Co-authored-by: あく <alleteam@gmail.com>
2022-01-29 12:20:41 +03:00
|
|
|
const StorageAnimationManifestInfo* manifest_info =
|
|
|
|
animation_storage_get_meta(storage_animation);
|
|
|
|
bool valid = animation_manager_is_valid_idle_animation(manifest_info, &stats);
|
2022-01-03 00:39:56 +03:00
|
|
|
|
[FL-2183] [FL-2209] Dolphin Deeds, Level up, assets generation, refactoring (#965)
* Desktop: cleanup headers
* Get loader pubsub via record
* [FL-2183] Dolphin refactoring 2022.01
* Restruct animations assets structure
* Rename assets
* Cleanup headers
* Update Recording animation
* Add BadBattery animation
* Provide loader's pubsub via record
* Fix load/unload animations
* Scripts: add flipper format support, initial dolphin packager rework. Assets: internal and external dolphin.
* Sync internal meta.txt and manifest.txt
* Reorder, rename dolphin assets
* Split essential generated assets
* Add ReadMe for dolphin assets
* Separate essential blocking animations
* Scripts: full dolphin validation before packaging
* Assets, Scripts: dolphin external resources packer
* Github: update codeowners
* Scripts: proper slots handling in dolphin animation meta
* Scripts: correct frames enumeration and fix compiled assets.
* [FL-2209] Add Dolphin Deeds points and many more
* Remove excess frame_rate
* Change dolphin assets directory
* Scripts: add internal resource support to dolphin compiler
* Scripts: add internal assets generation, renaming
* Scripts: correct assert, renaming
* Code cleanup, documentation, fixes
* Update Levelup animations
* Rename essential -> blocking
* Fix Unlocked hint
* Scripts: rewrite Templite compiller, replace regexps with token parser, split block types into code and variable blocks. Update dolphin templates.
* Documentation: add key combos description and use information
* Scripts: cleanup templit, more debug info and add dev comment
Co-authored-by: あく <alleteam@gmail.com>
2022-01-29 12:20:41 +03:00
|
|
|
if(valid) {
|
|
|
|
whole_weight += manifest_info->weight;
|
|
|
|
StorageAnimationList_next(it);
|
|
|
|
} else {
|
2022-01-03 00:39:56 +03:00
|
|
|
animation_storage_free_storage_animation(&storage_animation);
|
|
|
|
/* remove and increase iterator */
|
|
|
|
StorageAnimationList_remove(animation_list, it);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-05-11 12:45:01 +03:00
|
|
|
uint32_t lucky_number = furi_hal_random_get() % whole_weight;
|
2022-01-03 00:39:56 +03:00
|
|
|
uint32_t weight = 0;
|
|
|
|
|
|
|
|
StorageAnimation* selected = NULL;
|
|
|
|
for
|
|
|
|
M_EACH(item, animation_list, StorageAnimationList_t) {
|
|
|
|
if(lucky_number < weight) {
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
weight += animation_storage_get_meta(*item)->weight;
|
|
|
|
selected = *item;
|
|
|
|
}
|
|
|
|
|
|
|
|
for
|
|
|
|
M_EACH(item, animation_list, StorageAnimationList_t) {
|
|
|
|
if(*item != selected) {
|
|
|
|
animation_storage_free_storage_animation(item);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
StorageAnimationList_clear(animation_list);
|
|
|
|
|
|
|
|
/* cache animation, if failed - choose reliable animation */
|
|
|
|
if(!animation_storage_get_bubble_animation(selected)) {
|
[FL-2183] [FL-2209] Dolphin Deeds, Level up, assets generation, refactoring (#965)
* Desktop: cleanup headers
* Get loader pubsub via record
* [FL-2183] Dolphin refactoring 2022.01
* Restruct animations assets structure
* Rename assets
* Cleanup headers
* Update Recording animation
* Add BadBattery animation
* Provide loader's pubsub via record
* Fix load/unload animations
* Scripts: add flipper format support, initial dolphin packager rework. Assets: internal and external dolphin.
* Sync internal meta.txt and manifest.txt
* Reorder, rename dolphin assets
* Split essential generated assets
* Add ReadMe for dolphin assets
* Separate essential blocking animations
* Scripts: full dolphin validation before packaging
* Assets, Scripts: dolphin external resources packer
* Github: update codeowners
* Scripts: proper slots handling in dolphin animation meta
* Scripts: correct frames enumeration and fix compiled assets.
* [FL-2209] Add Dolphin Deeds points and many more
* Remove excess frame_rate
* Change dolphin assets directory
* Scripts: add internal resource support to dolphin compiler
* Scripts: add internal assets generation, renaming
* Scripts: correct assert, renaming
* Code cleanup, documentation, fixes
* Update Levelup animations
* Rename essential -> blocking
* Fix Unlocked hint
* Scripts: rewrite Templite compiller, replace regexps with token parser, split block types into code and variable blocks. Update dolphin templates.
* Documentation: add key combos description and use information
* Scripts: cleanup templit, more debug info and add dev comment
Co-authored-by: あく <alleteam@gmail.com>
2022-01-29 12:20:41 +03:00
|
|
|
const char* name = animation_storage_get_meta(selected)->name;
|
2022-01-03 00:39:56 +03:00
|
|
|
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);
|
|
|
|
}
|
|
|
|
|
|
|
|
furi_assert(selected);
|
|
|
|
return selected;
|
|
|
|
}
|
|
|
|
|
2022-02-13 22:24:03 +03:00
|
|
|
bool animation_manager_is_animation_loaded(AnimationManager* animation_manager) {
|
|
|
|
furi_assert(animation_manager);
|
|
|
|
return animation_manager->current_animation;
|
|
|
|
}
|
|
|
|
|
2022-01-03 00:39:56 +03:00
|
|
|
void animation_manager_unload_and_stall_animation(AnimationManager* animation_manager) {
|
|
|
|
furi_assert(animation_manager);
|
|
|
|
furi_assert(animation_manager->current_animation);
|
2022-10-05 18:15:23 +03:00
|
|
|
furi_assert(!furi_string_size(animation_manager->freezed_animation_name));
|
2022-01-03 00:39:56 +03:00
|
|
|
furi_assert(
|
|
|
|
(animation_manager->state == AnimationManagerStateIdle) ||
|
|
|
|
(animation_manager->state == AnimationManagerStateBlocked));
|
|
|
|
|
|
|
|
if(animation_manager->state == AnimationManagerStateBlocked) {
|
|
|
|
animation_manager->state = AnimationManagerStateFreezedBlocked;
|
|
|
|
} else if(animation_manager->state == AnimationManagerStateIdle) {
|
|
|
|
animation_manager->state = AnimationManagerStateFreezedIdle;
|
|
|
|
|
|
|
|
animation_manager->freezed_animation_time_left =
|
|
|
|
xTimerGetExpiryTime(animation_manager->idle_animation_timer) - xTaskGetTickCount();
|
|
|
|
if(animation_manager->freezed_animation_time_left < 0) {
|
|
|
|
animation_manager->freezed_animation_time_left = 0;
|
|
|
|
}
|
2022-07-20 13:56:33 +03:00
|
|
|
furi_timer_stop(animation_manager->idle_animation_timer);
|
2022-01-03 00:39:56 +03:00
|
|
|
} else {
|
|
|
|
furi_assert(0);
|
|
|
|
}
|
|
|
|
|
[FL-2183] [FL-2209] Dolphin Deeds, Level up, assets generation, refactoring (#965)
* Desktop: cleanup headers
* Get loader pubsub via record
* [FL-2183] Dolphin refactoring 2022.01
* Restruct animations assets structure
* Rename assets
* Cleanup headers
* Update Recording animation
* Add BadBattery animation
* Provide loader's pubsub via record
* Fix load/unload animations
* Scripts: add flipper format support, initial dolphin packager rework. Assets: internal and external dolphin.
* Sync internal meta.txt and manifest.txt
* Reorder, rename dolphin assets
* Split essential generated assets
* Add ReadMe for dolphin assets
* Separate essential blocking animations
* Scripts: full dolphin validation before packaging
* Assets, Scripts: dolphin external resources packer
* Github: update codeowners
* Scripts: proper slots handling in dolphin animation meta
* Scripts: correct frames enumeration and fix compiled assets.
* [FL-2209] Add Dolphin Deeds points and many more
* Remove excess frame_rate
* Change dolphin assets directory
* Scripts: add internal resource support to dolphin compiler
* Scripts: add internal assets generation, renaming
* Scripts: correct assert, renaming
* Code cleanup, documentation, fixes
* Update Levelup animations
* Rename essential -> blocking
* Fix Unlocked hint
* Scripts: rewrite Templite compiller, replace regexps with token parser, split block types into code and variable blocks. Update dolphin templates.
* Documentation: add key combos description and use information
* Scripts: cleanup templit, more debug info and add dev comment
Co-authored-by: あく <alleteam@gmail.com>
2022-01-29 12:20:41 +03:00
|
|
|
FURI_LOG_I(
|
|
|
|
TAG,
|
|
|
|
"Unload animation \'%s\'",
|
|
|
|
animation_storage_get_meta(animation_manager->current_animation)->name);
|
|
|
|
|
|
|
|
StorageAnimationManifestInfo* meta =
|
|
|
|
animation_storage_get_meta(animation_manager->current_animation);
|
2022-01-03 00:39:56 +03:00
|
|
|
/* copy str, not move, because it can be internal animation */
|
2022-10-05 18:15:23 +03:00
|
|
|
furi_string_set(animation_manager->freezed_animation_name, meta->name);
|
2022-01-03 00:39:56 +03:00
|
|
|
|
|
|
|
bubble_animation_freeze(animation_manager->animation_view);
|
|
|
|
animation_storage_free_storage_animation(&animation_manager->current_animation);
|
|
|
|
}
|
|
|
|
|
|
|
|
void animation_manager_load_and_continue_animation(AnimationManager* animation_manager) {
|
|
|
|
furi_assert(animation_manager);
|
|
|
|
furi_assert(!animation_manager->current_animation);
|
2022-10-05 18:15:23 +03:00
|
|
|
furi_assert(furi_string_size(animation_manager->freezed_animation_name));
|
2022-01-03 00:39:56 +03:00
|
|
|
furi_assert(
|
|
|
|
(animation_manager->state == AnimationManagerStateFreezedIdle) ||
|
|
|
|
(animation_manager->state == AnimationManagerStateFreezedBlocked));
|
|
|
|
|
|
|
|
if(animation_manager->state == AnimationManagerStateFreezedBlocked) {
|
|
|
|
StorageAnimation* restore_animation = animation_storage_find_animation(
|
2022-10-05 18:15:23 +03:00
|
|
|
furi_string_get_cstr(animation_manager->freezed_animation_name));
|
2022-01-03 00:39:56 +03:00
|
|
|
/* all blocked animations must be in flipper -> we can
|
|
|
|
* always find blocking animation */
|
|
|
|
furi_assert(restore_animation);
|
|
|
|
animation_manager_replace_current_animation(animation_manager, restore_animation);
|
|
|
|
animation_manager->state = AnimationManagerStateBlocked;
|
|
|
|
} else if(animation_manager->state == AnimationManagerStateFreezedIdle) {
|
|
|
|
/* check if we missed some system notifications, and set current_animation */
|
|
|
|
bool blocked = animation_manager_check_blocking(animation_manager);
|
|
|
|
if(!blocked) {
|
|
|
|
/* if no blocking - try restore last one idle */
|
|
|
|
StorageAnimation* restore_animation = animation_storage_find_animation(
|
2022-10-05 18:15:23 +03:00
|
|
|
furi_string_get_cstr(animation_manager->freezed_animation_name));
|
2022-01-03 00:39:56 +03:00
|
|
|
if(restore_animation) {
|
2022-07-26 15:21:51 +03:00
|
|
|
Dolphin* dolphin = furi_record_open(RECORD_DOLPHIN);
|
[FL-2183] [FL-2209] Dolphin Deeds, Level up, assets generation, refactoring (#965)
* Desktop: cleanup headers
* Get loader pubsub via record
* [FL-2183] Dolphin refactoring 2022.01
* Restruct animations assets structure
* Rename assets
* Cleanup headers
* Update Recording animation
* Add BadBattery animation
* Provide loader's pubsub via record
* Fix load/unload animations
* Scripts: add flipper format support, initial dolphin packager rework. Assets: internal and external dolphin.
* Sync internal meta.txt and manifest.txt
* Reorder, rename dolphin assets
* Split essential generated assets
* Add ReadMe for dolphin assets
* Separate essential blocking animations
* Scripts: full dolphin validation before packaging
* Assets, Scripts: dolphin external resources packer
* Github: update codeowners
* Scripts: proper slots handling in dolphin animation meta
* Scripts: correct frames enumeration and fix compiled assets.
* [FL-2209] Add Dolphin Deeds points and many more
* Remove excess frame_rate
* Change dolphin assets directory
* Scripts: add internal resource support to dolphin compiler
* Scripts: add internal assets generation, renaming
* Scripts: correct assert, renaming
* Code cleanup, documentation, fixes
* Update Levelup animations
* Rename essential -> blocking
* Fix Unlocked hint
* Scripts: rewrite Templite compiller, replace regexps with token parser, split block types into code and variable blocks. Update dolphin templates.
* Documentation: add key combos description and use information
* Scripts: cleanup templit, more debug info and add dev comment
Co-authored-by: あく <alleteam@gmail.com>
2022-01-29 12:20:41 +03:00
|
|
|
DolphinStats stats = dolphin_stats(dolphin);
|
2022-07-26 15:21:51 +03:00
|
|
|
furi_record_close(RECORD_DOLPHIN);
|
[FL-2183] [FL-2209] Dolphin Deeds, Level up, assets generation, refactoring (#965)
* Desktop: cleanup headers
* Get loader pubsub via record
* [FL-2183] Dolphin refactoring 2022.01
* Restruct animations assets structure
* Rename assets
* Cleanup headers
* Update Recording animation
* Add BadBattery animation
* Provide loader's pubsub via record
* Fix load/unload animations
* Scripts: add flipper format support, initial dolphin packager rework. Assets: internal and external dolphin.
* Sync internal meta.txt and manifest.txt
* Reorder, rename dolphin assets
* Split essential generated assets
* Add ReadMe for dolphin assets
* Separate essential blocking animations
* Scripts: full dolphin validation before packaging
* Assets, Scripts: dolphin external resources packer
* Github: update codeowners
* Scripts: proper slots handling in dolphin animation meta
* Scripts: correct frames enumeration and fix compiled assets.
* [FL-2209] Add Dolphin Deeds points and many more
* Remove excess frame_rate
* Change dolphin assets directory
* Scripts: add internal resource support to dolphin compiler
* Scripts: add internal assets generation, renaming
* Scripts: correct assert, renaming
* Code cleanup, documentation, fixes
* Update Levelup animations
* Rename essential -> blocking
* Fix Unlocked hint
* Scripts: rewrite Templite compiller, replace regexps with token parser, split block types into code and variable blocks. Update dolphin templates.
* Documentation: add key combos description and use information
* Scripts: cleanup templit, more debug info and add dev comment
Co-authored-by: あく <alleteam@gmail.com>
2022-01-29 12:20:41 +03:00
|
|
|
const StorageAnimationManifestInfo* manifest_info =
|
|
|
|
animation_storage_get_meta(restore_animation);
|
|
|
|
bool valid = animation_manager_is_valid_idle_animation(manifest_info, &stats);
|
|
|
|
if(valid) {
|
|
|
|
animation_manager_replace_current_animation(
|
|
|
|
animation_manager, restore_animation);
|
|
|
|
animation_manager->state = AnimationManagerStateIdle;
|
|
|
|
|
|
|
|
if(animation_manager->freezed_animation_time_left) {
|
2022-07-20 13:56:33 +03:00
|
|
|
furi_timer_start(
|
[FL-2183] [FL-2209] Dolphin Deeds, Level up, assets generation, refactoring (#965)
* Desktop: cleanup headers
* Get loader pubsub via record
* [FL-2183] Dolphin refactoring 2022.01
* Restruct animations assets structure
* Rename assets
* Cleanup headers
* Update Recording animation
* Add BadBattery animation
* Provide loader's pubsub via record
* Fix load/unload animations
* Scripts: add flipper format support, initial dolphin packager rework. Assets: internal and external dolphin.
* Sync internal meta.txt and manifest.txt
* Reorder, rename dolphin assets
* Split essential generated assets
* Add ReadMe for dolphin assets
* Separate essential blocking animations
* Scripts: full dolphin validation before packaging
* Assets, Scripts: dolphin external resources packer
* Github: update codeowners
* Scripts: proper slots handling in dolphin animation meta
* Scripts: correct frames enumeration and fix compiled assets.
* [FL-2209] Add Dolphin Deeds points and many more
* Remove excess frame_rate
* Change dolphin assets directory
* Scripts: add internal resource support to dolphin compiler
* Scripts: add internal assets generation, renaming
* Scripts: correct assert, renaming
* Code cleanup, documentation, fixes
* Update Levelup animations
* Rename essential -> blocking
* Fix Unlocked hint
* Scripts: rewrite Templite compiller, replace regexps with token parser, split block types into code and variable blocks. Update dolphin templates.
* Documentation: add key combos description and use information
* Scripts: cleanup templit, more debug info and add dev comment
Co-authored-by: あく <alleteam@gmail.com>
2022-01-29 12:20:41 +03:00
|
|
|
animation_manager->idle_animation_timer,
|
|
|
|
animation_manager->freezed_animation_time_left);
|
|
|
|
} else {
|
|
|
|
const BubbleAnimation* animation = animation_storage_get_bubble_animation(
|
|
|
|
animation_manager->current_animation);
|
2022-07-20 13:56:33 +03:00
|
|
|
furi_timer_start(
|
[FL-2183] [FL-2209] Dolphin Deeds, Level up, assets generation, refactoring (#965)
* Desktop: cleanup headers
* Get loader pubsub via record
* [FL-2183] Dolphin refactoring 2022.01
* Restruct animations assets structure
* Rename assets
* Cleanup headers
* Update Recording animation
* Add BadBattery animation
* Provide loader's pubsub via record
* Fix load/unload animations
* Scripts: add flipper format support, initial dolphin packager rework. Assets: internal and external dolphin.
* Sync internal meta.txt and manifest.txt
* Reorder, rename dolphin assets
* Split essential generated assets
* Add ReadMe for dolphin assets
* Separate essential blocking animations
* Scripts: full dolphin validation before packaging
* Assets, Scripts: dolphin external resources packer
* Github: update codeowners
* Scripts: proper slots handling in dolphin animation meta
* Scripts: correct frames enumeration and fix compiled assets.
* [FL-2209] Add Dolphin Deeds points and many more
* Remove excess frame_rate
* Change dolphin assets directory
* Scripts: add internal resource support to dolphin compiler
* Scripts: add internal assets generation, renaming
* Scripts: correct assert, renaming
* Code cleanup, documentation, fixes
* Update Levelup animations
* Rename essential -> blocking
* Fix Unlocked hint
* Scripts: rewrite Templite compiller, replace regexps with token parser, split block types into code and variable blocks. Update dolphin templates.
* Documentation: add key combos description and use information
* Scripts: cleanup templit, more debug info and add dev comment
Co-authored-by: あく <alleteam@gmail.com>
2022-01-29 12:20:41 +03:00
|
|
|
animation_manager->idle_animation_timer, animation->duration * 1000);
|
|
|
|
}
|
2022-01-03 00:39:56 +03:00
|
|
|
}
|
|
|
|
} else {
|
|
|
|
FURI_LOG_E(
|
|
|
|
TAG,
|
|
|
|
"Failed to restore \'%s\'",
|
2022-10-05 18:15:23 +03:00
|
|
|
furi_string_get_cstr(animation_manager->freezed_animation_name));
|
2022-01-03 00:39:56 +03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
/* Unknown state is an error. But not in release version.*/
|
|
|
|
furi_assert(0);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* if can't restore previous animation - select new */
|
|
|
|
if(!animation_manager->current_animation) {
|
|
|
|
animation_manager_start_new_idle(animation_manager);
|
|
|
|
}
|
[FL-2183] [FL-2209] Dolphin Deeds, Level up, assets generation, refactoring (#965)
* Desktop: cleanup headers
* Get loader pubsub via record
* [FL-2183] Dolphin refactoring 2022.01
* Restruct animations assets structure
* Rename assets
* Cleanup headers
* Update Recording animation
* Add BadBattery animation
* Provide loader's pubsub via record
* Fix load/unload animations
* Scripts: add flipper format support, initial dolphin packager rework. Assets: internal and external dolphin.
* Sync internal meta.txt and manifest.txt
* Reorder, rename dolphin assets
* Split essential generated assets
* Add ReadMe for dolphin assets
* Separate essential blocking animations
* Scripts: full dolphin validation before packaging
* Assets, Scripts: dolphin external resources packer
* Github: update codeowners
* Scripts: proper slots handling in dolphin animation meta
* Scripts: correct frames enumeration and fix compiled assets.
* [FL-2209] Add Dolphin Deeds points and many more
* Remove excess frame_rate
* Change dolphin assets directory
* Scripts: add internal resource support to dolphin compiler
* Scripts: add internal assets generation, renaming
* Scripts: correct assert, renaming
* Code cleanup, documentation, fixes
* Update Levelup animations
* Rename essential -> blocking
* Fix Unlocked hint
* Scripts: rewrite Templite compiller, replace regexps with token parser, split block types into code and variable blocks. Update dolphin templates.
* Documentation: add key combos description and use information
* Scripts: cleanup templit, more debug info and add dev comment
Co-authored-by: あく <alleteam@gmail.com>
2022-01-29 12:20:41 +03:00
|
|
|
FURI_LOG_I(
|
2022-01-03 00:39:56 +03:00
|
|
|
TAG,
|
[FL-2183] [FL-2209] Dolphin Deeds, Level up, assets generation, refactoring (#965)
* Desktop: cleanup headers
* Get loader pubsub via record
* [FL-2183] Dolphin refactoring 2022.01
* Restruct animations assets structure
* Rename assets
* Cleanup headers
* Update Recording animation
* Add BadBattery animation
* Provide loader's pubsub via record
* Fix load/unload animations
* Scripts: add flipper format support, initial dolphin packager rework. Assets: internal and external dolphin.
* Sync internal meta.txt and manifest.txt
* Reorder, rename dolphin assets
* Split essential generated assets
* Add ReadMe for dolphin assets
* Separate essential blocking animations
* Scripts: full dolphin validation before packaging
* Assets, Scripts: dolphin external resources packer
* Github: update codeowners
* Scripts: proper slots handling in dolphin animation meta
* Scripts: correct frames enumeration and fix compiled assets.
* [FL-2209] Add Dolphin Deeds points and many more
* Remove excess frame_rate
* Change dolphin assets directory
* Scripts: add internal resource support to dolphin compiler
* Scripts: add internal assets generation, renaming
* Scripts: correct assert, renaming
* Code cleanup, documentation, fixes
* Update Levelup animations
* Rename essential -> blocking
* Fix Unlocked hint
* Scripts: rewrite Templite compiller, replace regexps with token parser, split block types into code and variable blocks. Update dolphin templates.
* Documentation: add key combos description and use information
* Scripts: cleanup templit, more debug info and add dev comment
Co-authored-by: あく <alleteam@gmail.com>
2022-01-29 12:20:41 +03:00
|
|
|
"Load animation \'%s\'",
|
|
|
|
animation_storage_get_meta(animation_manager->current_animation)->name);
|
2022-01-03 00:39:56 +03:00
|
|
|
|
|
|
|
bubble_animation_unfreeze(animation_manager->animation_view);
|
2022-10-05 18:15:23 +03:00
|
|
|
furi_string_reset(animation_manager->freezed_animation_name);
|
2022-01-03 00:39:56 +03:00
|
|
|
furi_assert(animation_manager->current_animation);
|
|
|
|
}
|
[FL-2183] [FL-2209] Dolphin Deeds, Level up, assets generation, refactoring (#965)
* Desktop: cleanup headers
* Get loader pubsub via record
* [FL-2183] Dolphin refactoring 2022.01
* Restruct animations assets structure
* Rename assets
* Cleanup headers
* Update Recording animation
* Add BadBattery animation
* Provide loader's pubsub via record
* Fix load/unload animations
* Scripts: add flipper format support, initial dolphin packager rework. Assets: internal and external dolphin.
* Sync internal meta.txt and manifest.txt
* Reorder, rename dolphin assets
* Split essential generated assets
* Add ReadMe for dolphin assets
* Separate essential blocking animations
* Scripts: full dolphin validation before packaging
* Assets, Scripts: dolphin external resources packer
* Github: update codeowners
* Scripts: proper slots handling in dolphin animation meta
* Scripts: correct frames enumeration and fix compiled assets.
* [FL-2209] Add Dolphin Deeds points and many more
* Remove excess frame_rate
* Change dolphin assets directory
* Scripts: add internal resource support to dolphin compiler
* Scripts: add internal assets generation, renaming
* Scripts: correct assert, renaming
* Code cleanup, documentation, fixes
* Update Levelup animations
* Rename essential -> blocking
* Fix Unlocked hint
* Scripts: rewrite Templite compiller, replace regexps with token parser, split block types into code and variable blocks. Update dolphin templates.
* Documentation: add key combos description and use information
* Scripts: cleanup templit, more debug info and add dev comment
Co-authored-by: あく <alleteam@gmail.com>
2022-01-29 12:20:41 +03:00
|
|
|
|
|
|
|
static void animation_manager_switch_to_one_shot_view(AnimationManager* animation_manager) {
|
|
|
|
furi_assert(animation_manager);
|
|
|
|
furi_assert(!animation_manager->one_shot_view);
|
2022-07-26 15:21:51 +03:00
|
|
|
Dolphin* dolphin = furi_record_open(RECORD_DOLPHIN);
|
[FL-2183] [FL-2209] Dolphin Deeds, Level up, assets generation, refactoring (#965)
* Desktop: cleanup headers
* Get loader pubsub via record
* [FL-2183] Dolphin refactoring 2022.01
* Restruct animations assets structure
* Rename assets
* Cleanup headers
* Update Recording animation
* Add BadBattery animation
* Provide loader's pubsub via record
* Fix load/unload animations
* Scripts: add flipper format support, initial dolphin packager rework. Assets: internal and external dolphin.
* Sync internal meta.txt and manifest.txt
* Reorder, rename dolphin assets
* Split essential generated assets
* Add ReadMe for dolphin assets
* Separate essential blocking animations
* Scripts: full dolphin validation before packaging
* Assets, Scripts: dolphin external resources packer
* Github: update codeowners
* Scripts: proper slots handling in dolphin animation meta
* Scripts: correct frames enumeration and fix compiled assets.
* [FL-2209] Add Dolphin Deeds points and many more
* Remove excess frame_rate
* Change dolphin assets directory
* Scripts: add internal resource support to dolphin compiler
* Scripts: add internal assets generation, renaming
* Scripts: correct assert, renaming
* Code cleanup, documentation, fixes
* Update Levelup animations
* Rename essential -> blocking
* Fix Unlocked hint
* Scripts: rewrite Templite compiller, replace regexps with token parser, split block types into code and variable blocks. Update dolphin templates.
* Documentation: add key combos description and use information
* Scripts: cleanup templit, more debug info and add dev comment
Co-authored-by: あく <alleteam@gmail.com>
2022-01-29 12:20:41 +03:00
|
|
|
DolphinStats stats = dolphin_stats(dolphin);
|
2022-07-26 15:21:51 +03:00
|
|
|
furi_record_close(RECORD_DOLPHIN);
|
[FL-2183] [FL-2209] Dolphin Deeds, Level up, assets generation, refactoring (#965)
* Desktop: cleanup headers
* Get loader pubsub via record
* [FL-2183] Dolphin refactoring 2022.01
* Restruct animations assets structure
* Rename assets
* Cleanup headers
* Update Recording animation
* Add BadBattery animation
* Provide loader's pubsub via record
* Fix load/unload animations
* Scripts: add flipper format support, initial dolphin packager rework. Assets: internal and external dolphin.
* Sync internal meta.txt and manifest.txt
* Reorder, rename dolphin assets
* Split essential generated assets
* Add ReadMe for dolphin assets
* Separate essential blocking animations
* Scripts: full dolphin validation before packaging
* Assets, Scripts: dolphin external resources packer
* Github: update codeowners
* Scripts: proper slots handling in dolphin animation meta
* Scripts: correct frames enumeration and fix compiled assets.
* [FL-2209] Add Dolphin Deeds points and many more
* Remove excess frame_rate
* Change dolphin assets directory
* Scripts: add internal resource support to dolphin compiler
* Scripts: add internal assets generation, renaming
* Scripts: correct assert, renaming
* Code cleanup, documentation, fixes
* Update Levelup animations
* Rename essential -> blocking
* Fix Unlocked hint
* Scripts: rewrite Templite compiller, replace regexps with token parser, split block types into code and variable blocks. Update dolphin templates.
* Documentation: add key combos description and use information
* Scripts: cleanup templit, more debug info and add dev comment
Co-authored-by: あく <alleteam@gmail.com>
2022-01-29 12:20:41 +03:00
|
|
|
|
|
|
|
animation_manager->one_shot_view = one_shot_view_alloc();
|
|
|
|
one_shot_view_set_interact_callback(
|
|
|
|
animation_manager->one_shot_view, animation_manager_interact_callback, animation_manager);
|
|
|
|
View* prev_view = bubble_animation_get_view(animation_manager->animation_view);
|
|
|
|
View* next_view = one_shot_view_get_view(animation_manager->one_shot_view);
|
|
|
|
view_stack_remove_view(animation_manager->view_stack, prev_view);
|
|
|
|
view_stack_add_view(animation_manager->view_stack, next_view);
|
|
|
|
if(stats.level == 1) {
|
|
|
|
one_shot_view_start_animation(animation_manager->one_shot_view, &A_Levelup1_128x64);
|
|
|
|
} else if(stats.level == 2) {
|
|
|
|
one_shot_view_start_animation(animation_manager->one_shot_view, &A_Levelup2_128x64);
|
|
|
|
} else {
|
|
|
|
furi_assert(0);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void animation_manager_switch_to_animation_view(AnimationManager* animation_manager) {
|
|
|
|
furi_assert(animation_manager);
|
|
|
|
furi_assert(animation_manager->one_shot_view);
|
|
|
|
|
|
|
|
View* prev_view = one_shot_view_get_view(animation_manager->one_shot_view);
|
|
|
|
View* next_view = bubble_animation_get_view(animation_manager->animation_view);
|
|
|
|
view_stack_remove_view(animation_manager->view_stack, prev_view);
|
|
|
|
view_stack_add_view(animation_manager->view_stack, next_view);
|
|
|
|
one_shot_view_free(animation_manager->one_shot_view);
|
|
|
|
animation_manager->one_shot_view = NULL;
|
|
|
|
}
|