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

Merge branch 'resbar' into merg

This commit is contained in:
Laserlicht
2025-09-28 21:11:51 +02:00
committed by GitHub
6 changed files with 82 additions and 18 deletions

View File

@@ -32,7 +32,7 @@
CResDataBar::CResDataBar(const ImagePath & imageName, const Point & position)
{
addUsedEvents(SHOW_POPUP);
pos.x += position.x;
pos.y += position.y;
@@ -98,9 +98,12 @@ void CResDataBar::setPlayerColor(PlayerColor player)
void CResDataBar::showPopupWindow(const Point & cursorPosition)
{
if((cursorPosition.x - pos.x) > 600)
return;
std::vector<std::shared_ptr<CComponent>> comp;
for (auto & i : LIBRARY->resourceTypeHandler->getAllObjects())
comp.push_back(std::make_shared<CComponent>(ComponentType::RESOURCE, i, GAME->interface()->cb->getResourceAmount(i)));
comp.push_back(std::make_shared<CComponent>(ComponentType::RESOURCE, GameResID(i), GAME->interface()->cb->getResourceAmount(i)));
CRClickPopup::createAndPush(LIBRARY->generaltexth->translate("core.genrltxt.270"), comp);
}