AdventureMapShortcuts.h 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  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. #include "../lib/constants/EntityIdentifiers.h"
  12. VCMI_LIB_NAMESPACE_BEGIN
  13. class Point;
  14. class Rect;
  15. VCMI_LIB_NAMESPACE_END
  16. enum class EShortcut;
  17. class AdventureMapInterface;
  18. enum class EAdventureState;
  19. struct AdventureMapShortcutState
  20. {
  21. EShortcut shortcut;
  22. bool isEnabled;
  23. std::function<void()> callback;
  24. };
  25. /// Class that contains list of functions for shortcuts available from adventure map
  26. class AdventureMapShortcuts
  27. {
  28. AdventureMapInterface & owner;
  29. EAdventureState state;
  30. int mapLevel;
  31. std::string searchLast;
  32. int searchPos;
  33. void showOverview();
  34. void worldViewBack();
  35. void worldViewScale1x();
  36. void worldViewScale2x();
  37. void worldViewScale4x();
  38. void viewStatistic();
  39. void switchMapLevel();
  40. void showQuestlog();
  41. void toggleTrackHero();
  42. void toggleGrid();
  43. void toggleVisitable();
  44. void toggleBlocked();
  45. void toggleSleepWake();
  46. void setHeroSleeping();
  47. void setHeroAwake();
  48. void moveHeroAlongPath();
  49. void showSpellbook();
  50. void adventureOptions();
  51. void systemOptions();
  52. void firstHero();
  53. void nextHero();
  54. void endTurn();
  55. void showThievesGuild();
  56. void showScenarioInfo();
  57. void toMainMenu();
  58. void newGame();
  59. void quitGame();
  60. void saveGame();
  61. void loadGame();
  62. void quickSaveGame();
  63. void quickLoadGame();
  64. void digGrail();
  65. void viewPuzzleMap();
  66. void restartGame();
  67. void visitObject();
  68. void openObject();
  69. void showMarketplace();
  70. void firstTown();
  71. void nextTown();
  72. void nextObject();
  73. void zoom( int distance);
  74. void search(bool next);
  75. void moveHeroDirectional(const Point & direction);
  76. public:
  77. explicit AdventureMapShortcuts(AdventureMapInterface & owner);
  78. std::vector<AdventureMapShortcutState> getShortcuts();
  79. bool optionCanViewQuests();
  80. bool optionCanToggleLevel();
  81. int optionMapLevel();
  82. bool optionHeroSleeping();
  83. bool optionHeroAwake();
  84. bool optionHeroSelected();
  85. bool optionHeroCanMove();
  86. bool optionHasNextHero();
  87. bool optionCanVisitObject();
  88. bool optionCanEndTurn();
  89. bool optionSpellcasting();
  90. bool optionInMapView();
  91. bool optionInWorldView();
  92. bool optionSidePanelActive();
  93. bool optionMapScrollingActive();
  94. bool optionMapViewActive();
  95. bool optionMarketplace();
  96. bool optionHeroBoat(EPathfindingLayer layer);
  97. bool optionHeroDig();
  98. bool optionViewStatistic();
  99. bool optionIsLocal();
  100. bool optionQuickSaveLoad();
  101. void setState(EAdventureState newState);
  102. EAdventureState getState() const;
  103. void onMapViewMoved(const Rect & visibleArea, int mapLevel);
  104. };