|
|
@@ -97,6 +97,8 @@ std::vector<AdventureMapShortcutState> AdventureMapShortcuts::getShortcuts()
|
|
|
{ EShortcut::ADVENTURE_SAVE_GAME, optionInMapView(), [this]() { this->saveGame(); } },
|
|
|
{ EShortcut::ADVENTURE_NEW_GAME, optionInMapView(), [this]() { this->newGame(); } },
|
|
|
{ EShortcut::ADVENTURE_LOAD_GAME, optionInMapView(), [this]() { this->loadGame(); } },
|
|
|
+ { EShortcut::ADVENTURE_QUICK_SAVE, optionIsLocal(), [this]() { this->quickSaveGame(); } },
|
|
|
+ { EShortcut::ADVENTURE_QUICK_LOAD, optionIsLocal(), [this]() { this->quickLoadGame(); } },
|
|
|
{ EShortcut::ADVENTURE_RESTART_GAME, optionInMapView(), [this]() { this->restartGame(); } },
|
|
|
{ EShortcut::ADVENTURE_DIG_GRAIL, optionHeroDig(), [this]() { this->digGrail(); } },
|
|
|
{ EShortcut::ADVENTURE_VIEW_PUZZLE, optionSidePanelActive(),[this]() { this->viewPuzzleMap(); } },
|
|
|
@@ -374,6 +376,16 @@ void AdventureMapShortcuts::loadGame()
|
|
|
GAME->interface()->proposeLoadingGame();
|
|
|
}
|
|
|
|
|
|
+void AdventureMapShortcuts::quickSaveGame()
|
|
|
+{
|
|
|
+ GAME->interface()->quickSaveGame();
|
|
|
+}
|
|
|
+
|
|
|
+void AdventureMapShortcuts::quickLoadGame()
|
|
|
+{
|
|
|
+ GAME->interface()->proposeQuickLoadingGame();
|
|
|
+}
|
|
|
+
|
|
|
void AdventureMapShortcuts::digGrail()
|
|
|
{
|
|
|
const CGHeroInstance *h = GAME->interface()->localState->getCurrentHero();
|
|
|
@@ -691,3 +703,18 @@ bool AdventureMapShortcuts::optionViewStatistic()
|
|
|
auto day = GAME->interface()->cb->getDate(Date::DAY);
|
|
|
return optionInMapView() && day > 1;
|
|
|
}
|
|
|
+
|
|
|
+bool AdventureMapShortcuts::optionIsLocal()
|
|
|
+{
|
|
|
+ if (!optionInMapView() || !GAME->server().isHost() || !(GAME->server().serverMode == EServerMode::LOCAL))
|
|
|
+ return false;
|
|
|
+
|
|
|
+ //exclude local multiplayer games (hot seat is ok)
|
|
|
+ auto hostClientId = GAME->server().hostClientId;
|
|
|
+ for(const auto& playerName : GAME->server().playerNames)
|
|
|
+ {
|
|
|
+ if(playerName.second.connection != hostClientId)
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ return true;
|
|
|
+}
|