1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-27 22:49:25 +02:00

UI now shows spell range from config

This commit is contained in:
Ivan Savenko
2025-07-10 17:27:27 +03:00
parent 79f3126c63
commit 5ada2d19e1
16 changed files with 44 additions and 40 deletions

View File

@@ -515,7 +515,6 @@ void AdventureMapInterface::onTileLeftClicked(const int3 &targetPosition)
if(spellBeingCasted)
{
assert(shortcuts->optionSpellcasting());
assert(spellBeingCasted->id == SpellID::SCUTTLE_BOAT || spellBeingCasted->id == SpellID::DIMENSION_DOOR);
if(isValidAdventureSpellTarget(targetPosition))
performSpellcasting(targetPosition);
@@ -839,11 +838,8 @@ void AdventureMapInterface::onTileRightClicked(const int3 &mapPos)
void AdventureMapInterface::enterCastingMode(const CSpell * sp)
{
assert(sp->id == SpellID::SCUTTLE_BOAT || sp->id == SpellID::DIMENSION_DOOR);
spellBeingCasted = sp;
Settings config = settings.write["session"]["showSpellRange"];
config->Bool() = true;
GAME->interface()->localState->setCurrentSpell(sp->id);
setState(EAdventureState::CASTING_SPELL);
}
@@ -852,9 +848,7 @@ void AdventureMapInterface::exitCastingMode()
assert(spellBeingCasted);
spellBeingCasted = nullptr;
setState(EAdventureState::MAKING_TURN);
Settings config = settings.write["session"]["showSpellRange"];
config->Bool() = false;
GAME->interface()->localState->setCurrentSpell(SpellID::NONE);
}
void AdventureMapInterface::hotkeyAbortCastingMode()