[FL-1995] New dolphin animations (part 1) (#835)
* Desktop Animation (part 1): Ugly naked ohmygod architecture * fix butthurt, fix locked scene * Change SD icons, fixes * Fix level update animation * Fixes, correct butthurt * Clean up code * furi_assert(0) -> furi_crash("msg") * Gui: rename none layer to desktop, update docs. Co-authored-by: あく <alleteam@gmail.com>
This commit is contained in:
@@ -1,10 +1,55 @@
|
||||
#pragma once
|
||||
|
||||
#include <furi.h>
|
||||
#include <math.h>
|
||||
#include <assets_icons.h>
|
||||
#include "dolphin/dolphin.h"
|
||||
#include "dolphin/helpers/dolphin_state.h"
|
||||
#include "time.h"
|
||||
#include <stdint.h>
|
||||
#include <gui/icon.h>
|
||||
|
||||
const Icon* desktop_get_icon();
|
||||
typedef struct DesktopAnimation DesktopAnimation;
|
||||
|
||||
typedef struct ActiveAnimation ActiveAnimation;
|
||||
typedef struct BasicAnimation BasicAnimation;
|
||||
|
||||
typedef enum {
|
||||
DesktopAnimationStateBasic,
|
||||
DesktopAnimationStateActive,
|
||||
DesktopAnimationStateLevelUpIsPending,
|
||||
DesktopAnimationStateSDEmpty,
|
||||
DesktopAnimationStateSDEmptyURL,
|
||||
DesktopAnimationStateSDCorrupted,
|
||||
} DesktopAnimationState;
|
||||
|
||||
struct BasicAnimation {
|
||||
const Icon* icon;
|
||||
uint16_t duration; // sec
|
||||
uint16_t active_cooldown;
|
||||
uint8_t weight;
|
||||
uint16_t butthurt_level_mask;
|
||||
};
|
||||
|
||||
struct ActiveAnimation {
|
||||
const Icon* icon;
|
||||
uint16_t duration; // sec
|
||||
};
|
||||
|
||||
typedef struct {
|
||||
const BasicAnimation* basic;
|
||||
const ActiveAnimation* active;
|
||||
} PairedAnimation;
|
||||
|
||||
typedef void (*AnimationChangedCallback)(void*);
|
||||
|
||||
DesktopAnimation* desktop_animation_alloc(void);
|
||||
void desktop_animation_free(DesktopAnimation*);
|
||||
void desktop_animation_activate(DesktopAnimation* instance);
|
||||
void desktop_animation_set_animation_changed_callback(
|
||||
DesktopAnimation* instance,
|
||||
AnimationChangedCallback callback,
|
||||
void* context);
|
||||
|
||||
DesktopAnimationState desktop_animation_handle_right(DesktopAnimation* animation);
|
||||
|
||||
void desktop_animation_start_oneshot_levelup(DesktopAnimation* animation);
|
||||
|
||||
const Icon* desktop_animation_get_animation(DesktopAnimation* animation);
|
||||
const Icon* desktop_animation_get_oneshot_frame(DesktopAnimation* animation);
|
||||
|
||||
void desktop_start_new_idle_animation(DesktopAnimation* animation);
|
||||
|
Reference in New Issue
Block a user