]> Dogcows Code - chaz/carfire/blob - Project06/CS 3505 Project 06/CS 3505 Project 06/LobbyGUI.cs
17275a945adf4a946504354d09cd9f056ab52b05
[chaz/carfire] / Project06 / CS 3505 Project 06 / CS 3505 Project 06 / LobbyGUI.cs
1 using System;
2 using System.Collections.Generic;
3 using System.Linq;
4 using System.Text;
5 using Microsoft.Xna.Framework.Net;
6 using System.Diagnostics;
7 using Microsoft.Xna.Framework.GamerServices;
8 using Microsoft.Xna.Framework.Graphics;
9 using Microsoft.Xna.Framework;
10 using Microsoft.Xna.Framework.Input;
11 using Microsoft.Xna.Framework.Content;
12
13 namespace CS_3505_Project_06
14 {
15 public class lobbyGUI : ILobby
16 {
17 float scale;
18
19 Texture2D background;
20 Texture2D spotLight;
21 Texture2D cs;
22 Texture2D selectGameScreen;
23
24 Vector2 backgroundPos;
25 Vector2 spotLightPos;
26 Vector2 spotLightCenter;
27 Vector2 csPos;
28
29 Vector2 zero;
30 Vector2 spotLightVelocity;
31
32 int MaxX;
33 int MinX;
34 int MaxY;
35 int MinY;
36
37 Texture2D checkedBox;
38 Texture2D deselectBox;
39 Texture2D emptySelectBox;
40 Texture2D menuItem;
41
42 Boolean ready;
43
44 SpriteFont menuFont;
45 string selected;
46 Vector2 createGamePos;
47 string createGameText;
48 Vector2 findGamePos;
49 string findGameText;
50
51 Vector2 returnToMainPos;
52 string returnToMainText;
53
54 KeyboardState previousKeyboardState;
55 KeyboardState currentKeyboardState;
56
57 GamerCollection<NetworkGamer> players;
58 LocalNetworkGamer localPlayer;
59 AvailableNetworkSessionCollection availableSessions;
60 bool allReady;
61
62 int selectedSessionIndex;
63
64 bool chatActive;
65 String chatMessage;
66 Queue<ChatInfo> currentChat;
67
68 private enum lobbyState
69 {
70 Welcome,
71 CreateGame,
72 FindGame,
73 FindingGames, // TODO: New state.
74 JoiningGame, // TODO: New state.
75 Connected
76 }
77
78 lobbyState currentState;
79
80 public lobbyGUI()
81 {
82 currentState = lobbyState.Welcome;
83 selectedSessionIndex = 0;
84 ready = false;
85 chatActive = false;
86 chatMessage = "";
87 currentChat = new Queue<ChatInfo>();
88 }
89
90 public void LoadContent(ContentManager contentManager, GraphicsDeviceManager graphics)
91 {
92 background = contentManager.Load<Texture2D>("background");
93 spotLight = contentManager.Load<Texture2D>("spotlight");
94 cs = contentManager.Load<Texture2D>("cs");
95 selectGameScreen = contentManager.Load<Texture2D>("selectGameScreen");
96 backgroundPos = new Vector2(0f, 0f);
97 spotLightPos = new Vector2(100f, graphics.GraphicsDevice.Viewport.Height - 98);
98 spotLightCenter = new Vector2(800f, 800f);
99 spotLightVelocity = new Vector2(-100, 33);
100 csPos = new Vector2(10f, graphics.GraphicsDevice.Viewport.Height - 98);
101
102 zero = new Vector2(0, 0);
103
104 MaxX = graphics.GraphicsDevice.Viewport.Width;
105 MinX = 0;
106 MaxY = graphics.GraphicsDevice.Viewport.Height;
107 MinY = 100;
108
109 scale = MaxX / 1600f;
110
111 //playerlist stuff
112 checkedBox = contentManager.Load<Texture2D>("checkedBox");
113 deselectBox = contentManager.Load<Texture2D>("deselectBox");
114 emptySelectBox = contentManager.Load<Texture2D>("emptySelectBox");
115 menuItem = contentManager.Load<Texture2D>("menuItem");
116
117
118
119 //menu fonts
120 menuFont = contentManager.Load<SpriteFont>("menuFont");
121 createGamePos = new Vector2(100f, MaxY / 3);
122 createGameText = "Create Game";
123 selected = createGameText;
124
125 findGamePos = new Vector2(100f, (MaxY / 3) + 60);
126 findGameText = "Find Game";
127
128 returnToMainPos = new Vector2(MaxX / 2, MaxY - 120);
129 returnToMainText = "press [ X ] to return to main menu";
130
131
132 }
133
134 public void UnloadContent()
135 {
136
137 }
138
139 // TODO: New method.
140 void JoinedSession(NetworkSession session, NetworkGame networkGame)
141 {
142 if (session != null)
143 {
144 currentState = lobbyState.Connected;
145 }
146 else
147 {
148 // TODO: This should do something more than just throw the player back to the welcome screen.
149 currentState = lobbyState.Welcome;
150 Console.WriteLine("Couldn't create/join the session.");
151 }
152 }
153
154 // TODO: New method.
155 void FoundSessions(AvailableNetworkSessionCollection sessions, NetworkGame networkGame)
156 {
157 availableSessions = sessions;
158 }
159
160 // TODO: New method.
161 void AsyncCallbackFailed(Exception exception, NetworkGame networkGame)
162 {
163 currentState = lobbyState.Welcome;
164 Console.WriteLine("Exception as thrown during async call: " + exception.Message);
165 }
166
167 private void UpdateChat(GameTime gameTime, NetworkGame networkGame)
168 {
169 currentChat.Concat(networkGame.ReceiveChats());
170
171 }
172
173 public long Update(GameTime gameTime, NetworkGame networkGame)
174 {
175
176 UpdateSpotLight(gameTime);
177 currentKeyboardState = Keyboard.GetState();
178
179 if (networkGame.HasActiveSession)
180 {
181 players = networkGame.NetworkGamers;
182 }
183
184 //check inputs
185 switch (currentState)
186 {
187 case lobbyState.Welcome:
188 if (selected == createGameText)
189 {
190 if (currentKeyboardState.IsKeyDown(Keys.Enter) && previousKeyboardState.IsKeyUp(Keys.Enter))
191 currentState = lobbyState.CreateGame;
192 if (currentKeyboardState.IsKeyDown(Keys.Down))
193 selected = findGameText;
194 }
195 else
196 {
197 if (currentKeyboardState.IsKeyDown(Keys.Enter) && previousKeyboardState.IsKeyUp(Keys.Enter))
198 currentState = lobbyState.FindGame;
199 if (currentKeyboardState.IsKeyDown(Keys.Up))
200 selected = createGameText;
201 }
202 break;
203
204 case lobbyState.CreateGame:
205 if (currentKeyboardState.IsKeyDown(Keys.X) && previousKeyboardState.IsKeyUp(Keys.X))
206 {
207 currentState = lobbyState.Welcome;
208 ready = false;
209 if (networkGame.HasActiveSession)
210 {
211 players = null;
212 networkGame.LeaveSession();
213 }
214 }
215 if (currentKeyboardState.IsKeyDown(Keys.Y) && previousKeyboardState.IsKeyUp(Keys.Y))
216 {
217 currentState = lobbyState.JoiningGame;
218 networkGame.ErrorDelegate = AsyncCallbackFailed;
219 networkGame.CreateSession(JoinedSession);
220 }
221 break;
222
223 case lobbyState.FindGame:
224 if (currentKeyboardState.IsKeyDown(Keys.X) && previousKeyboardState.IsKeyUp(Keys.X))
225 {
226 currentState = lobbyState.Welcome;
227 ready = false;
228 }
229 availableSessions = null;
230 networkGame.ErrorDelegate = AsyncCallbackFailed;
231 networkGame.FindSessions(FoundSessions);
232 currentState = lobbyState.FindingGames;
233 break;
234
235 case lobbyState.FindingGames:
236 if (currentKeyboardState.IsKeyDown(Keys.X) && previousKeyboardState.IsKeyUp(Keys.X))
237 {
238 currentState = lobbyState.Welcome;
239 ready = false;
240 }
241 if (availableSessions != null && availableSessions.Count == 0)
242 currentState = lobbyState.FindGame;
243 else if (availableSessions != null && availableSessions.Count > 0)
244 {
245 if (currentKeyboardState.IsKeyDown(Keys.D1) && previousKeyboardState.IsKeyUp(Keys.D1))
246 {
247 networkGame.JoinSession(availableSessions[0], JoinedSession);
248 currentState = lobbyState.JoiningGame;
249
250 availableSessions.Dispose();
251 availableSessions = null;
252 }
253 if (currentKeyboardState.IsKeyDown(Keys.D2) && previousKeyboardState.IsKeyUp(Keys.D2))
254 {
255 networkGame.JoinSession(availableSessions[0], JoinedSession);
256 currentState = lobbyState.JoiningGame;
257
258 availableSessions.Dispose();
259 availableSessions = null;
260 }
261 }
262
263
264 Console.WriteLine("Finding");
265 break;
266 case lobbyState.Connected:
267 if (chatActive)
268 {
269 if (currentKeyboardState.IsKeyDown(Keys.Enter) && previousKeyboardState.IsKeyUp(Keys.Enter))
270 {
271 networkGame.SendChat(chatMessage);
272 chatActive = false;
273 break;
274 }
275 Keys[] k = currentKeyboardState.GetPressedKeys();
276 Keys[] kp = previousKeyboardState.GetPressedKeys();
277 List<Keys> newKeys = new List<Keys>();
278
279 for (int x = 0; x < k.Count(); x++) //copy new keys into array
280 {
281 if (!kp.Contains(k[x]))
282 {
283 newKeys.Add(k[x]);
284 }
285 }
286
287 foreach(Keys ky in newKeys)
288 {
289 if(ky.Equals(Keys.Space))
290 chatMessage = chatMessage + " ";
291 else
292 chatMessage = chatMessage + ky.ToString();
293 }
294
295 }
296 else
297 {
298 UpdateChat(gameTime, networkGame);
299 chatMessage = "";
300 if (currentKeyboardState.IsKeyDown(Keys.T) && previousKeyboardState.IsKeyUp(Keys.T))
301 {
302 chatActive = true;
303 }
304 if (currentKeyboardState.IsKeyDown(Keys.X) && previousKeyboardState.IsKeyUp(Keys.X))
305 {
306 ready = false;
307 if (networkGame.HasActiveSession)
308 {
309 players = null;
310 networkGame.LeaveSession();
311 }
312 currentState = lobbyState.Welcome;
313
314 }
315 if (currentKeyboardState.IsKeyDown(Keys.R) && previousKeyboardState.IsKeyUp(Keys.R))
316 networkGame.LocalGamer.IsReady = true;
317
318 if (networkGame.HasActiveSession)
319 {
320 localPlayer = networkGame.LocalGamer;
321 players = networkGame.NetworkGamers;
322 if (players != null)
323 {
324 allReady = true;
325 foreach (NetworkGamer p in players)
326 if (p.IsReady == false)
327 {
328 allReady = false;
329 break;
330 }
331 }
332
333 //allows host to start the game when all players are ready, change count below to different number for testing with less then 4 players
334 if (allReady && players.Count == 2 && localPlayer == players[0])
335 {
336 if (currentKeyboardState.IsKeyDown(Keys.B) && previousKeyboardState.IsKeyUp(Keys.B))
337 {
338 networkGame.ForceStartGame();
339 }
340 }
341 }
342 else
343 currentState = lobbyState.Welcome;
344 }
345 break;
346
347 }
348 previousKeyboardState = Keyboard.GetState();
349
350 return 1;
351 }
352
353 /// <summary>
354 /// Draws the lobby GUI. Has different states for difference menu configurations
355 /// </summary>
356 public long Draw(SpriteBatch spriteBatch)
357 {
358 spriteBatch.Draw(background, backgroundPos, null, Color.White, 0, zero, scale, SpriteEffects.None, 0);
359 spriteBatch.Draw(cs, csPos, null, Color.White, 0, zero, 0.5f, SpriteEffects.None, 0);
360 spriteBatch.Draw(spotLight, spotLightPos, null, Color.White, 0, spotLightCenter, 1f, SpriteEffects.None, 0);
361
362 switch (currentState)
363 {
364 case lobbyState.Welcome:
365 spriteBatch.DrawString(menuFont, "press [ Home ] to login", new Vector2(350, 20), Color.LightGray, 0f, zero, .6f, SpriteEffects.None, 0.5f);
366 if (selected == createGameText)
367 spriteBatch.DrawString(menuFont, createGameText, createGamePos, Color.Red, 0, zero, 1f, SpriteEffects.None, 0.5f);
368 else
369 spriteBatch.DrawString(menuFont, createGameText, createGamePos, Color.Gray, 0, zero, 1f,SpriteEffects.None, 0.5f);
370 if (selected == findGameText)
371 spriteBatch.DrawString(menuFont, findGameText, findGamePos, Color.Red, 0, zero, 1f, SpriteEffects.None, 0.5f);
372 else
373 spriteBatch.DrawString(menuFont, findGameText, findGamePos, Color.Gray, 0, zero, 1f, SpriteEffects.None, 0.5f);
374 break;
375
376 case lobbyState.CreateGame:
377 DrawPlayerList(spriteBatch);
378 spriteBatch.DrawString(menuFont, "You are now the Host!", new Vector2(MaxX / 2, MaxY / 3), Color.White, 0f, zero, .7f, SpriteEffects.None, 0.5f);
379 spriteBatch.DrawString(menuFont, "press: Y to continue", new Vector2(MaxX /2, (MaxY / 3) + menuFont.LineSpacing), Color.White, 0f, zero, .6f, SpriteEffects.None, 0.5f);
380 spriteBatch.DrawString(menuFont, "X to return to main menu", new Vector2(MaxX /2 + 40, (MaxY / 3) + 2 * menuFont.LineSpacing), Color.White, 0f, zero, .6f, SpriteEffects.None, 0.5f);
381
382 break;
383
384 case lobbyState.FindingGames:
385 spriteBatch.Draw(selectGameScreen, backgroundPos, null, Color.White, 0, zero, scale, SpriteEffects.None, 0);
386 if(availableSessions == null)
387 spriteBatch.DrawString(menuFont, "searching for available games ....", new Vector2(150, 100), Color.Gray, 0f, zero, .7f, SpriteEffects.None, 0.5f);
388 else if (availableSessions.Count == 0)
389 spriteBatch.DrawString(menuFont, "no games currently available, searching ....", new Vector2(150, 100), Color.Gray, 0f, zero, .7f, SpriteEffects.None, 0.5f);
390 else
391 {
392 for (int sessionIndex = 0; sessionIndex < availableSessions.Count; sessionIndex++)
393 {
394 Color color = Color.Gray;
395
396 if (sessionIndex == selectedSessionIndex)
397 color = Color.Red;
398
399 spriteBatch.DrawString(menuFont, availableSessions[sessionIndex].HostGamertag, new Vector2(150, 100 + sessionIndex * menuFont.LineSpacing), color, 0f, zero, .7f, SpriteEffects.None, 0.5f);
400 spriteBatch.DrawString(menuFont, availableSessions[sessionIndex].CurrentGamerCount + " / " + availableSessions[sessionIndex].OpenPublicGamerSlots + availableSessions[sessionIndex].OpenPrivateGamerSlots,
401 new Vector2(400, 100 + sessionIndex * menuFont.LineSpacing), color, 0f, zero, .7f, SpriteEffects.None, 0.5f);
402 }
403 }
404 break;
405
406 case lobbyState.Connected:
407 DrawPlayerList(spriteBatch);
408 DrawChatInfo(spriteBatch);
409 if(allReady && players.Count == 2 && localPlayer == players[0])
410 spriteBatch.DrawString(menuFont, "Press B to begin game!", new Vector2(MaxX / 2, MaxY / 2), Color.White, 0f, zero, .7f, SpriteEffects.None, 0.5f);
411 else if(allReady)
412 spriteBatch.DrawString(menuFont, "The game will begin soon.", new Vector2(MaxX / 2, MaxY / 2), Color.White, 0f, zero, .7f, SpriteEffects.None, 0.5f);
413 else
414 spriteBatch.DrawString(menuFont, "Waiting for ready players...", new Vector2(MaxX / 2, MaxY / 2), Color.White, 0f, zero, .7f, SpriteEffects.None, 0.5f);
415 break;
416 }
417
418 return 1;
419 }
420
421 private void UpdateSpotLight(GameTime gameTime)
422 {
423 spotLightPos = new Vector2(spotLightPos.X + spotLightVelocity.X * (float)gameTime.ElapsedGameTime.TotalSeconds,
424 spotLightPos.Y + spotLightVelocity.Y * (float)gameTime.ElapsedGameTime.TotalSeconds);
425
426 if (spotLightPos.X > MaxX || spotLightPos.X < MinX) //right or left wall
427 {
428 spotLightVelocity = new Vector2(spotLightVelocity.X * -1, spotLightVelocity.Y);
429 }
430 else if (spotLightPos.Y > MaxY || spotLightPos.Y < MinY) //top or bottom wall
431 {
432 spotLightVelocity = new Vector2(spotLightVelocity.X, spotLightVelocity.Y * -1);
433 }
434 }
435
436 private void DrawChatInfo(SpriteBatch spriteBatch)
437 {
438 if (currentChat.Count > 0)
439 {
440 for (int y = 0; y < currentChat.Count; y++)
441 {
442 spriteBatch.DrawString(menuFont, currentChat.ElementAt(y).Sender + ": " + currentChat.ElementAt(y).Message
443 , new Vector2(400, 100 - y*10), Color.Blue, 0f, zero, .6f, SpriteEffects.None, 1f);
444 }
445
446 }
447 if(chatActive)
448 spriteBatch.DrawString(menuFont, chatMessage, new Vector2(400, 100), Color.Green, 0f, zero, .6f, SpriteEffects.None, 1f);
449 }
450
451 private void DrawPlayerList(SpriteBatch spriteBatch)
452 {
453
454 //reference point
455 Vector2 topOfList = new Vector2(MaxX / 8, MaxY / 4);
456
457 //command info
458 spriteBatch.DrawString(menuFont, "Current Players", new Vector2(topOfList.X + 15, topOfList.Y - 25), Color.White);
459 spriteBatch.DrawString(menuFont, "Command Options: to mark your self as ready", new Vector2(20, 20), Color.Gray, 0f, zero, .6f, SpriteEffects.None, 1f);
460 spriteBatch.DrawString(menuFont, "type players # to toggle chat", new Vector2(175, 40), Color.Gray, 0f, zero, .6f, SpriteEffects.None, 1f);
461 spriteBatch.DrawString(menuFont, "return to main menu", new Vector2(175, 60), Color.Gray, 0f, zero, .6f, SpriteEffects.None, 1f);
462 spriteBatch.DrawString(menuFont, "R", new Vector2(145, 20), Color.DarkGreen, 0f, zero, .6f, SpriteEffects.None, 1f);
463 spriteBatch.DrawString(menuFont, "#", new Vector2(145, 40), Color.DarkGreen, 0f, zero, .6f, SpriteEffects.None, 1f);
464 spriteBatch.DrawString(menuFont, "X", new Vector2(145, 60), Color.DarkGreen, 0f, zero, .6f, SpriteEffects.None, 1f);
465
466 //Background squares
467 spriteBatch.Draw(menuItem, topOfList, null, Color.White, 0, zero, scale, SpriteEffects.None, 1f);
468 spriteBatch.Draw(menuItem, new Vector2(topOfList.X, topOfList.Y + 65), null, Color.White, 0, zero, scale, SpriteEffects.None, 1f);
469 spriteBatch.Draw(menuItem, new Vector2(topOfList.X, topOfList.Y + 130), null, Color.White, 0, zero, scale, SpriteEffects.None, 1f);
470 spriteBatch.Draw(menuItem, new Vector2(topOfList.X, topOfList.Y + 195), null, Color.White, 0, zero, scale, SpriteEffects.None, 1f);
471
472 //Ready Labels
473 spriteBatch.DrawString(menuFont, "Ready", new Vector2(topOfList.X + 5, topOfList.Y + 45), Color.DarkGray, 0f, zero, .6f, SpriteEffects.None, 1f);
474 spriteBatch.DrawString(menuFont, "Ready", new Vector2(topOfList.X + 5, topOfList.Y + 110), Color.DarkGray, 0f, zero, .6f, SpriteEffects.None, 1f);
475 spriteBatch.DrawString(menuFont, "Ready", new Vector2(topOfList.X + 5, topOfList.Y + 175), Color.DarkGray, 0f, zero, .6f, SpriteEffects.None, 1f);
476 spriteBatch.DrawString(menuFont, "Ready", new Vector2(topOfList.X + 5, topOfList.Y + 240), Color.DarkGray, 0f, zero, .6f, SpriteEffects.None, 1f);
477
478 //Ready CheckBoxs
479 if (players == null)
480 {
481 spriteBatch.Draw(emptySelectBox, new Vector2(topOfList.X - 32, topOfList.Y + 35), null, Color.White, 0, zero, scale, SpriteEffects.None, 1f);
482 spriteBatch.Draw(emptySelectBox, new Vector2(topOfList.X - 32, topOfList.Y + 100), null, Color.White, 0, zero, scale, SpriteEffects.None, 1f);
483 spriteBatch.Draw(emptySelectBox, new Vector2(topOfList.X - 32, topOfList.Y + 165), null, Color.White, 0, zero, scale, SpriteEffects.None, 1f);
484 spriteBatch.Draw(emptySelectBox, new Vector2(topOfList.X - 32, topOfList.Y + 230), null, Color.White, 0, zero, scale, SpriteEffects.None, 1f);
485 }
486 else
487 {
488 if (!(players.Count >= 1 && players[0].IsReady))
489 spriteBatch.Draw(emptySelectBox, new Vector2(topOfList.X - 32, topOfList.Y + 35), null, Color.White, 0, zero, scale, SpriteEffects.None, 1f);
490 else
491 spriteBatch.Draw(checkedBox, new Vector2(topOfList.X - 32, topOfList.Y + 30), null, Color.White, 0, zero, scale, SpriteEffects.None, 1f);
492 if (!(players.Count >= 2 && players[1].IsReady))
493 spriteBatch.Draw(emptySelectBox, new Vector2(topOfList.X - 32, topOfList.Y + 100), null, Color.White, 0, zero, scale, SpriteEffects.None, 1f);
494 else
495 spriteBatch.Draw(checkedBox, new Vector2(topOfList.X - 32, topOfList.Y + 95), null, Color.White, 0, zero, scale, SpriteEffects.None, 1f);
496 if (!(players.Count >= 3 && players[2].IsReady))
497 spriteBatch.Draw(emptySelectBox, new Vector2(topOfList.X - 32, topOfList.Y + 165), null, Color.White, 0, zero, scale, SpriteEffects.None, 1f);
498 else
499 spriteBatch.Draw(checkedBox, new Vector2(topOfList.X - 32, topOfList.Y + 160), null, Color.White, 0, zero, scale, SpriteEffects.None, 1f);
500 if (!(players.Count >= 4 && players[3].IsReady))
501 spriteBatch.Draw(emptySelectBox, new Vector2(topOfList.X - 32, topOfList.Y + 230), null, Color.White, 0, zero, scale, SpriteEffects.None, 1f);
502 else
503 spriteBatch.Draw(checkedBox, new Vector2(topOfList.X - 32, topOfList.Y + 225), null, Color.White, 0, zero, scale, SpriteEffects.None, 1f);
504 }
505
506 //Chat Labels
507 spriteBatch.DrawString(menuFont, "Chat with", new Vector2(topOfList.X + 152, topOfList.Y + 45), Color.DarkGray, 0f, zero, .6f, SpriteEffects.None, 1f);
508 spriteBatch.DrawString(menuFont, "Chat with", new Vector2(topOfList.X + 152, topOfList.Y + 110), Color.DarkGray, 0f, zero, .6f, SpriteEffects.None, 1f);
509 spriteBatch.DrawString(menuFont, "Chat with", new Vector2(topOfList.X + 152, topOfList.Y + 175), Color.DarkGray, 0f, zero, .6f, SpriteEffects.None, 1f);
510 spriteBatch.DrawString(menuFont, "Chat with", new Vector2(topOfList.X + 152, topOfList.Y + 240), Color.DarkGray, 0f, zero, .6f, SpriteEffects.None, 1f);
511
512 //Chat CheckBoxs
513 Boolean chatwith = false; // change to reflect info from network, move to update and create one for each player
514 if (!chatwith)
515 spriteBatch.Draw(deselectBox, new Vector2(topOfList.X +218, topOfList.Y + 35), null, Color.White, 0, zero, scale, SpriteEffects.None, 1f);
516 else
517 spriteBatch.Draw(checkedBox, new Vector2(topOfList.X + 218, topOfList.Y + 30), null, Color.White, 0, zero, scale, SpriteEffects.None, 1f);
518
519 if (!chatwith)
520 spriteBatch.Draw(deselectBox, new Vector2(topOfList.X + 218, topOfList.Y + 100), null, Color.White, 0, zero, scale, SpriteEffects.None, 1f);
521 else
522 spriteBatch.Draw(checkedBox, new Vector2(topOfList.X + 218, topOfList.Y + 95), null, Color.White, 0, zero, scale, SpriteEffects.None, 1f);
523
524 if (!chatwith)
525 spriteBatch.Draw(deselectBox, new Vector2(topOfList.X + 218, topOfList.Y + 165), null, Color.White, 0, zero, scale, SpriteEffects.None, 1f);
526 else
527 spriteBatch.Draw(checkedBox, new Vector2(topOfList.X + 218, topOfList.Y + 160), null, Color.White, 0, zero, scale, SpriteEffects.None, 1f);
528
529 if (!chatwith)
530 spriteBatch.Draw(deselectBox, new Vector2(topOfList.X + 218, topOfList.Y + 230), null, Color.White, 0, zero, scale, SpriteEffects.None, 1f);
531 else
532 spriteBatch.Draw(checkedBox, new Vector2(topOfList.X + 218, topOfList.Y + 225), null, Color.White, 0, zero, scale, SpriteEffects.None, 1f);
533
534
535 //draw player names
536 if (players != null)
537 {
538 for (int g = 0; g < players.Count; g++)
539 {
540 spriteBatch.DrawString(menuFont, players[g].Gamertag, new Vector2(topOfList.X + 10, topOfList.Y + 10 + 65*g), Color.White, 0f, zero, .75f, SpriteEffects.None, 1f);
541 }
542 }
543 }
544 }
545 }
This page took 0.056985 seconds and 3 git commands to generate.