1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-03-19 21:10:12 +02:00

Revert "Remove uncompleted code"

This reverts commit 0c41787ca563c839ff4de5f81ee826e6d7427fff.
This commit is contained in:
nordsoft 2022-12-17 03:53:26 +04:00
parent f27a40dd34
commit 42281f51e8
2 changed files with 37 additions and 2 deletions

View File

@ -105,8 +105,7 @@ RandomMapTab::RandomMapTab():
addCallback("teamAlignments", [&](int)
{
//TODO: support team alignments
//GH.pushIntT<TeamAlignmentsWidget>(*this);
GH.pushIntT<TeamAlignmentsWidget>(*this);
});
for(auto road : VLC->terrainTypeHandler->roads())
@ -449,3 +448,24 @@ void TemplatesDropBox::setTemplate(const CRmgTemplate * tmpl)
assert(GH.topInt().get() == this);
GH.popInt(GH.topInt());
}
TeamAlignmentsWidget::TeamAlignmentsWidget(RandomMapTab & randomMapTab):
CIntObject(),
randomMapTab(randomMapTab)
{
OBJ_CONSTRUCTION;
pos.w = 300;
pos.h = 300;
background = std::make_shared<CFilledTexture>("Bl3DCvex", pos);
center(pos);
buttonOk = std::make_shared<CButton>(Point(43, 240), "MUBCHCK.DEF", CGI->generaltexth->zelp[560], [](){});
buttonCancel = std::make_shared<CButton>(Point(193, 240), "MUBCANC.DEF", CGI->generaltexth->zelp[561], [&]()
{
assert(GH.topInt().get() == this);
GH.popInt(GH.topInt());
}, SDLK_ESCAPE);
}

View File

@ -84,3 +84,18 @@ private:
std::vector<const CRmgTemplate *> curItems;
};
class TeamAlignmentsWidget: public CIntObject
{
public:
TeamAlignmentsWidget(RandomMapTab & randomMapTab);
private:
RandomMapTab & randomMapTab;
std::shared_ptr<CFilledTexture> background;
std::shared_ptr<CLabelGroup> labels;
std::shared_ptr<CButton> buttonOk, buttonCancel;
std::vector<std::shared_ptr<CToggleGroup>> teams;
};