AdventureMapShortcuts.h 2.5 KB

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