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:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user