Open Source Tomb Raider Engine
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

Menu.h 1.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. /*!
  2. * \file include/Menu.h
  3. * \brief Menu 'overlay'
  4. *
  5. * \author xythobuz
  6. */
  7. #ifndef _MENU_H_
  8. #define _MENU_H_
  9. #include <functional>
  10. #include <memory>
  11. #include "utils/Folder.h"
  12. /*!
  13. * \brief Menu 'overlay'
  14. */
  15. class Menu {
  16. public:
  17. /*!
  18. * \brief Constructs an object of Menu
  19. */
  20. Menu();
  21. /*!
  22. * \brief Deconstructs an object of Menu
  23. */
  24. ~Menu();
  25. int initialize();
  26. int initialize(std::string folder);
  27. int initialize(Folder *folder);
  28. void setVisible(bool visible);
  29. bool isVisible();
  30. void display();
  31. void handleKeyboard(KeyboardButton key, bool pressed);
  32. void handleMouseClick(unsigned int x, unsigned int y, KeyboardButton button, bool released);
  33. void handleMouseScroll(int xrel, int yrel);
  34. private:
  35. void loadOrOpen();
  36. void showDialog(std::string msg, std::string btn1, std::string btn2,
  37. std::function<int (bool state)> callback = std::function<int (bool)>());
  38. void ackDialog();
  39. void displayDialog();
  40. bool mVisible;
  41. long mCursor;
  42. long mMin;
  43. Folder *mapFolder;
  44. bool hiddenState;
  45. std::string dialogText;
  46. std::string dialogButton1;
  47. std::string dialogButton2;
  48. bool dialogState;
  49. std::function<int (bool state)> dialogFunction;
  50. };
  51. Menu &getMenu();
  52. #endif