1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-12-26 22:57:00 +02:00

use config

This commit is contained in:
Laserlicht 2023-10-24 18:51:58 +02:00 committed by GitHub
parent b67548e7cf
commit abb279f5b4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 8 deletions

View File

@ -540,6 +540,7 @@ std::shared_ptr<CFilledTexture> InterfaceObjectConfigurable::buildTexture(const
{
auto result = std::make_shared<FilledTexturePlayerColored>(image, rect);
result->playerColored(playerColor);
return result;
}
return std::make_shared<CFilledTexture>(image, rect);
}

View File

@ -403,16 +403,9 @@ TeamAlignments::TeamAlignments(RandomMapTab & randomMapTab)
OBJ_CONSTRUCTION_CAPTURING_ALL_NO_DISPOSE;
widget = std::make_shared<TeamAlignmentsWidget>(randomMapTab);
pos = widget->pos;
backgroundTexture = std::make_shared<FilledTexturePlayerColored>(ImagePath::builtin("DiBoxBck"), Rect(0, 0, pos.w, pos.h));
backgroundTexture->playerColored(PlayerColor(1));
std::swap(GH.createdObj.front()->children.end()[-1], GH.createdObj.front()->children.end()[-2]); // widget to top
updateShadow();
center();
}
@ -432,6 +425,10 @@ TeamAlignmentsWidget::TeamAlignmentsWidget(RandomMapTab & randomMapTab):
pos.w = variables["windowSize"]["x"].Integer() + totalPlayers * variables["cellMargin"]["x"].Integer();
pos.h = variables["windowSize"]["y"].Integer() + totalPlayers * variables["cellMargin"]["y"].Integer();
variables["backgroundRect"]["x"].Integer() = 0;
variables["backgroundRect"]["y"].Integer() = 0;
variables["backgroundRect"]["w"].Integer() = pos.w;
variables["backgroundRect"]["h"].Integer() = pos.h;
variables["okButtonPosition"]["x"].Integer() = variables["buttonsOffset"]["ok"]["x"].Integer();
variables["okButtonPosition"]["y"].Integer() = variables["buttonsOffset"]["ok"]["y"].Integer() + totalPlayers * variables["cellMargin"]["y"].Integer();
variables["cancelButtonPosition"]["x"].Integer() = variables["buttonsOffset"]["cancel"]["x"].Integer();

View File

@ -68,7 +68,6 @@ private:
class TeamAlignments: public CWindowObject
{
std::shared_ptr<TeamAlignmentsWidget> widget;
std::shared_ptr<FilledTexturePlayerColored> backgroundTexture;
public:
TeamAlignments(RandomMapTab & randomMapTab);
};