2023-05-02 15:09:36 +02:00
|
|
|
/*
|
|
|
|
* AdventureMapShortcuts.h, part of VCMI engine
|
|
|
|
*
|
|
|
|
* Authors: listed in file AUTHORS in main folder
|
|
|
|
*
|
|
|
|
* License: GNU General Public License v2.0 or later
|
|
|
|
* Full text of license available in license.txt file, in main folder
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
VCMI_LIB_NAMESPACE_BEGIN
|
|
|
|
class Point;
|
2023-05-05 14:48:43 +02:00
|
|
|
class Rect;
|
2023-05-02 15:09:36 +02:00
|
|
|
VCMI_LIB_NAMESPACE_END
|
|
|
|
|
|
|
|
enum class EShortcut;
|
2023-05-08 14:18:34 +02:00
|
|
|
class AdventureMapInterface;
|
2023-05-05 14:48:43 +02:00
|
|
|
enum class EAdventureState;
|
2023-05-02 15:09:36 +02:00
|
|
|
|
2023-05-04 18:04:36 +02:00
|
|
|
struct AdventureMapShortcutState
|
|
|
|
{
|
|
|
|
EShortcut shortcut;
|
|
|
|
bool isEnabled;
|
|
|
|
std::function<void()> callback;
|
|
|
|
};
|
|
|
|
|
2023-05-02 15:09:36 +02:00
|
|
|
/// Class that contains list of functions for shortcuts available from adventure map
|
|
|
|
class AdventureMapShortcuts
|
|
|
|
{
|
2023-05-08 14:18:34 +02:00
|
|
|
AdventureMapInterface & owner;
|
2023-05-05 14:48:43 +02:00
|
|
|
EAdventureState state;
|
|
|
|
int mapLevel;
|
2023-05-02 15:09:36 +02:00
|
|
|
|
|
|
|
void showOverview();
|
|
|
|
void worldViewBack();
|
|
|
|
void worldViewScale1x();
|
|
|
|
void worldViewScale2x();
|
|
|
|
void worldViewScale4x();
|
|
|
|
void switchMapLevel();
|
|
|
|
void showQuestlog();
|
2024-04-30 18:10:10 +02:00
|
|
|
void toggleTrackHero();
|
|
|
|
void toggleGrid();
|
2023-05-02 15:09:36 +02:00
|
|
|
void toggleSleepWake();
|
|
|
|
void setHeroSleeping();
|
|
|
|
void setHeroAwake();
|
|
|
|
void moveHeroAlongPath();
|
|
|
|
void showSpellbook();
|
|
|
|
void adventureOptions();
|
|
|
|
void systemOptions();
|
|
|
|
void nextHero();
|
|
|
|
void endTurn();
|
|
|
|
void showThievesGuild();
|
|
|
|
void showScenarioInfo();
|
|
|
|
void saveGame();
|
|
|
|
void loadGame();
|
|
|
|
void digGrail();
|
|
|
|
void viewPuzzleMap();
|
|
|
|
void restartGame();
|
|
|
|
void visitObject();
|
|
|
|
void openObject();
|
|
|
|
void showMarketplace();
|
|
|
|
void nextTown();
|
|
|
|
void nextObject();
|
2023-05-16 22:42:51 +02:00
|
|
|
void zoom( int distance);
|
2023-05-02 15:09:36 +02:00
|
|
|
void moveHeroDirectional(const Point & direction);
|
|
|
|
|
|
|
|
public:
|
2023-05-08 14:18:34 +02:00
|
|
|
explicit AdventureMapShortcuts(AdventureMapInterface & owner);
|
2023-05-02 15:09:36 +02:00
|
|
|
|
2023-05-04 18:04:36 +02:00
|
|
|
std::vector<AdventureMapShortcutState> getShortcuts();
|
|
|
|
|
2023-05-07 00:34:11 +02:00
|
|
|
bool optionCanViewQuests();
|
|
|
|
bool optionCanToggleLevel();
|
2023-05-04 18:04:36 +02:00
|
|
|
bool optionMapLevelSurface();
|
|
|
|
bool optionHeroSleeping();
|
2023-05-05 14:48:43 +02:00
|
|
|
bool optionHeroAwake();
|
2023-05-04 18:04:36 +02:00
|
|
|
bool optionHeroSelected();
|
|
|
|
bool optionHeroCanMove();
|
|
|
|
bool optionHasNextHero();
|
2023-09-19 18:51:31 +02:00
|
|
|
bool optionCanVisitObject();
|
2023-09-19 18:50:07 +02:00
|
|
|
bool optionCanEndTurn();
|
2023-05-04 18:04:36 +02:00
|
|
|
bool optionSpellcasting();
|
2023-05-05 14:48:43 +02:00
|
|
|
bool optionInMapView();
|
|
|
|
bool optionInWorldView();
|
2023-05-07 00:34:11 +02:00
|
|
|
bool optionSidePanelActive();
|
2023-07-26 21:20:11 +02:00
|
|
|
bool optionMapScrollingActive();
|
2023-05-07 00:34:11 +02:00
|
|
|
bool optionMapViewActive();
|
2023-05-05 14:48:43 +02:00
|
|
|
|
|
|
|
void setState(EAdventureState newState);
|
|
|
|
void onMapViewMoved(const Rect & visibleArea, int mapLevel);
|
2023-05-02 15:09:36 +02:00
|
|
|
};
|