diff options
Diffstat (limited to 'src/menu.h')
-rw-r--r-- | src/menu.h | 7 |
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 | ||
21 | class MenuBuilder { | 22 | class 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 | } |