[FL-867] GUI: ViewPort arrangement API, better input and draw dispatching (#333)
* Input: refactoring, platform agnostic key configuration, update usage across project. Minor queue usage fixes and tick timings. * Gui: lighter and more efficient input and draw call dispatching, ViewPort rearranging API. View: conditional model updates, API usage update. * BT: smaller update delay * GUI: ViewPort visibility check
This commit is contained in:
@@ -9,12 +9,15 @@ bool dolphin_view_first_start_input(InputEvent* event, void* context) {
|
||||
with_view_model(
|
||||
dolphin->idle_view_first_start, (DolphinViewFirstStartModel * model) {
|
||||
if(model->page > 0) model->page--;
|
||||
return true;
|
||||
});
|
||||
} else if(event->key == InputKeyRight) {
|
||||
uint32_t page;
|
||||
with_view_model(
|
||||
dolphin->idle_view_first_start,
|
||||
(DolphinViewFirstStartModel * model) { page = ++model->page; });
|
||||
dolphin->idle_view_first_start, (DolphinViewFirstStartModel * model) {
|
||||
page = ++model->page;
|
||||
return true;
|
||||
});
|
||||
if(page > 8) {
|
||||
dolphin_save(dolphin);
|
||||
view_dispatcher_switch_to_view(dolphin->idle_view_dispatcher, DolphinViewIdleMain);
|
||||
@@ -140,6 +143,7 @@ void dolphin_task() {
|
||||
dolphin->idle_view_stats, (DolphinViewIdleStatsModel * model) {
|
||||
model->icounter = dolphin_state_get_icounter(dolphin->state);
|
||||
model->butthurt = dolphin_state_get_butthurt(dolphin->state);
|
||||
return true;
|
||||
});
|
||||
|
||||
furi_record_create("dolphin", dolphin);
|
||||
@@ -153,6 +157,7 @@ void dolphin_task() {
|
||||
dolphin->idle_view_stats, (DolphinViewIdleStatsModel * model) {
|
||||
model->icounter = dolphin_state_get_icounter(dolphin->state);
|
||||
model->butthurt = dolphin_state_get_butthurt(dolphin->state);
|
||||
return true;
|
||||
});
|
||||
} else if(event.type == DolphinEventTypeSave) {
|
||||
dolphin_state_save(dolphin->state);
|
||||
|
Reference in New Issue
Block a user