summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorkdx <kdx@42l.fr>2023-01-20 04:33:02 +0100
committerkdx <kdx@42l.fr>2023-01-20 04:33:02 +0100
commit3731cdb6702ff382b0b756fce09d5c3cb0625737 (patch)
tree02c3535de4aae778af870a6f141907ac78a01cf6
parentc7849ff44b237bb8b7a8576569ede1f7576086ea (diff)
download005-3731cdb6702ff382b0b756fce09d5c3cb0625737.tar.gz
be less stupid
-rw-r--r--Menu.cpp5
-rw-r--r--Table.cpp5
2 files changed, 5 insertions, 5 deletions
diff --git a/Menu.cpp b/Menu.cpp
index 688f7e0..1fd8fa5 100644
--- a/Menu.cpp
+++ b/Menu.cpp
@@ -1,6 +1,7 @@
#include "Menu.hpp"
#include "lzr.h"
#include "cfg.hpp"
+#include "input.h"
#include <stdlib.h>
Menu::Menu() : _was_down(false), _hovered(-1), _selected(1)
@@ -9,6 +10,10 @@ Menu::Menu() : _was_down(false), _hovered(-1), _selected(1)
void Menu::update(const Cursor &cursor)
{
+ if (input_pressed(K_O)) {
+ _selected += 1;
+ _selected %= _entries;
+ }
if (cursor.x < 0 || cursor.x >= CFG_DWIDTH ||
cursor.y < _ybegin || cursor.y > _yend) {
_hovered = -1;
diff --git a/Table.cpp b/Table.cpp
index a209b13..674f106 100644
--- a/Table.cpp
+++ b/Table.cpp
@@ -3,7 +3,6 @@
#include "cfg.hpp"
#include "util.hpp"
#include "lzr.h"
-#include "input.h"
#include <stdlib.h>
Table::Table() : _notes(), _strength(), _edited(-1), _layer(0)
@@ -25,10 +24,6 @@ void Table::update(const Cursor& cursor)
}
}
}
- if (input_pressed(K_O)) {
- _layer += 1;
- _layer %= _depth;
- }
_hovered = -1;
if (cursor.y < 0)
return;