summaryrefslogtreecommitdiff
path: root/lib/nes/app/action.hh
diff options
context:
space:
mode:
Diffstat (limited to 'lib/nes/app/action.hh')
-rw-r--r--lib/nes/app/action.hh13
1 files changed, 12 insertions, 1 deletions
diff --git a/lib/nes/app/action.hh b/lib/nes/app/action.hh
index ed879f3..c88a5f1 100644
--- a/lib/nes/app/action.hh
+++ b/lib/nes/app/action.hh
@@ -21,11 +21,13 @@ namespace nes::app
confirm_quit,
launch_game,
show_error,
+ prompt_key,
};
private:
type type_{ type::none };
string_view file_name_;
+ string_view key_;
string_view message_;
status error_{ status::success };
@@ -40,10 +42,11 @@ namespace nes::app
static auto cancel_quit() -> action { return action{ type::cancel_quit }; }
static auto confirm_quit() -> action { return action{ type::confirm_quit }; }
- static auto launch_game(string_view const file_name) -> action
+ static auto launch_game(string_view const file_name, string_view const key = "") -> action
{
auto res = action{ type::launch_game };
res.file_name_ = file_name;
+ res.key_ = key;
return res;
}
@@ -55,8 +58,16 @@ namespace nes::app
return res;
}
+ static auto prompt_key(string_view const file_name) -> action
+ {
+ auto res = action{ type::prompt_key };
+ res.file_name_ = file_name;
+ return res;
+ }
+
auto get_type() const -> type { return type_; }
auto get_file_name() const -> string_view { return file_name_; }
+ auto get_key() const -> string_view { return key_; }
auto get_message() const -> string_view { return message_; }
auto get_error() const -> status { return error_; }