summary refs log tree commit diff stats
path: root/src/menu_system.h
diff options
context:
space:
mode:
authorStar Rauchenberger <fefferburbia@gmail.com>2021-03-13 07:45:55 -0500
committerStar Rauchenberger <fefferburbia@gmail.com>2021-03-13 15:34:50 -0500
commit764efea5a38b970fa57d8c0197673276023b58aa (patch)
tree25aebaa5e62147aaabdfcec6c44d36164d9e6fd7 /src/menu_system.h
parent142e00794097dfb78c4b758a2d39d26fae070092 (diff)
downloadtanetane-764efea5a38b970fa57d8c0197673276023b58aa.tar.gz
tanetane-764efea5a38b970fa57d8c0197673276023b58aa.tar.bz2
tanetane-764efea5a38b970fa57d8c0197673276023b58aa.zip
Added pause menu opening and closing animation
#7
Diffstat (limited to 'src/menu_system.h')
-rw-r--r--src/menu_system.h23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/menu_system.h b/src/menu_system.h index 46963b2..ded57b5 100644 --- a/src/menu_system.h +++ b/src/menu_system.h
@@ -2,6 +2,7 @@
2#define MENU_SYSTEM_H_205861EC 2#define MENU_SYSTEM_H_205861EC
3 3
4#include "system.h" 4#include "system.h"
5#include "interpolation.h"
5 6
6class Game; 7class Game;
7 8
@@ -12,9 +13,31 @@ public:
12 13
13 explicit MenuSystem(Game& game) : game_(game) {} 14 explicit MenuSystem(Game& game) : game_(game) {}
14 15
16 void tick(double dt) override;
17
18 // Commands
19
20 void openPauseMenu();
21
22 void closePauseMenu();
23
24 // Info
25
26 double getPauseAnimationProgress() const { return pauseAnimation_.getProgress(); }
27
28 bool isMenuOpen() const { return openState_ == OpenState::Open; }
29
15private: 30private:
16 31
32 enum class OpenState {
33 Closed,
34 Animating,
35 Open
36 };
37
17 Game& game_; 38 Game& game_;
39 Interpolation pauseAnimation_;
40 OpenState openState_ = OpenState::Closed;
18}; 41};
19 42
20#endif /* end of include guard: MENU_SYSTEM_H_205861EC */ 43#endif /* end of include guard: MENU_SYSTEM_H_205861EC */