1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-02-03 13:01:33 +02:00

fix multiplayer

This commit is contained in:
Michael 2023-08-29 02:04:32 +02:00 committed by GitHub
parent 44ece25042
commit 196cd41e35
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 15 additions and 1 deletions

View File

@ -200,6 +200,11 @@ void OptionsTab::recreate()
entries.clear();
humanPlayers = 0;
for (auto selectionWindow : GH.windows().findWindows<SelectionWindow>())
{
selectionWindow->reopen();
}
OBJ_CONSTRUCTION_CAPTURING_ALL_NO_DISPOSE;
for(auto & pInfo : SEL->getStartInfo()->playerInfos)
{
@ -671,6 +676,13 @@ void OptionsTab::SelectionWindow::setSelection()
CSH->setPlayerOption(LobbyChangePlayerOption::BONUS_ID, selectedBonus, color);
}
void OptionsTab::SelectionWindow::reopen()
{
std::shared_ptr<SelectionWindow> window = std::shared_ptr<SelectionWindow>(new SelectionWindow(color, type));
close();
GH.windows().pushWindow(window);
}
void OptionsTab::SelectionWindow::recreate()
{
OBJ_CONSTRUCTION_CAPTURING_ALL_NO_DISPOSE;

View File

@ -115,7 +115,7 @@ private:
std::vector<FactionID> factions;
std::vector<HeroTypeID> heroes;
std::vector<HeroTypeID> unusableHeroes;
FactionID initialFaction;
HeroTypeID initialHero;
int initialBonus;
@ -145,6 +145,8 @@ private:
void showPopupWindow(const Point & cursorPosition) override;
public:
void reopen();
SelectionWindow(PlayerColor _color, SelType _type);
};