responsive ui for not implemented features in lock menu (#648)
Co-authored-by: あく <alleteam@gmail.com>
This commit is contained in:
parent
69f4858168
commit
e1d80d5402
@ -180,6 +180,12 @@ static void lock_menu_callback(void* context, uint8_t index) {
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
|
// wip message
|
||||||
|
with_view_model(
|
||||||
|
dolphin->view_lockmenu, (DolphinViewLockMenuModel * model) {
|
||||||
|
model->hint_timeout = HINT_TIMEOUT_H;
|
||||||
|
return true;
|
||||||
|
});
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -199,6 +205,8 @@ bool dolphin_view_lockmenu_input(InputEvent* event, void* context) {
|
|||||||
|
|
||||||
DolphinViewLockMenuModel* model = view_get_model(dolphin->view_lockmenu);
|
DolphinViewLockMenuModel* model = view_get_model(dolphin->view_lockmenu);
|
||||||
|
|
||||||
|
model->hint_timeout = 0; // clear hint timeout
|
||||||
|
|
||||||
if(event->key == InputKeyUp) {
|
if(event->key == InputKeyUp) {
|
||||||
model->idx = CLAMP(model->idx - 1, 2, 0);
|
model->idx = CLAMP(model->idx - 1, 2, 0);
|
||||||
} else if(event->key == InputKeyDown) {
|
} else if(event->key == InputKeyDown) {
|
||||||
|
@ -63,7 +63,7 @@ void dolphin_view_idle_main_draw(Canvas* canvas, void* model) {
|
|||||||
canvas_draw_icon_animation(canvas, 0, -3, m->animation);
|
canvas_draw_icon_animation(canvas, 0, -3, m->animation);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(m->hint_timeout > 0) {
|
if(m->hint_timeout) {
|
||||||
m->hint_timeout--;
|
m->hint_timeout--;
|
||||||
if(m->locked) {
|
if(m->locked) {
|
||||||
canvas_draw_icon(canvas, 13, 5, &I_LockPopup_100x49);
|
canvas_draw_icon(canvas, 13, 5, &I_LockPopup_100x49);
|
||||||
@ -98,10 +98,19 @@ void dolphin_view_lockmenu_draw(Canvas* canvas, void* model) {
|
|||||||
if(m->door_left_x == -57) {
|
if(m->door_left_x == -57) {
|
||||||
for(uint8_t i = 0; i < 3; ++i) {
|
for(uint8_t i = 0; i < 3; ++i) {
|
||||||
canvas_draw_str_aligned(
|
canvas_draw_str_aligned(
|
||||||
canvas, 64, 13 + (i * 17), AlignCenter, AlignCenter, Lockmenu_Items[i]);
|
canvas,
|
||||||
|
64,
|
||||||
|
13 + (i * 17),
|
||||||
|
AlignCenter,
|
||||||
|
AlignCenter,
|
||||||
|
(m->hint_timeout && m->idx == i) ? "Not implemented" : Lockmenu_Items[i]);
|
||||||
if(m->idx == i) elements_frame(canvas, 15, 5 + (i * 17), 98, 15);
|
if(m->idx == i) elements_frame(canvas, 15, 5 + (i * 17), 98, 15);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(m->hint_timeout) {
|
||||||
|
m->hint_timeout--;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -41,6 +41,8 @@ typedef struct {
|
|||||||
int8_t door_left_x;
|
int8_t door_left_x;
|
||||||
int8_t door_right_x;
|
int8_t door_right_x;
|
||||||
uint8_t exit_timeout;
|
uint8_t exit_timeout;
|
||||||
|
uint8_t hint_timeout;
|
||||||
|
|
||||||
bool locked;
|
bool locked;
|
||||||
} DolphinViewLockMenuModel;
|
} DolphinViewLockMenuModel;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user