Ddesktop service and events cleanup

This commit is contained in:
Willy-JL
2023-06-27 19:57:31 +02:00
parent 3ff34c1de7
commit f780b832ad
7 changed files with 13 additions and 37 deletions

View File

@@ -15,15 +15,8 @@
#define ANIMATION_META_FILE "meta.txt"
#define BASE_ANIMATION_DIR EXT_PATH("dolphin")
#define TAG "AnimationStorage"
/* Unused old code, for safe-keeping
#define ANIMATION_MANIFEST_FILE ANIMATION_DIR "/manifest.txt"
*/
// 59 Max length = strlen("/ext/dolphin_custom//Anims") + XTREME_ASSETS_PACK_NAME_LEN + 1 (Null terminator)
char ANIMATION_DIR[59];
// 72 Max length = ANIMATION_DIR + strlen("/manifest.txt")
char ANIMATION_MANIFEST_FILE[72];
char ANIMATION_DIR[26 /*"/ext/dolphin_custom//Anims"*/ + XTREME_ASSETS_PACK_NAME_LEN + 1];
char ANIMATION_MANIFEST_FILE[sizeof(ANIMATION_DIR) + 13 /*"/manifest.txt"*/];
static void animation_storage_free_bubbles(BubbleAnimation* animation);
static void animation_storage_free_frames(BubbleAnimation* animation);
@@ -43,6 +36,7 @@ void animation_handler_select_manifest() {
if(storage_common_stat(storage, furi_string_get_cstr(manifest), NULL) == FSE_OK) {
FURI_LOG_I(TAG, "Custom manifest selected");
} else {
FURI_LOG_E(TAG, "Custom manifest does not exist!");
use_asset_pack = false;
}
furi_record_close(RECORD_STORAGE);

View File

@@ -12,7 +12,6 @@
#include <input/input.h>
#include <stdint.h>
#include <core/dangerous_defines.h>
#include <loader/loader.h>
#define ACTIVE_SHIFT 2
@@ -129,15 +128,11 @@ static bool bubble_animation_input_callback(InputEvent* event, void* context) {
if(event->key == InputKeyRight) {
/* Right button reserved for animation activation, so consume */
consumed = true;
if(event->type == InputTypeShort) {
if(animation_view->interact_callback) {
consumed = true;
animation_view->interact_callback(animation_view->interact_callback_context);
}
} else if(event->type == InputTypeLong) {
Loader* loader = furi_record_open(RECORD_LOADER);
loader_start(loader, "Power", "about_battery", NULL);
furi_record_close(RECORD_LOADER);
}
}

View File

@@ -6,7 +6,6 @@
#include <gui/view.h>
#include <gui/icon_i.h>
#include <stdint.h>
#include <loader/loader.h>
typedef void (*OneShotInteractCallback)(void*);
@@ -66,15 +65,11 @@ static bool one_shot_view_input(InputEvent* event, void* context) {
if(!consumed) {
if(event->key == InputKeyRight) {
/* Right button reserved for animation activation, so consume */
consumed = true;
if(event->type == InputTypeShort) {
if(view->interact_callback) {
consumed = true;
view->interact_callback(view->interact_callback_context);
}
} else if(event->type == InputTypeLong) {
Loader* loader = furi_record_open(RECORD_LOADER);
loader_start(loader, "Power", "about_battery", NULL);
furi_record_close(RECORD_LOADER);
}
}
}