7
7
using DTAClient . DXGUI . Multiplayer ;
8
8
using DTAClient . DXGUI . Multiplayer . CnCNet ;
9
9
using DTAClient . DXGUI . Multiplayer . GameLobby ;
10
+ using DTAClient . DXGUI . Multiplayer . QuickMatch ;
10
11
using DTAClient . Online ;
11
12
using DTAConfig ;
12
13
using Microsoft . Xna . Framework ;
13
14
using Rampastring . XNAUI ;
14
15
using System . Threading . Tasks ;
16
+ using Rampastring . XNAUI . XNAControls ;
15
17
using Updater ;
16
18
using SkirmishLobby = DTAClient . DXGUI . Multiplayer . GameLobby . SkirmishLobby ;
17
19
@@ -71,7 +73,7 @@ private void InitUpdater()
71
73
72
74
private void LoadMaps ( )
73
75
{
74
- mapLoader = new MapLoader ( ) ;
76
+ mapLoader = MapLoader . GetInstance ( ) ;
75
77
mapLoader . LoadMaps ( ) ;
76
78
}
77
79
@@ -84,13 +86,7 @@ private void Finish()
84
86
if ( ! string . IsNullOrEmpty ( ClientConfiguration . Instance . DiscordAppId ) )
85
87
discordHandler = new DiscordHandler ( WindowManager ) ;
86
88
87
- ClientGUICreator . Instance . AddControl ( typeof ( GameLobbyCheckBox ) ) ;
88
- ClientGUICreator . Instance . AddControl ( typeof ( GameLobbyDropDown ) ) ;
89
- ClientGUICreator . Instance . AddControl ( typeof ( MapPreviewBox ) ) ;
90
- ClientGUICreator . Instance . AddControl ( typeof ( GameLaunchButton ) ) ;
91
- ClientGUICreator . Instance . AddControl ( typeof ( ChatListBox ) ) ;
92
- ClientGUICreator . Instance . AddControl ( typeof ( XNAChatTextBox ) ) ;
93
- ClientGUICreator . Instance . AddControl ( typeof ( PlayerExtraOptionsPanel ) ) ;
89
+ DeclareCustomControls ( ) ;
94
90
95
91
var gameCollection = new GameCollection ( ) ;
96
92
gameCollection . Initialize ( GraphicsDevice ) ;
@@ -120,15 +116,18 @@ private void Finish()
120
116
var gipw = new GameInProgressWindow ( WindowManager ) ;
121
117
122
118
var skirmishLobby = new SkirmishLobby ( WindowManager , topBar , mapLoader , discordHandler ) ;
119
+ var quickMatchWindow = new QuickMatchWindow ( WindowManager , topBar ) ;
123
120
124
121
topBar . SetSecondarySwitch ( cncnetLobby ) ;
125
122
126
- var mainMenu = new MainMenu ( WindowManager , skirmishLobby , lanLobby ,
123
+ var mainMenu = new MainMenu ( WindowManager , skirmishLobby , quickMatchWindow , lanLobby ,
127
124
topBar , optionsWindow , cncnetLobby , cncnetManager , discordHandler ) ;
128
125
WindowManager . AddAndInitializeControl ( mainMenu ) ;
129
126
130
127
DarkeningPanel . AddAndInitializeWithControl ( WindowManager , skirmishLobby ) ;
131
128
129
+ DarkeningPanel . AddAndInitializeWithControl ( WindowManager , quickMatchWindow ) ;
130
+
132
131
DarkeningPanel . AddAndInitializeWithControl ( WindowManager , cncnetGameLoadingLobby ) ;
133
132
134
133
DarkeningPanel . AddAndInitializeWithControl ( WindowManager , cncnetGameLobby ) ;
@@ -144,9 +143,11 @@ private void Finish()
144
143
145
144
topBar . SetTertiarySwitch ( pmWindow ) ;
146
145
topBar . SetOptionsWindow ( optionsWindow ) ;
146
+ topBar . SetQuickMatchWindow ( quickMatchWindow ) ;
147
147
148
148
WindowManager . AddAndInitializeControl ( gipw ) ;
149
149
skirmishLobby . Disable ( ) ;
150
+ quickMatchWindow . Disable ( ) ;
150
151
cncnetLobby . Disable ( ) ;
151
152
cncnetGameLobby . Disable ( ) ;
152
153
cncnetGameLoadingLobby . Disable ( ) ;
@@ -175,6 +176,22 @@ private void Finish()
175
176
Cursor . Visible = visibleSpriteCursor ;
176
177
}
177
178
179
+ private static void DeclareCustomControls ( )
180
+ {
181
+ ClientGUICreator . Instance . AddControl ( typeof ( GameLobbyCheckBox ) ) ;
182
+ ClientGUICreator . Instance . AddControl ( typeof ( GameLobbyDropDown ) ) ;
183
+ ClientGUICreator . Instance . AddControl ( typeof ( MapPreviewBox ) ) ;
184
+ ClientGUICreator . Instance . AddControl ( typeof ( GameLaunchButton ) ) ;
185
+ ClientGUICreator . Instance . AddControl ( typeof ( ChatListBox ) ) ;
186
+ ClientGUICreator . Instance . AddControl ( typeof ( XNAChatTextBox ) ) ;
187
+ ClientGUICreator . Instance . AddControl ( typeof ( XNAPasswordBox ) ) ;
188
+ ClientGUICreator . Instance . AddControl ( typeof ( PlayerExtraOptionsPanel ) ) ;
189
+ ClientGUICreator . Instance . AddControl ( typeof ( QuickMatchLoginPanel ) ) ;
190
+ ClientGUICreator . Instance . AddControl ( typeof ( QuickMatchLobbyPanel ) ) ;
191
+ ClientGUICreator . Instance . AddControl ( typeof ( QuickMatchMapList ) ) ;
192
+ ClientGUICreator . Instance . AddControl ( typeof ( QuickMatchStatusMessageWindow ) ) ;
193
+ }
194
+
178
195
public override void Update ( GameTime gameTime )
179
196
{
180
197
base . Update ( gameTime ) ;
0 commit comments