From 4fe67b36e3bbe6ea5505ed7233c245be9374f0ce Mon Sep 17 00:00:00 2001 From: Hannes Schulze Date: Sun, 2 Feb 2025 20:59:36 +0100 Subject: refactor selection --- lib/nes/app/application.cc | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) (limited to 'lib/nes/app/application.cc') diff --git a/lib/nes/app/application.cc b/lib/nes/app/application.cc index b18e6d6..5f73e01 100644 --- a/lib/nes/app/application.cc +++ b/lib/nes/app/application.cc @@ -28,7 +28,8 @@ namespace nes::app application::application(display& display, input_device_keyboard& keyboard) : display_{ display } , input_manager_{ keyboard } - , screen_title_{ input_manager_ } + , screen_title_{ keyboard } + , screen_browser_{ keyboard } { display_.screen = &screen_title_; } @@ -72,7 +73,19 @@ namespace nes::app { break; } - case action::load_game: + case action::go_to_title: + { + console_.clear(); + display_.screen = &screen_title_; + break; + } + case action::go_to_browser: + { + console_.clear(); + display_.screen = &screen_browser_; + break; + } + case action::launch_game: { auto stream = std::ifstream{ file, std::ios::binary }; if (!stream.good()) -- cgit v1.3.1