소스 검색

fix multiplayer

Michael 2 년 전
부모
커밋
196cd41e35
2개의 변경된 파일15개의 추가작업 그리고 1개의 파일을 삭제
  1. 12 0
      client/lobby/OptionsTab.cpp
  2. 3 1
      client/lobby/OptionsTab.h

+ 12 - 0
client/lobby/OptionsTab.cpp

@@ -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;

+ 3 - 1
client/lobby/OptionsTab.h

@@ -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);
 	};