2
0
Эх сурвалжийг харах

hide screen also for second custom campaign scen.

Laserlicht 9 сар өмнө
parent
commit
0db8794d8b

+ 2 - 1
client/NetPacksLobbyClient.cpp

@@ -78,7 +78,8 @@ void ApplyOnLobbyHandlerNetPackVisitor::visitLobbyClientConnected(LobbyClientCon
 				GH.windows().popWindows(1);
 			}
 
-			GH.windows().createAndPushWindow<CLobbyScreen>(handler.screenType, handler.campaignStateToSend && !handler.campaignStateToSend->campaignSet.empty());
+			bool hideScreen = handler.campaignStateToSend && (!handler.campaignStateToSend->campaignSet.empty() || handler.campaignStateToSend->lastScenario());
+			GH.windows().createAndPushWindow<CLobbyScreen>(handler.screenType, hideScreen);
 		}
 		handler.setState(EClientState::LOBBY);
 	}

+ 2 - 2
client/lobby/CLobbyScreen.cpp

@@ -36,7 +36,7 @@
 #include "../../lib/rmg/CMapGenOptions.h"
 #include "../CGameInfo.h"
 
-CLobbyScreen::CLobbyScreen(ESelectionScreen screenType, bool fromCampaignSet)
+CLobbyScreen::CLobbyScreen(ESelectionScreen screenType, bool hideScreen)
 	: CSelectionBase(screenType), bonusSel(nullptr)
 {
 	OBJECT_CONSTRUCTION;
@@ -116,7 +116,7 @@ CLobbyScreen::CLobbyScreen(ESelectionScreen screenType, bool fromCampaignSet)
 			CSH->getGlobalLobby().activateInterface();
 	}, EShortcut::GLOBAL_CANCEL);
 
-	if(fromCampaignSet) // workaround to avoid confusing players by custom campaign list displaying for a few ms -> instead of this draw a black screen while "loading"
+	if(hideScreen) // workaround to avoid confusing players by custom campaign list displaying for a few ms -> instead of this draw a black screen while "loading"
 	{
 		blackScreen = std::make_shared<GraphicalPrimitiveCanvas>(Rect(Point(0, 0), pos.dimensions()));
 		blackScreen->addBox(Point(0, 0), pos.dimensions(), Colors::BLACK);

+ 1 - 1
client/lobby/CLobbyScreen.h

@@ -20,7 +20,7 @@ public:
 	std::shared_ptr<CButton> buttonChat;
 	std::shared_ptr<GraphicalPrimitiveCanvas> blackScreen;
 
-	CLobbyScreen(ESelectionScreen type, bool fromCampaignSet = false);
+	CLobbyScreen(ESelectionScreen type, bool hideScreen = false);
 	~CLobbyScreen();
 	void toggleTab(std::shared_ptr<CIntObject> tab) final;
 	void startCampaign();