1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-02-03 13:01:33 +02:00

Make artifacts worn by commander visible

This commit is contained in:
dydzio 2016-11-03 14:25:17 +01:00
parent aea281a9de
commit 47a72d4441

View File

@ -423,7 +423,7 @@ void CStackWindow::CWindowSection::createCommander()
OBJ_CONSTRUCTION_CAPTURING_ALL;
createBackground("commander-bg");
auto getSkillPos = [&](int index)
auto getSkillPos = [](int index)
{
return Point(10 + 80 * (index%3), 20 + 80 * (index/3));
};
@ -451,7 +451,19 @@ void CStackWindow::CWindowSection::createCommander()
};
}
}
//TODO: commander artifacts
auto getArtifactPos = [](int index)
{
return Point(269 + 47 * (index % 3), 22 + 47 * (index / 3));
};
for (auto equippedArtifact : parent->info->commander->artifactsWorn)
{
Point artPos = getArtifactPos(equippedArtifact.first);
auto icon = new CClickableObject(new CAnimImage("artifact", equippedArtifact.second.artifact.get()->artType.get()->iconIndex, 0, artPos.x, artPos.y), [=] {});
//TODO: Use CArtPlace or equivalent instead of CClickableObject and handle commander artifact actions to match WOG (return artifact to hero etc.)
}
}
CIntObject * CStackWindow::createSkillEntry(int index)