Dolphin_srv timestamp and butthurt; Desktop_srv refactoring (#750)
* dolphin_srv: save timestamp on deed; desktop_srv minor refactoring * dolphin_srv timegated butthurt increse, desktop refactoring * desktop app: update debug screen * remove debug logging * increasing icounter affects butthurt value * Dolphin: correct error message on DolphinStore load Co-authored-by: Aleksandr Kutuzov <alleteam@gmail.com>
This commit is contained in:
26
applications/desktop/helpers/desktop_animation.c
Normal file
26
applications/desktop/helpers/desktop_animation.c
Normal file
@@ -0,0 +1,26 @@
|
||||
#include "desktop_animation.h"
|
||||
|
||||
static const Icon* idle_scenes[] = {&A_Wink_128x64, &A_WatchingTV_128x64};
|
||||
|
||||
const Icon* desktop_get_icon() {
|
||||
uint8_t new = 0;
|
||||
|
||||
#if 0
|
||||
// checking dolphin state here to choose appropriate animation
|
||||
|
||||
Dolphin* dolphin = furi_record_open("dolphin");
|
||||
DolphinStats stats = dolphin_stats(dolphin);
|
||||
float timediff = fabs(difftime(stats.timestamp, dolphin_state_timestamp()));
|
||||
|
||||
FURI_LOG_I("desktop-animation", "background change");
|
||||
FURI_LOG_I("desktop-animation", "icounter: %d", stats.icounter);
|
||||
FURI_LOG_I("desktop-animation", "butthurt: %d", stats.butthurt);
|
||||
FURI_LOG_I("desktop-animation", "time since deeed: %.0f", timediff);
|
||||
#endif
|
||||
|
||||
if((random() % 100) > 50) { // temp rnd selection
|
||||
new = random() % COUNT_OF(idle_scenes);
|
||||
}
|
||||
|
||||
return idle_scenes[new];
|
||||
}
|
10
applications/desktop/helpers/desktop_animation.h
Normal file
10
applications/desktop/helpers/desktop_animation.h
Normal file
@@ -0,0 +1,10 @@
|
||||
#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"
|
||||
|
||||
const Icon* desktop_get_icon();
|
Reference in New Issue
Block a user