AdventureMapShortcuts.h 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  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 toggleSleepWake();
  40. void setHeroSleeping();
  41. void setHeroAwake();
  42. void moveHeroAlongPath();
  43. void showSpellbook();
  44. void adventureOptions();
  45. void systemOptions();
  46. void nextHero();
  47. void endTurn();
  48. void showThievesGuild();
  49. void showScenarioInfo();
  50. void saveGame();
  51. void loadGame();
  52. void digGrail();
  53. void viewPuzzleMap();
  54. void restartGame();
  55. void visitObject();
  56. void openObject();
  57. void showMarketplace();
  58. void nextTown();
  59. void nextObject();
  60. void zoom( int distance);
  61. void moveHeroDirectional(const Point & direction);
  62. public:
  63. explicit AdventureMapShortcuts(AdventureMapInterface & owner);
  64. std::vector<AdventureMapShortcutState> getShortcuts();
  65. bool optionCanViewQuests();
  66. bool optionCanToggleLevel();
  67. bool optionMapLevelSurface();
  68. bool optionHeroSleeping();
  69. bool optionHeroAwake();
  70. bool optionHeroSelected();
  71. bool optionHeroCanMove();
  72. bool optionHasNextHero();
  73. bool optionCanVisitObject();
  74. bool optionCanEndTurn();
  75. bool optionSpellcasting();
  76. bool optionInMapView();
  77. bool optionInWorldView();
  78. bool optionSidePanelActive();
  79. bool optionMapScrollingActive();
  80. bool optionMapViewActive();
  81. void setState(EAdventureState newState);
  82. EAdventureState getState();
  83. void onMapViewMoved(const Rect & visibleArea, int mapLevel);
  84. };