AdventureMapShortcuts.h 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  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. std::string searchLast;
  31. int searchPos;
  32. void showOverview();
  33. void worldViewBack();
  34. void worldViewScale1x();
  35. void worldViewScale2x();
  36. void worldViewScale4x();
  37. void switchMapLevel();
  38. void showQuestlog();
  39. void toggleTrackHero();
  40. void toggleGrid();
  41. void toggleVisitable();
  42. void toggleBlocked();
  43. void toggleSleepWake();
  44. void setHeroSleeping();
  45. void setHeroAwake();
  46. void moveHeroAlongPath();
  47. void showSpellbook();
  48. void adventureOptions();
  49. void systemOptions();
  50. void firstHero();
  51. void nextHero();
  52. void endTurn();
  53. void showThievesGuild();
  54. void showScenarioInfo();
  55. void toMainMenu();
  56. void newGame();
  57. void quitGame();
  58. void saveGame();
  59. void loadGame();
  60. void digGrail();
  61. void viewPuzzleMap();
  62. void restartGame();
  63. void visitObject();
  64. void openObject();
  65. void showMarketplace();
  66. void firstTown();
  67. void nextTown();
  68. void nextObject();
  69. void zoom( int distance);
  70. void search(bool next);
  71. void moveHeroDirectional(const Point & direction);
  72. public:
  73. explicit AdventureMapShortcuts(AdventureMapInterface & owner);
  74. std::vector<AdventureMapShortcutState> getShortcuts();
  75. bool optionCanViewQuests();
  76. bool optionCanToggleLevel();
  77. bool optionMapLevelSurface();
  78. bool optionHeroSleeping();
  79. bool optionHeroAwake();
  80. bool optionHeroSelected();
  81. bool optionHeroCanMove();
  82. bool optionHasNextHero();
  83. bool optionCanVisitObject();
  84. bool optionCanEndTurn();
  85. bool optionSpellcasting();
  86. bool optionInMapView();
  87. bool optionInWorldView();
  88. bool optionSidePanelActive();
  89. bool optionMapScrollingActive();
  90. bool optionMapViewActive();
  91. void setState(EAdventureState newState);
  92. EAdventureState getState() const;
  93. void onMapViewMoved(const Rect & visibleArea, int mapLevel);
  94. };