mirror of
https://github.com/Next-Flip/Momentum-Firmware.git
synced 2026-05-12 15:38:36 -07:00
The nightmare begins, lol
This commit is contained in:
@@ -94,12 +94,6 @@ void animation_manager_set_interact_callback(
|
||||
animation_manager->interact_callback = callback;
|
||||
}
|
||||
|
||||
void animation_manager_set_sfw_mode_state(AnimationManager* animation_manager, bool enabled) {
|
||||
furi_assert(animation_manager);
|
||||
animation_manager->sfw_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;
|
||||
|
||||
@@ -368,9 +362,8 @@ static bool animation_manager_is_valid_idle_animation(
|
||||
|
||||
static StorageAnimation*
|
||||
animation_manager_select_idle_animation(AnimationManager* animation_manager) {
|
||||
if(animation_manager->sfw_mode) {
|
||||
return animation_storage_find_animation(HARDCODED_ANIMATION_NAME);
|
||||
}
|
||||
UNUSED(animation_manager);
|
||||
|
||||
StorageAnimationList_t animation_list;
|
||||
StorageAnimationList_init(animation_list);
|
||||
animation_storage_fill_animation_list(&animation_list);
|
||||
|
||||
@@ -156,12 +156,4 @@ void animation_manager_unload_and_stall_animation(AnimationManager* animation_ma
|
||||
*
|
||||
* @animation_manager instance
|
||||
*/
|
||||
void animation_manager_load_and_continue_animation(AnimationManager* animation_manager);
|
||||
|
||||
/**
|
||||
* Enable or disable dummy mode backgrounds of animation manager.
|
||||
*
|
||||
* @animation_manager instance
|
||||
* @enabled bool
|
||||
*/
|
||||
void animation_manager_set_sfw_mode_state(AnimationManager* animation_manager, bool enabled);
|
||||
void animation_manager_load_and_continue_animation(AnimationManager* animation_manager);
|
||||
@@ -11,22 +11,43 @@
|
||||
#include "animation_storage_i.h"
|
||||
#include <assets_dolphin_internal.h>
|
||||
#include <assets_dolphin_blocking.h>
|
||||
|
||||
#include "../../../settings/desktop_settings/desktop_settings_app.h"
|
||||
#define ANIMATION_META_FILE "meta.txt"
|
||||
#define ANIMATION_DIR EXT_PATH("dolphin")
|
||||
#define ANIMATION_MANIFEST_FILE ANIMATION_DIR "/manifest.txt"
|
||||
#define TAG "AnimationStorage"
|
||||
/* Unused old code, for safe-keeping
|
||||
|
||||
#define ANIMATION_MANIFEST_FILE ANIMATION_DIR "/manifest.txt"
|
||||
|
||||
*/
|
||||
char ANIMATION_MANIFEST_FILE[30];
|
||||
|
||||
static void animation_storage_free_bubbles(BubbleAnimation* animation);
|
||||
static void animation_storage_free_frames(BubbleAnimation* animation);
|
||||
static void animation_storage_free_animation(BubbleAnimation** storage_animation);
|
||||
static BubbleAnimation* animation_storage_load_animation(const char* name);
|
||||
|
||||
void animation_handler_beta()
|
||||
{
|
||||
DesktopSettings* settings = malloc(sizeof(DesktopSettings));
|
||||
DESKTOP_SETTINGS_LOAD(settings);
|
||||
|
||||
if (settings->sfw_mode) {
|
||||
snprintf(ANIMATION_MANIFEST_FILE, sizeof(ANIMATION_DIR), "%s", ANIMATION_DIR);
|
||||
strcat(ANIMATION_MANIFEST_FILE,"/sfw/manifest2.txt");
|
||||
}
|
||||
else {
|
||||
snprintf(ANIMATION_MANIFEST_FILE, sizeof(ANIMATION_DIR), "%s", ANIMATION_DIR);
|
||||
strcat(ANIMATION_MANIFEST_FILE,"/nsfw/manifest.txt");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
static bool animation_storage_load_single_manifest_info(
|
||||
StorageAnimationManifestInfo* manifest_info,
|
||||
const char* name) {
|
||||
furi_assert(manifest_info);
|
||||
|
||||
animation_handler_beta();
|
||||
bool result = false;
|
||||
Storage* storage = furi_record_open(RECORD_STORAGE);
|
||||
FlipperFormat* file = flipper_format_file_alloc(storage);
|
||||
@@ -82,6 +103,7 @@ static bool animation_storage_load_single_manifest_info(
|
||||
void animation_storage_fill_animation_list(StorageAnimationList_t* animation_list) {
|
||||
furi_assert(sizeof(StorageAnimationList_t) == sizeof(void*));
|
||||
furi_assert(!StorageAnimationList_size(*animation_list));
|
||||
animation_handler_beta();
|
||||
|
||||
Storage* storage = furi_record_open(RECORD_STORAGE);
|
||||
FlipperFormat* file = flipper_format_file_alloc(storage);
|
||||
|
||||
@@ -150,8 +150,6 @@ void desktop_unlock(Desktop* desktop) {
|
||||
|
||||
void desktop_set_sfw_mode_state(Desktop* desktop, bool enabled) {
|
||||
view_port_enabled_set(desktop->sfw_mode_icon_viewport, enabled);
|
||||
desktop_main_set_sfw_mode_state(desktop->main_view, enabled);
|
||||
animation_manager_set_sfw_mode_state(desktop->animation_manager, enabled);
|
||||
desktop->settings.sfw_mode = enabled;
|
||||
DESKTOP_SETTINGS_SAVE(&desktop->settings);
|
||||
}
|
||||
@@ -345,8 +343,6 @@ int32_t desktop_srv(void* p) {
|
||||
|
||||
view_port_enabled_set(desktop->sfw_mode_icon_viewport, desktop->settings.sfw_mode);
|
||||
desktop_main_set_sfw_mode_state(desktop->main_view, desktop->settings.sfw_mode);
|
||||
animation_manager_set_sfw_mode_state(
|
||||
desktop->animation_manager, desktop->settings.sfw_mode);
|
||||
|
||||
scene_manager_next_scene(desktop->scene_manager, DesktopSceneMain);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user