aboutsummaryrefslogtreecommitdiff
path: root/src/game_loop/ui.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/game_loop/ui.c')
-rw-r--r--src/game_loop/ui.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/game_loop/ui.c b/src/game_loop/ui.c
index 8980d03..60dbfc2 100644
--- a/src/game_loop/ui.c
+++ b/src/game_loop/ui.c
@@ -50,3 +50,10 @@ void itoa(char *c, int i) {
c[1] = '\0';
}
+void hh_shift_selected(uint8_t *pos, bool dir, uint8_t min, uint8_t max) {
+ if (dir) {
+ *pos = MIN(*pos+1,max);
+ } else {
+ *pos = MAX(*pos-1,min);
+ }
+}