summaryrefslogtreecommitdiff
path: root/client/ui.c
diff options
context:
space:
mode:
authorlonkaars <loek@pipeframe.xyz>2022-06-01 10:02:07 +0200
committerlonkaars <loek@pipeframe.xyz>2022-06-01 10:02:07 +0200
commit35cdecc0134b82d69b120533b091b8e5b58415e1 (patch)
tree6a66f2995f787a109224e3daf8b19ecbbfb3c03b /client/ui.c
parent139651d45a72d57c5147e2854647d95cb87c9e4e (diff)
direct control toy working
Diffstat (limited to 'client/ui.c')
-rw-r--r--client/ui.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/client/ui.c b/client/ui.c
index ca96efb..26e2116 100644
--- a/client/ui.c
+++ b/client/ui.c
@@ -13,7 +13,8 @@
WINDOW *g_w2_ui_win;
unsigned int g_w2_ui_width = 0;
unsigned int g_w2_ui_height = 0;
-void (*g_w2_ui_current_tab)() = &w2_ui_dirc;
+void (*g_w2_ui_current_tab)(bool first) = &w2_ui_dirc;
+void (*g_w2_ui_last_tab)(bool first) = NULL;
void w2_ui_main() {
g_w2_ui_width = getmaxx(g_w2_ui_win);
@@ -25,7 +26,8 @@ void w2_ui_main() {
void w2_ui_paint() {
w2_ui_paint_statusbar();
if (w2_timer_end(W2_TIMER_UPDATE) >= (1000 / W2_UI_UPDATE_FPS)) {
- (*g_w2_ui_current_tab)();
+ (*g_w2_ui_current_tab)(g_w2_ui_last_tab != g_w2_ui_current_tab);
+ g_w2_ui_last_tab = g_w2_ui_current_tab;
w2_timer_start(W2_TIMER_UPDATE);
}
refresh();