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 ;
15
16
using Rampastring . Tools ;
16
17
using ClientUpdater ;
18
+ using Rampastring . XNAUI . XNAControls ;
17
19
using SkirmishLobby = DTAClient . DXGUI . Multiplayer . GameLobby . SkirmishLobby ;
18
20
19
21
namespace DTAClient . DXGUI . Generic
@@ -79,26 +81,20 @@ private void LogGameClientVersion()
79
81
80
82
private void LoadMaps ( )
81
83
{
82
- mapLoader = new MapLoader ( ) ;
84
+ mapLoader = MapLoader . GetInstance ( ) ;
83
85
mapLoader . LoadMaps ( ) ;
84
86
}
85
87
86
88
private void Finish ( )
87
89
{
88
- ProgramConstants . GAME_VERSION = ClientConfiguration . Instance . ModMode ?
90
+ ProgramConstants . GAME_VERSION = ClientConfiguration . Instance . ModMode ?
89
91
"N/A" : Updater . GameVersion ;
90
92
91
93
DiscordHandler discordHandler = null ;
92
94
if ( ! string . IsNullOrEmpty ( ClientConfiguration . Instance . DiscordAppId ) )
93
95
discordHandler = new DiscordHandler ( WindowManager ) ;
94
96
95
- ClientGUICreator . Instance . AddControl ( typeof ( GameLobbyCheckBox ) ) ;
96
- ClientGUICreator . Instance . AddControl ( typeof ( GameLobbyDropDown ) ) ;
97
- ClientGUICreator . Instance . AddControl ( typeof ( MapPreviewBox ) ) ;
98
- ClientGUICreator . Instance . AddControl ( typeof ( GameLaunchButton ) ) ;
99
- ClientGUICreator . Instance . AddControl ( typeof ( ChatListBox ) ) ;
100
- ClientGUICreator . Instance . AddControl ( typeof ( XNAChatTextBox ) ) ;
101
- ClientGUICreator . Instance . AddControl ( typeof ( PlayerExtraOptionsPanel ) ) ;
97
+ DeclareCustomControls ( ) ;
102
98
103
99
var gameCollection = new GameCollection ( ) ;
104
100
gameCollection . Initialize ( ) ;
@@ -109,7 +105,7 @@ private void Finish()
109
105
var cncnetManager = new CnCNetManager ( WindowManager , gameCollection , cncnetUserData ) ;
110
106
var tunnelHandler = new TunnelHandler ( WindowManager , cncnetManager ) ;
111
107
var privateMessageHandler = new PrivateMessageHandler ( cncnetManager , cncnetUserData ) ;
112
-
108
+
113
109
var topBar = new TopBar ( WindowManager , cncnetManager , privateMessageHandler ) ;
114
110
115
111
var optionsWindow = new OptionsWindow ( WindowManager , gameCollection , topBar ) ;
@@ -120,23 +116,26 @@ private void Finish()
120
116
121
117
var cncnetGameLobby = new CnCNetGameLobby ( WindowManager ,
122
118
"MultiplayerGameLobby" , topBar , cncnetManager , tunnelHandler , gameCollection , cncnetUserData , mapLoader , discordHandler , pmWindow ) ;
123
- var cncnetGameLoadingLobby = new CnCNetGameLoadingLobby ( WindowManager ,
119
+ var cncnetGameLoadingLobby = new CnCNetGameLoadingLobby ( WindowManager ,
124
120
topBar , cncnetManager , tunnelHandler , mapLoader . GameModes , gameCollection , discordHandler ) ;
125
- var cncnetLobby = new CnCNetLobby ( WindowManager , cncnetManager ,
121
+ var cncnetLobby = new CnCNetLobby ( WindowManager , cncnetManager ,
126
122
cncnetGameLobby , cncnetGameLoadingLobby , topBar , pmWindow , tunnelHandler ,
127
123
gameCollection , cncnetUserData , optionsWindow ) ;
128
124
var gipw = new GameInProgressWindow ( WindowManager ) ;
129
125
130
126
var skirmishLobby = new SkirmishLobby ( WindowManager , topBar , mapLoader , discordHandler ) ;
127
+ var quickMatchWindow = new QuickMatchWindow ( WindowManager ) ;
131
128
132
129
topBar . SetSecondarySwitch ( cncnetLobby ) ;
133
130
134
- var mainMenu = new MainMenu ( WindowManager , skirmishLobby , lanLobby ,
131
+ var mainMenu = new MainMenu ( WindowManager , skirmishLobby , quickMatchWindow , lanLobby ,
135
132
topBar , optionsWindow , cncnetLobby , cncnetManager , discordHandler ) ;
136
133
WindowManager . AddAndInitializeControl ( mainMenu ) ;
137
134
138
135
DarkeningPanel . AddAndInitializeWithControl ( WindowManager , skirmishLobby ) ;
139
136
137
+ DarkeningPanel . AddAndInitializeWithControl ( WindowManager , quickMatchWindow ) ;
138
+
140
139
DarkeningPanel . AddAndInitializeWithControl ( WindowManager , cncnetGameLoadingLobby ) ;
141
140
142
141
DarkeningPanel . AddAndInitializeWithControl ( WindowManager , cncnetGameLobby ) ;
@@ -152,9 +151,11 @@ private void Finish()
152
151
153
152
topBar . SetTertiarySwitch ( pmWindow ) ;
154
153
topBar . SetOptionsWindow ( optionsWindow ) ;
154
+ topBar . SetQuickMatchWindow ( quickMatchWindow ) ;
155
155
156
156
WindowManager . AddAndInitializeControl ( gipw ) ;
157
157
skirmishLobby . Disable ( ) ;
158
+ quickMatchWindow . Disable ( ) ;
158
159
cncnetLobby . Disable ( ) ;
159
160
cncnetGameLobby . Disable ( ) ;
160
161
cncnetGameLoadingLobby . Disable ( ) ;
@@ -183,6 +184,27 @@ private void Finish()
183
184
Cursor . Visible = visibleSpriteCursor ;
184
185
}
185
186
187
+ private static void DeclareCustomControls ( )
188
+ {
189
+ ClientGUICreator . Instance . AddControl ( typeof ( GameLobbyCheckBox ) ) ;
190
+ ClientGUICreator . Instance . AddControl ( typeof ( GameLobbyDropDown ) ) ;
191
+ ClientGUICreator . Instance . AddControl ( typeof ( MapPreviewBox ) ) ;
192
+ ClientGUICreator . Instance . AddControl ( typeof ( GameLaunchButton ) ) ;
193
+ ClientGUICreator . Instance . AddControl ( typeof ( ChatListBox ) ) ;
194
+ ClientGUICreator . Instance . AddControl ( typeof ( XNAChatTextBox ) ) ;
195
+ ClientGUICreator . Instance . AddControl ( typeof ( XNAScrollBar ) ) ;
196
+ ClientGUICreator . Instance . AddControl ( typeof ( XNAPasswordBox ) ) ;
197
+ ClientGUICreator . Instance . AddControl ( typeof ( PlayerExtraOptionsPanel ) ) ;
198
+ ClientGUICreator . Instance . AddControl ( typeof ( QuickMatchLoginPanel ) ) ;
199
+ ClientGUICreator . Instance . AddControl ( typeof ( QuickMatchLobbyPanel ) ) ;
200
+ ClientGUICreator . Instance . AddControl ( typeof ( QuickMatchLobbyFooterPanel ) ) ;
201
+ ClientGUICreator . Instance . AddControl ( typeof ( QuickMatchMapList ) ) ;
202
+ ClientGUICreator . Instance . AddControl ( typeof ( QuickMatchStatusOverlay ) ) ;
203
+ ClientGUICreator . Instance . AddControl ( typeof ( XNAClientTabControl ) ) ;
204
+ ClientGUICreator . Instance . AddControl ( typeof ( XNAClientProgressBar ) ) ;
205
+ ClientGUICreator . Instance . AddControl ( typeof ( XNAScrollablePanel ) ) ;
206
+ }
207
+
186
208
public override void Update ( GameTime gameTime )
187
209
{
188
210
base . Update ( gameTime ) ;
0 commit comments