[FL-1181] Archive app (#458)
* fix stack size, file listing works * fix scrollbar, update docs * cut long filenames * Dolphin: overhaul unlocking logic, unlocked message added * furi - added common_defines.h, minor macro cleanup; fix scrollbar type conversion * remove door opening animation * adaptive long file name shortening, item icons, invert selection * archive: browser tab, file types (beta); scenes: fix sleep emote * dont trim unknown extensions * fix string_size usage * array container for file list, fixes * better path handling * archive: renaming, adding to favorites worksl scrollbar fix: limit min bar height to 1px to prevent disappearance on large lists Co-authored-by: あく <alleteam@gmail.com>
This commit is contained in:
@@ -4,22 +4,6 @@
|
||||
#include <gui/gui_i.h>
|
||||
#include <u8g2/u8g2.h>
|
||||
|
||||
#ifndef ARRSIZE
|
||||
#define ARRSIZE(arr) (sizeof(arr) / sizeof(arr[0]))
|
||||
#endif
|
||||
|
||||
#ifndef MAX
|
||||
#define MAX(x, y) (((x) > (y)) ? (x) : (y))
|
||||
#endif
|
||||
|
||||
#ifndef MIN
|
||||
#define MIN(x, y) (((x) < (y)) ? (x) : (y))
|
||||
#endif
|
||||
|
||||
#ifndef CLAMP
|
||||
#define CLAMP(x, upper, lower) (MIN(upper, MAX(x, lower)))
|
||||
#endif
|
||||
|
||||
// global
|
||||
#define SCALE 32
|
||||
// screen
|
||||
|
@@ -66,7 +66,7 @@ void dolphin_scene_update_state(SceneState* state, uint32_t t, uint32_t dt) {
|
||||
state->player_flipped = false;
|
||||
if(state->action_timeout == 0) {
|
||||
scene_proceed_action(state);
|
||||
state->emote_id = roll_new(state->previous_emote, ARRSIZE(emotes_list));
|
||||
state->emote_id = roll_new(state->previous_emote, SIZEOF_ARRAY(emotes_list));
|
||||
break;
|
||||
}
|
||||
case INTERACT:
|
||||
|
@@ -37,17 +37,14 @@ static void scene_draw_sleep_emote(SceneState* state, Canvas* canvas) {
|
||||
furi_assert(state);
|
||||
furi_assert(canvas);
|
||||
|
||||
char dialog_str[] = "zZzZ...";
|
||||
char buf[64];
|
||||
char dialog_str[] = "zZzZ..";
|
||||
// 2do - sofa x pos getter
|
||||
if(state->player_global.x == 154 && state->action_timeout % 100 < 30) {
|
||||
if(state->player_global.x == 154 && state->action_timeout % 100 < 50) {
|
||||
if(state->dialog_progress < strlen(dialog_str)) {
|
||||
if(state->action_timeout % 5 == 0) state->dialog_progress++;
|
||||
dialog_str[state->dialog_progress] = '\0';
|
||||
snprintf(buf, state->dialog_progress, dialog_str);
|
||||
// bubble vs just text?
|
||||
//elements_multiline_text_framed(canvas, 80, 20, buf);
|
||||
canvas_draw_str(canvas, 80, 20, buf);
|
||||
if(state->action_timeout % 10 == 0) state->dialog_progress++;
|
||||
|
||||
dialog_str[state->dialog_progress + 1] = '\0';
|
||||
canvas_draw_str(canvas, 80, 20, dialog_str);
|
||||
}
|
||||
|
||||
} else {
|
||||
@@ -83,6 +80,25 @@ static void draw_idle_emote(SceneState* state, Canvas* canvas){
|
||||
}
|
||||
*/
|
||||
|
||||
static void draw_idle_emote(SceneState* state, Canvas* canvas) {
|
||||
furi_assert(state);
|
||||
furi_assert(canvas);
|
||||
|
||||
char dialog_str[] = "...";
|
||||
|
||||
if(state->action_timeout % 100 < 50) {
|
||||
if(state->dialog_progress < strlen(dialog_str)) {
|
||||
if(state->action_timeout % 10 == 0) state->dialog_progress++;
|
||||
|
||||
dialog_str[state->dialog_progress + 1] = '\0';
|
||||
canvas_draw_str(canvas, 70, 15, dialog_str);
|
||||
}
|
||||
|
||||
} else {
|
||||
state->dialog_progress = 0;
|
||||
}
|
||||
}
|
||||
|
||||
void dolphin_scene_render_dolphin(SceneState* state, Canvas* canvas) {
|
||||
furi_assert(state);
|
||||
furi_assert(canvas);
|
||||
@@ -190,8 +206,6 @@ void dolphin_scene_render_state(SceneState* state, Canvas* canvas) {
|
||||
scene_activate_item_callback(state, canvas);
|
||||
else if(state->action == SLEEP)
|
||||
scene_draw_sleep_emote(state, canvas);
|
||||
/*
|
||||
else if(state->action == IDLE)
|
||||
draw_idle_emote(state, canvas);
|
||||
*/
|
||||
}
|
Reference in New Issue
Block a user