|
|
@@ -128,6 +128,9 @@ BattleFieldController::BattleFieldController(BattleInterface & owner):
|
|
|
attackCursors = std::make_shared<CAnimation>("CRCOMBAT");
|
|
|
attackCursors->preload();
|
|
|
|
|
|
+ spellCursors = std::make_shared<CAnimation>("CRSPELL");
|
|
|
+ spellCursors->preload();
|
|
|
+
|
|
|
initializeHexEdgeMaskToFrameIndex();
|
|
|
|
|
|
rangedFullDamageLimitImages = std::make_shared<CAnimation>("battle/rangeHighlights/rangeHighlightsGreen.json");
|
|
|
@@ -888,10 +891,22 @@ void BattleFieldController::show(Canvas & to)
|
|
|
|
|
|
if (isActive() && isGesturing() && getHoveredHex() != BattleHex::INVALID)
|
|
|
{
|
|
|
- auto cursorIndex = CCS->curh->get<Cursor::Combat>();
|
|
|
- auto imageIndex = static_cast<size_t>(cursorIndex);
|
|
|
+ auto combatCursorIndex = CCS->curh->get<Cursor::Combat>();
|
|
|
+ if (combatCursorIndex)
|
|
|
+ {
|
|
|
+ auto combatImageIndex = static_cast<size_t>(*combatCursorIndex);
|
|
|
+ to.draw(attackCursors->getImage(combatImageIndex), hexPositionAbsolute(getHoveredHex()).center() - CCS->curh->getPivotOffsetCombat(combatImageIndex));
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ auto spellCursorIndex = CCS->curh->get<Cursor::Spellcast>();
|
|
|
+ if (spellCursorIndex)
|
|
|
+ {
|
|
|
+ auto spellImageIndex = static_cast<size_t>(*spellCursorIndex);
|
|
|
+ to.draw(spellCursors->getImage(spellImageIndex), hexPositionAbsolute(getHoveredHex()).center() - CCS->curh->getPivotOffsetSpellcast());
|
|
|
+ return;
|
|
|
+ }
|
|
|
|
|
|
- to.draw(attackCursors->getImage(imageIndex), hexPositionAbsolute(getHoveredHex()).center() - CCS->curh->getPivotOffsetCombat(imageIndex));
|
|
|
}
|
|
|
}
|
|
|
|