AdventureMapShortcuts.h 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. /*
  2. * AdventureMapShortcuts.h, part of VCMI engine
  3. *
  4. * Authors: listed in file AUTHORS in main folder
  5. *
  6. * License: GNU General Public License v2.0 or later
  7. * Full text of license available in license.txt file, in main folder
  8. *
  9. */
  10. #pragma once
  11. VCMI_LIB_NAMESPACE_BEGIN
  12. class Point;
  13. class Rect;
  14. VCMI_LIB_NAMESPACE_END
  15. enum class EShortcut;
  16. class AdventureMapInterface;
  17. enum class EAdventureState;
  18. struct AdventureMapShortcutState
  19. {
  20. EShortcut shortcut;
  21. bool isEnabled;
  22. std::function<void()> callback;
  23. };
  24. /// Class that contains list of functions for shortcuts available from adventure map
  25. class AdventureMapShortcuts
  26. {
  27. AdventureMapInterface & owner;
  28. EAdventureState state;
  29. int mapLevel;
  30. void showOverview();
  31. void worldViewBack();
  32. void worldViewScale1x();
  33. void worldViewScale2x();
  34. void worldViewScale4x();
  35. void switchMapLevel();
  36. void showQuestlog();
  37. void toggleTrackHero();
  38. void toggleGrid();
  39. void toggleVisitable();
  40. void toggleBlocked();
  41. void toggleSleepWake();
  42. void setHeroSleeping();
  43. void setHeroAwake();
  44. void moveHeroAlongPath();
  45. void showSpellbook();
  46. void adventureOptions();
  47. void systemOptions();
  48. void firstHero();
  49. void nextHero();
  50. void endTurn();
  51. void showThievesGuild();
  52. void showScenarioInfo();
  53. void toMainMenu();
  54. void newGame();
  55. void quitGame();
  56. void saveGame();
  57. void loadGame();
  58. void digGrail();
  59. void viewPuzzleMap();
  60. void restartGame();
  61. void visitObject();
  62. void openObject();
  63. void showMarketplace();
  64. void firstTown();
  65. void nextTown();
  66. void nextObject();
  67. void zoom( int distance);
  68. void search();
  69. void moveHeroDirectional(const Point & direction);
  70. public:
  71. explicit AdventureMapShortcuts(AdventureMapInterface & owner);
  72. std::vector<AdventureMapShortcutState> getShortcuts();
  73. bool optionCanViewQuests();
  74. bool optionCanToggleLevel();
  75. bool optionMapLevelSurface();
  76. bool optionHeroSleeping();
  77. bool optionHeroAwake();
  78. bool optionHeroSelected();
  79. bool optionHeroCanMove();
  80. bool optionHasNextHero();
  81. bool optionCanVisitObject();
  82. bool optionCanEndTurn();
  83. bool optionSpellcasting();
  84. bool optionInMapView();
  85. bool optionInWorldView();
  86. bool optionSidePanelActive();
  87. bool optionMapScrollingActive();
  88. bool optionMapViewActive();
  89. void setState(EAdventureState newState);
  90. EAdventureState getState() const;
  91. void onMapViewMoved(const Rect & visibleArea, int mapLevel);
  92. };