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

Cleaned up code of Minimap

This commit is contained in:
Ivan Savenko
2023-02-10 15:29:30 +02:00
parent c5dd8b17d7
commit d0f57fed6f
7 changed files with 196 additions and 222 deletions

View File

@@ -82,13 +82,11 @@ void CQuestMinimap::addQuestMarks (const QuestInfo * q)
else
tile = q->tile;
int x,y;
minimap->tileToPixels (tile, x, y);
Point offset = tileToPixels(tile);
if (level != tile.z)
setLevel(tile.z);
setLevel(tile.z);
auto pic = std::make_shared<CQuestIcon>("VwSymbol.def", 3, x, y);
auto pic = std::make_shared<CQuestIcon>("VwSymbol.def", 3, offset.x, offset.y);
pic->moveBy (Point ( -pic->pos.w/2, -pic->pos.h/2));
pic->callback = std::bind (&CQuestMinimap::iconClicked, this);