From b2f0190f6b2a227a21dd4909476171f7cc371a2d Mon Sep 17 00:00:00 2001 From: Star Rauchenberger Date: Sat, 19 Mar 2022 16:46:19 -0400 Subject: menu! --- src/menu.h | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 src/menu.h (limited to 'src/menu.h') diff --git a/src/menu.h b/src/menu.h new file mode 100644 index 0000000..ac72999 --- /dev/null +++ b/src/menu.h @@ -0,0 +1,42 @@ +#ifndef MENU_H_61DBBF6A +#define MENU_H_61DBBF6A + +#include +#include +#include +#include "interpolation.h" + +class Game; + +enum class MenuState { + Closed, + Opening, + Open, + Closing +}; + +struct MenuItem { + std::string text; + std::function activationFunction; +}; + +class Menu { +public: + + Menu(); + + void update(size_t dt, Game& game); + + void open(Game& game); + + MenuState menuState = MenuState::Closed; + Interpolation menuDisplayProgress; + std::vector items; + int cursor = 0; + +private: + + void close(); +}; + +#endif /* end of include guard: MENU_H_61DBBF6A */ -- cgit 1.4.1