From 3731cdb6702ff382b0b756fce09d5c3cb0625737 Mon Sep 17 00:00:00 2001 From: kdx Date: Fri, 20 Jan 2023 04:33:02 +0100 Subject: be less stupid --- Menu.cpp | 5 +++++ Table.cpp | 5 ----- 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 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 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; -- cgit v1.2.3