1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-09-16 09:26:28 +02:00

Remove excessive code

This commit is contained in:
nordsoft
2022-12-17 20:50:33 +04:00
parent 9b76a8000f
commit d7b0770b71
2 changed files with 6 additions and 7 deletions

View File

@@ -544,7 +544,7 @@ TeamAlignmentsWidget::TeamAlignmentsWidget(RandomMapTab & randomMapTab):
}
else
{
button->addOverlay(buildWidget(variables["unchecked"]));
button->addOverlay(nullptr);
}
}
}));
@@ -554,11 +554,7 @@ TeamAlignmentsWidget::TeamAlignmentsWidget(RandomMapTab & randomMapTab):
{
variables["point"]["x"].Integer() = variables["cellOffset"]["x"].Integer() + plId * variables["cellMargin"]["x"].Integer();
variables["point"]["y"].Integer() = variables["cellOffset"]["y"].Integer() + teamId * variables["cellMargin"]["y"].Integer();
//Point p(40 + plId * 32, 20 + teamId * 32);
placeholders.push_back(buildWidget(variables["placeholder"]));
auto button = buildWidget(variables["button"]);
button->pos.w = variables["cellMargin"]["x"].Integer();
button->pos.h = variables["cellMargin"]["y"].Integer();
players.back()->addToggle(teamId, std::dynamic_pointer_cast<CToggleBase>(button));
}

View File

@@ -84,8 +84,11 @@ void CButton::addTextOverlay(const std::string & Text, EFonts font, SDL_Color co
void CButton::addOverlay(std::shared_ptr<CIntObject> newOverlay)
{
overlay = newOverlay;
if(overlay)
{
addChild(newOverlay.get());
overlay->moveTo(overlay->pos.centerIn(pos).topLeft());
}
update();
}