1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-07-17 01:32:21 +02:00

Integrated CClientState into GameEngine class

This commit is contained in:
Ivan Savenko
2025-02-10 22:08:50 +00:00
parent cacceda950
commit f657e85305
51 changed files with 240 additions and 275 deletions

View File

@ -857,19 +857,19 @@ void BattleFieldController::show(Canvas & to)
if (isActive() && isGesturing() && getHoveredHex() != BattleHex::INVALID)
{
auto combatCursorIndex = CCS->curh->get<Cursor::Combat>();
auto combatCursorIndex = ENGINE->cursor().get<Cursor::Combat>();
if (combatCursorIndex)
{
auto combatImageIndex = static_cast<size_t>(*combatCursorIndex);
to.draw(attackCursors->getImage(combatImageIndex), hexPositionAbsolute(getHoveredHex()).center() - CCS->curh->getPivotOffsetCombat(combatImageIndex));
to.draw(attackCursors->getImage(combatImageIndex), hexPositionAbsolute(getHoveredHex()).center() - ENGINE->cursor().getPivotOffsetCombat(combatImageIndex));
return;
}
auto spellCursorIndex = CCS->curh->get<Cursor::Spellcast>();
auto spellCursorIndex = ENGINE->cursor().get<Cursor::Spellcast>();
if (spellCursorIndex)
{
auto spellImageIndex = static_cast<size_t>(*spellCursorIndex);
to.draw(spellCursors->getImage(spellImageIndex), hexPositionAbsolute(getHoveredHex()).center() - CCS->curh->getPivotOffsetSpellcast());
to.draw(spellCursors->getImage(spellImageIndex), hexPositionAbsolute(getHoveredHex()).center() - ENGINE->cursor().getPivotOffsetSpellcast());
return;
}