From 8d160101eddf3d9f81226e06fcf0d3596f179b98 Mon Sep 17 00:00:00 2001 From: Laserlicht <13953785+Laserlicht@users.noreply.github.com> Date: Wed, 13 Sep 2023 22:49:35 +0200 Subject: [PATCH 1/4] alt mode to select instead of changing path --- client/adventureMap/AdventureMapInterface.cpp | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/client/adventureMap/AdventureMapInterface.cpp b/client/adventureMap/AdventureMapInterface.cpp index 188720cc8..065cd879b 100644 --- a/client/adventureMap/AdventureMapInterface.cpp +++ b/client/adventureMap/AdventureMapInterface.cpp @@ -537,8 +537,13 @@ void AdventureMapInterface::onTileLeftClicked(const int3 &mapPos) } else //remove old path and find a new one if we clicked on accessible tile { - LOCPLINT->localState->setPath(currentHero, mapPos); - onHeroChanged(currentHero); + if(canSelect && GH.isKeyboardCtrlDown()) + LOCPLINT->localState->setSelection(static_cast(topBlocking)); + else + { + LOCPLINT->localState->setPath(currentHero, mapPos); + onHeroChanged(currentHero); + } } } } //end of hero is selected "case" @@ -663,7 +668,12 @@ void AdventureMapInterface::onTileHovered(const int3 &mapPos) if(LOCPLINT->localState->getCurrentArmy() == objAtTile) CCS->curh->set(Cursor::Map::HERO); else - CCS->curh->set(cursorExchange[turns]); + { + if(GH.isKeyboardCtrlDown()) + CCS->curh->set(Cursor::Map::HERO); + else + CCS->curh->set(cursorExchange[turns]); + } } else if(pathNode->layer == EPathfindingLayer::LAND) CCS->curh->set(cursorVisit[turns]); From 6d69326c1a718ebc4fdc1ac434ea5dd8ad22ac00 Mon Sep 17 00:00:00 2001 From: Laserlicht <13953785+Laserlicht@users.noreply.github.com> Date: Wed, 13 Sep 2023 23:43:06 +0200 Subject: [PATCH 2/4] alternative implementation --- client/adventureMap/AdventureMapInterface.cpp | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/client/adventureMap/AdventureMapInterface.cpp b/client/adventureMap/AdventureMapInterface.cpp index 065cd879b..60947eeb0 100644 --- a/client/adventureMap/AdventureMapInterface.cpp +++ b/client/adventureMap/AdventureMapInterface.cpp @@ -537,8 +537,11 @@ void AdventureMapInterface::onTileLeftClicked(const int3 &mapPos) } else //remove old path and find a new one if we clicked on accessible tile { - if(canSelect && GH.isKeyboardCtrlDown()) - LOCPLINT->localState->setSelection(static_cast(topBlocking)); + if(GH.isKeyboardCtrlDown()) + { + if(canSelect) + LOCPLINT->localState->setSelection(static_cast(topBlocking)); + } else { LOCPLINT->localState->setPath(currentHero, mapPos); @@ -616,7 +619,7 @@ void AdventureMapInterface::onTileHovered(const int3 &mapPos) } } - if(LOCPLINT->localState->getCurrentArmy()->ID == Obj::TOWN) + if(LOCPLINT->localState->getCurrentArmy()->ID == Obj::TOWN || GH.isKeyboardCtrlDown()) { if(objAtTile) { @@ -668,12 +671,7 @@ void AdventureMapInterface::onTileHovered(const int3 &mapPos) if(LOCPLINT->localState->getCurrentArmy() == objAtTile) CCS->curh->set(Cursor::Map::HERO); else - { - if(GH.isKeyboardCtrlDown()) - CCS->curh->set(Cursor::Map::HERO); - else - CCS->curh->set(cursorExchange[turns]); - } + CCS->curh->set(cursorExchange[turns]); } else if(pathNode->layer == EPathfindingLayer::LAND) CCS->curh->set(cursorVisit[turns]); From 19693d251dcebd67c71bde6e17ac9e4f69c1833b Mon Sep 17 00:00:00 2001 From: Laserlicht <13953785+Laserlicht@users.noreply.github.com> Date: Thu, 14 Sep 2023 12:49:13 +0200 Subject: [PATCH 3/4] comments --- client/adventureMap/AdventureMapInterface.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/client/adventureMap/AdventureMapInterface.cpp b/client/adventureMap/AdventureMapInterface.cpp index 60947eeb0..fc8288b0a 100644 --- a/client/adventureMap/AdventureMapInterface.cpp +++ b/client/adventureMap/AdventureMapInterface.cpp @@ -535,14 +535,14 @@ void AdventureMapInterface::onTileLeftClicked(const int3 &mapPos) LOCPLINT->moveHero(currentHero, LOCPLINT->localState->getPath(currentHero)); return; } - else //remove old path and find a new one if we clicked on accessible tile + else { - if(GH.isKeyboardCtrlDown()) + if(GH.isKeyboardCtrlDown()) //normal click behaviour (as no hero selected) { if(canSelect) LOCPLINT->localState->setSelection(static_cast(topBlocking)); } - else + else //remove old path and find a new one if we clicked on accessible tile { LOCPLINT->localState->setPath(currentHero, mapPos); onHeroChanged(currentHero); From 714852908e08c0e2fca8f42d01ff75ae782d1e70 Mon Sep 17 00:00:00 2001 From: Laserlicht <13953785+Laserlicht@users.noreply.github.com> Date: Fri, 15 Sep 2023 15:21:14 +0200 Subject: [PATCH 4/4] Documentation --- docs/players/Game_Mechanics.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/docs/players/Game_Mechanics.md b/docs/players/Game_Mechanics.md index c4c045e68..5291c267c 100644 --- a/docs/players/Game_Mechanics.md +++ b/docs/players/Game_Mechanics.md @@ -29,6 +29,9 @@ Some of H3 mechanics can't be straight considered as bug, but default VCMI behav # List of extended game functionality +## Adventure map +- [LCtrl] + LClick – perform a normal click (same as no hero is selected). This make it possible to select other hero instead of changing path of current hero. + ## Quick Army Management - [LShift] + LClick – splits a half units from the selected stack into an empty slot.