Add anim cycle 30s, 1m and manifest

This commit is contained in:
Willy-JL
2023-01-17 01:22:19 +00:00
parent a8725999c7
commit 01b1ea123b
4 changed files with 26 additions and 21 deletions

View File

@@ -197,12 +197,13 @@ static void animation_manager_start_new_idle(AnimationManager* 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);
const BubbleAnimation* bubble_animation =
animation_storage_get_bubble_animation(animation_manager->current_animation);
animation_manager->state = AnimationManagerStateIdle;
DesktopSettings* settings = malloc(sizeof(DesktopSettings));
DESKTOP_SETTINGS_LOAD(settings);
furi_timer_start(animation_manager->idle_animation_timer, (settings->cycle_animations_s - 1) * 1000);
int32_t duration_s = settings->cycle_animation_s == -1 ? bubble_animation->duration : (settings->cycle_animation_s - 1);
furi_timer_start(animation_manager->idle_animation_timer, duration_s * 1000);
free(settings);
}
@@ -511,12 +512,13 @@ void animation_manager_load_and_continue_animation(AnimationManager* animation_m
animation_manager->idle_animation_timer,
animation_manager->freezed_animation_time_left);
} else {
// const BubbleAnimation* animation = animation_storage_get_bubble_animation(
// animation_manager->current_animation);
const BubbleAnimation* animation = animation_storage_get_bubble_animation(
animation_manager->current_animation);
DesktopSettings* settings = malloc(sizeof(DesktopSettings));
DESKTOP_SETTINGS_LOAD(settings);
int32_t duration_s = settings->cycle_animation_s == -1 ? animation->duration : (settings->cycle_animation_s - 1);
furi_timer_start(
animation_manager->idle_animation_timer, (settings->cycle_animations_s - 1) * 1000);
animation_manager->idle_animation_timer, duration_s * 1000);
free(settings);
}
}

View File

@@ -322,8 +322,8 @@ int32_t desktop_srv(void* p) {
DESKTOP_SETTINGS_SAVE(&desktop->settings);
}
if(!desktop->settings.cycle_animations_s) {
desktop->settings.cycle_animations_s = 3601;
if(!desktop->settings.cycle_animation_s) {
desktop->settings.cycle_animation_s = 3601;
DESKTOP_SETTINGS_SAVE(&desktop->settings);
}

View File

@@ -64,5 +64,5 @@ typedef struct {
uint8_t displayBatteryPercentage;
bool is_sfwmode;
uint8_t sfw_mode;
uint32_t cycle_animations_s;
int32_t cycle_animation_s;
} DesktopSettings;