summary refs log tree commit diff stats
path: root/src/menu.h
diff options
context:
space:
mode:
authorStar Rauchenberger <fefferburbia@gmail.com>2021-03-13 11:34:59 -0500
committerStar Rauchenberger <fefferburbia@gmail.com>2021-03-13 15:34:50 -0500
commit10c92d7f54759d9356ac948f6d019a82e40e3f4d (patch)
treed31fed66978bc8a97cacbced7e40e146a6200cc4 /src/menu.h
parent37bbad70090071a473a04583e373491557906699 (diff)
downloadtanetane-10c92d7f54759d9356ac948f6d019a82e40e3f4d.tar.gz
tanetane-10c92d7f54759d9356ac948f6d019a82e40e3f4d.tar.bz2
tanetane-10c92d7f54759d9356ac948f6d019a82e40e3f4d.zip
Added pause menu open and close sound
#7
Diffstat (limited to 'src/menu.h')
-rw-r--r--src/menu.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/menu.h b/src/menu.h index 967b384..528f8c8 100644 --- a/src/menu.h +++ b/src/menu.h
@@ -16,6 +16,7 @@ struct MenuItem {
16 MenuType type = MenuType::Command; 16 MenuType type = MenuType::Command;
17 std::string text; 17 std::string text;
18 std::function<void(Game&)> activationFunction; 18 std::function<void(Game&)> activationFunction;
19 bool playSfx = false;
19}; 20};
20 21
21class MenuBuilder { 22class MenuBuilder {
@@ -24,6 +25,7 @@ public:
24 MenuBuilder& Command(std::string text) { 25 MenuBuilder& Command(std::string text) {
25 result_.type = MenuType::Command; 26 result_.type = MenuType::Command;
26 result_.text = std::move(text); 27 result_.text = std::move(text);
28 result_.playSfx = true;
27 return *this; 29 return *this;
28 } 30 }
29 31
@@ -32,6 +34,11 @@ public:
32 return *this; 34 return *this;
33 } 35 }
34 36
37 MenuBuilder& SkipSoundEffect() {
38 result_.playSfx = false;
39 return *this;
40 }
41
35 MenuItem Build() const { 42 MenuItem Build() const {
36 return result_; 43 return result_;
37 } 44 }