From 30b4364c772114303d9045677186a53855ea5343 Mon Sep 17 00:00:00 2001 From: Hannes Schulze Date: Thu, 6 Feb 2025 16:28:39 +0100 Subject: implement in-game popups --- lib/nes/app/ui/screen-confirm-quit.hh | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 lib/nes/app/ui/screen-confirm-quit.hh (limited to 'lib/nes/app/ui/screen-confirm-quit.hh') diff --git a/lib/nes/app/ui/screen-confirm-quit.hh b/lib/nes/app/ui/screen-confirm-quit.hh new file mode 100644 index 0000000..c176f4b --- /dev/null +++ b/lib/nes/app/ui/screen-confirm-quit.hh @@ -0,0 +1,24 @@ +#pragma once + +#include "nes/app/ui/screen.hh" + +namespace nes::app +{ + class input_device_keyboard; + + /// A popup asking the user if they really want to quit the game. + class screen_confirm_quit final : public screen + { + input_device_keyboard& keyboard_; + bool confirm_{ false }; + + public: + explicit screen_confirm_quit(input_device_keyboard&); + + auto get_confirm() const -> bool { return confirm_; } + auto set_confirm(bool const v) -> void { confirm_ = v; } + + auto render(renderer&) -> void override; + auto process_events() -> action override; + }; +} // namespace nes::app \ No newline at end of file -- cgit v1.3.1