AdventureMapShortcuts.h 2.0 KB

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