Prevent hacking related backgrounds from being displayed in dummy mode. (#2107)

* Prevent hacking related backgrounds from being displayed in dummy mode.
* Add function call to animation manager to set dummy mode.
* Reboot retains dummy mode background.

Co-authored-by: あく <alleteam@gmail.com>
This commit is contained in:
usiegl00
2022-12-12 21:46:41 +09:00
committed by GitHub
parent d541f142c8
commit 1c12613863
3 changed files with 21 additions and 1 deletions

View File

@@ -52,6 +52,7 @@ struct AnimationManager {
FuriString* freezed_animation_name;
int32_t freezed_animation_time_left;
ViewStack* view_stack;
bool dummy_mode;
};
static StorageAnimation*
@@ -93,6 +94,12 @@ void animation_manager_set_interact_callback(
animation_manager->interact_callback = callback;
}
void animation_manager_set_dummy_mode_state(AnimationManager* animation_manager, bool enabled) {
furi_assert(animation_manager);
animation_manager->dummy_mode = enabled;
animation_manager_start_new_idle(animation_manager);
}
static void animation_manager_check_blocking_callback(const void* message, void* context) {
const StorageEvent* storage_event = message;
@@ -363,7 +370,9 @@ static bool animation_manager_is_valid_idle_animation(
static StorageAnimation*
animation_manager_select_idle_animation(AnimationManager* animation_manager) {
UNUSED(animation_manager);
if(animation_manager->dummy_mode) {
return animation_storage_find_animation(HARDCODED_ANIMATION_NAME);
}
StorageAnimationList_t animation_list;
StorageAnimationList_init(animation_list);
animation_storage_fill_animation_list(&animation_list);