summaryrefslogtreecommitdiff
path: root/lib/nes/app/ui/screen-title.hh
diff options
context:
space:
mode:
Diffstat (limited to 'lib/nes/app/ui/screen-title.hh')
-rw-r--r--lib/nes/app/ui/screen-title.hh19
1 files changed, 15 insertions, 4 deletions
diff --git a/lib/nes/app/ui/screen-title.hh b/lib/nes/app/ui/screen-title.hh
index 2ebc78a..6384c3e 100644
--- a/lib/nes/app/ui/screen-title.hh
+++ b/lib/nes/app/ui/screen-title.hh
@@ -1,10 +1,11 @@
#pragma once
#include "nes/app/ui/screen.hh"
+#include "nes/app/ui/selection.hh"
namespace nes::app
{
- class input_manager;
+ class input_device_keyboard;
/// The main title screen for the emulator, used as an entrypoint for the UI.
///
@@ -18,11 +19,21 @@ namespace nes::app
help,
};
- input_manager& input_manager_;
- item selected_item_{ item::load_game };
+ class selection_impl final : public selection<item, 3>
+ {
+ public:
+ using selection::selection;
+
+ protected:
+ auto render_item(renderer&, item const&, i32 x, i32 y, u32 width, color) const -> void override;
+ auto load_page(item(&)[3], u32 page) -> u32 override;
+ };
+
+ input_device_keyboard& keyboard_;
+ selection_impl selection_{ 10, 16, 11 };
public:
- explicit screen_title(input_manager&);
+ explicit screen_title(input_device_keyboard&);
auto render(renderer&) -> void override;
auto process_events() -> action override;