{\r
public class lobbyGUI\r
{\r
+ float scale;\r
+\r
Texture2D background;\r
Texture2D spotLight;\r
Texture2D cs;\r
int MaxY;\r
int MinY;\r
\r
+ Texture2D checkedBox;\r
+ Texture2D deselectBox;\r
+ Texture2D emptySelectBox;\r
+ Texture2D menuItem;\r
+\r
+ Boolean ready;\r
+\r
SpriteFont menuFont;\r
string selected;\r
Vector2 createGamePos;\r
MaxY = graphics.GraphicsDevice.Viewport.Height;\r
MinY = 100;\r
\r
+ scale = MaxX / 1600f;\r
+ //playerlist stuff\r
+ checkedBox = contentManager.Load<Texture2D>("checkedBox");\r
+ deselectBox = contentManager.Load<Texture2D>("deselectBox");\r
+ emptySelectBox = contentManager.Load<Texture2D>("emptySelectBox");\r
+ menuItem = contentManager.Load<Texture2D>("menuItem");\r
+\r
+ ready = false;\r
+\r
//menu fonts\r
menuFont = contentManager.Load<SpriteFont>("menuFont");\r
createGamePos = new Vector2(100f, MaxY / 3);\r
\r
returnToMainPos = new Vector2(MaxX / 2, MaxY - 120);\r
returnToMainText = "press [ X ] to return to main menu";\r
+\r
+\r
}\r
\r
public void UnloadContent()\r
break;\r
case lobbyState.CreateGame:\r
if (currentKeyboardState.IsKeyDown(Keys.X) && previousKeyboardState.IsKeyUp(Keys.X))\r
+ {\r
currentState = lobbyState.Welcome;\r
-\r
+ ready = false;\r
+ }\r
+ if (currentKeyboardState.IsKeyDown(Keys.R) && previousKeyboardState.IsKeyUp(Keys.R))\r
+ ready = true;\r
break;\r
case lobbyState.FindGame:\r
if (currentKeyboardState.IsKeyDown(Keys.X) && previousKeyboardState.IsKeyUp(Keys.X))\r
+ {\r
currentState = lobbyState.Welcome;\r
+ ready = false;\r
+ }\r
\r
break;\r
case lobbyState.Connected:\r
if (currentKeyboardState.IsKeyDown(Keys.X) && previousKeyboardState.IsKeyUp(Keys.X))\r
currentState = lobbyState.Welcome;\r
-\r
+ if (currentKeyboardState.IsKeyDown(Keys.R) && previousKeyboardState.IsKeyUp(Keys.R))\r
+ ready = true;\r
break;\r
\r
}\r
/// </summary>\r
public long Draw(SpriteBatch spriteBatch)\r
{\r
- spriteBatch.Draw(background, backgroundPos, null, Color.White, 0, zero, 0.5f, SpriteEffects.None, 0);\r
+ spriteBatch.Draw(background, backgroundPos, null, Color.White, 0, zero, scale, SpriteEffects.None, 0);\r
spriteBatch.Draw(cs, csPos, null, Color.White, 0, zero, 0.5f, SpriteEffects.None, 0);\r
spriteBatch.Draw(spotLight, spotLightPos, null, Color.White, 0, spotLightCenter, 1f, SpriteEffects.None, 0);\r
switch (currentState)\r
break;\r
\r
case lobbyState.CreateGame:\r
- \r
+ DrawPlayerList(spriteBatch);\r
+\r
break;\r
case lobbyState.FindGame:\r
- spriteBatch.Draw(selectGameScreen, backgroundPos, null, Color.White, 0, zero, 0.5f, SpriteEffects.None, 0);\r
+ spriteBatch.Draw(selectGameScreen, backgroundPos, null, Color.White, 0, zero, scale, SpriteEffects.None, 0);\r
//spriteBatch.DrawString(menuFont, "Select Game", new Vector2(100, 100), Color.Gray, 0, zero, 1f, SpriteEffects.None, 0.5f);\r
\r
//spriteBatch.DrawString(menuFont, returnToMainText, returnToMainPos, Color.Gray, 0, new Vector2(180 , 0), .6f, SpriteEffects.None, 0.5f);\r
break;\r
case lobbyState.Connected:\r
- \r
+ DrawPlayerList(spriteBatch);\r
break;\r
}\r
\r
spotLightVelocity = new Vector2(spotLightVelocity.X, spotLightVelocity.Y * -1);\r
}\r
}\r
+\r
+\r
+ private void DrawPlayerList(SpriteBatch spriteBatch)\r
+ {\r
+ \r
+ Vector2 topOfList = new Vector2(MaxX / 8, MaxY / 4);\r
+ spriteBatch.DrawString(menuFont, "Current Players", new Vector2(topOfList.X + 15, topOfList.Y - 25), Color.White);\r
+ \r
+ //top player\r
+ spriteBatch.Draw(menuItem, topOfList, null, Color.White, 0, zero, scale, SpriteEffects.None, 1f);\r
+ spriteBatch.DrawString(menuFont, "****Player 1****", new Vector2(topOfList.X + 10, topOfList.Y + 10), Color.White, 0f, zero, .75f, SpriteEffects.None, 1f);\r
+ spriteBatch.DrawString(menuFont, "Ready", new Vector2(topOfList.X + 5, topOfList.Y + 45), Color.DarkGray, 0f, zero, .6f, SpriteEffects.None, 1f);\r
+ if(!ready)\r
+ spriteBatch.Draw(emptySelectBox, new Vector2(topOfList.X - 32, topOfList.Y + 35), null, Color.White, 0, zero, scale, SpriteEffects.None, 1f);\r
+ else\r
+ spriteBatch.Draw(checkedBox, new Vector2(topOfList.X - 32, topOfList.Y + 30), null, Color.White, 0, zero, scale, SpriteEffects.None, 1f);\r
+ \r
+ spriteBatch.DrawString(menuFont, "Chat with", new Vector2(topOfList.X + 152, topOfList.Y + 45), Color.DarkGray, 0f, zero, .6f, SpriteEffects.None, 1f);\r
+ Boolean chatwith = false; // change to reflect info from network, move to update and create one for each player\r
+ if (!chatwith)\r
+ spriteBatch.Draw(deselectBox, new Vector2(topOfList.X +218, topOfList.Y + 35), null, Color.White, 0, zero, scale, SpriteEffects.None, 1f);\r
+ else\r
+ spriteBatch.Draw(checkedBox, new Vector2(topOfList.X + 218, topOfList.Y + 30), null, Color.White, 0, zero, scale, SpriteEffects.None, 1f);\r
+\r
+ //player 2\r
+ spriteBatch.Draw(menuItem, new Vector2(topOfList.X, topOfList.Y + 65), null, Color.White, 0, zero, scale, SpriteEffects.None, 1f);\r
+ spriteBatch.DrawString(menuFont, "****Player 1****", new Vector2(topOfList.X + 10, topOfList.Y + 75), Color.White, 0f, zero, .75f, SpriteEffects.None, 1f);\r
+ spriteBatch.DrawString(menuFont, "Ready", new Vector2(topOfList.X + 5, topOfList.Y + 110), Color.DarkGray, 0f, zero, .6f, SpriteEffects.None, 1f);\r
+ if (!ready)\r
+ spriteBatch.Draw(emptySelectBox, new Vector2(topOfList.X - 32, topOfList.Y + 100), null, Color.White, 0, zero, scale, SpriteEffects.None, 1f);\r
+ else\r
+ spriteBatch.Draw(checkedBox, new Vector2(topOfList.X - 32, topOfList.Y + 95), null, Color.White, 0, zero, scale, SpriteEffects.None, 1f);\r
+\r
+ spriteBatch.DrawString(menuFont, "Chat with", new Vector2(topOfList.X + 152, topOfList.Y + 110), Color.DarkGray, 0f, zero, .6f, SpriteEffects.None, 1f);\r
+ // change to reflect info from network\r
+ if (!chatwith)\r
+ spriteBatch.Draw(deselectBox, new Vector2(topOfList.X + 218, topOfList.Y + 100), null, Color.White, 0, zero, scale, SpriteEffects.None, 1f);\r
+ else\r
+ spriteBatch.Draw(checkedBox, new Vector2(topOfList.X + 218, topOfList.Y + 95), null, Color.White, 0, zero, scale, SpriteEffects.None, 1f);\r
+ \r
+ //player 3\r
+ spriteBatch.Draw(menuItem, new Vector2(topOfList.X, topOfList.Y + 130), null, Color.White, 0, zero, scale, SpriteEffects.None, 1f);\r
+ spriteBatch.DrawString(menuFont, "****Player 1****", new Vector2(topOfList.X + 10, topOfList.Y + 140), Color.White, 0f, zero, .75f, SpriteEffects.None, 1f);\r
+ spriteBatch.DrawString(menuFont, "Ready", new Vector2(topOfList.X + 5, topOfList.Y + 175), Color.DarkGray, 0f, zero, .6f, SpriteEffects.None, 1f);\r
+ if (!ready)\r
+ spriteBatch.Draw(emptySelectBox, new Vector2(topOfList.X - 32, topOfList.Y + 165), null, Color.White, 0, zero, scale, SpriteEffects.None, 1f);\r
+ else\r
+ spriteBatch.Draw(checkedBox, new Vector2(topOfList.X - 32, topOfList.Y + 160), null, Color.White, 0, zero, scale, SpriteEffects.None, 1f);\r
+\r
+ spriteBatch.DrawString(menuFont, "Chat with", new Vector2(topOfList.X + 152, topOfList.Y + 175), Color.DarkGray, 0f, zero, .6f, SpriteEffects.None, 1f);\r
+ \r
+ if (!chatwith)\r
+ spriteBatch.Draw(deselectBox, new Vector2(topOfList.X + 218, topOfList.Y + 165), null, Color.White, 0, zero, scale, SpriteEffects.None, 1f);\r
+ else\r
+ spriteBatch.Draw(checkedBox, new Vector2(topOfList.X + 218, topOfList.Y + 160), null, Color.White, 0, zero, scale, SpriteEffects.None, 1f);\r
+ \r
+ //player 4\r
+ spriteBatch.Draw(menuItem, new Vector2(topOfList.X, topOfList.Y + 195), null, Color.White, 0, zero, scale, SpriteEffects.None, 1f);\r
+ spriteBatch.DrawString(menuFont, "****Player 1****", new Vector2(topOfList.X + 10, topOfList.Y + 205), Color.White, 0f, zero, .75f, SpriteEffects.None, 1f);\r
+ spriteBatch.DrawString(menuFont, "Ready", new Vector2(topOfList.X + 5, topOfList.Y + 240), Color.DarkGray, 0f, zero, .6f, SpriteEffects.None, 1f);\r
+ if (!ready)\r
+ spriteBatch.Draw(emptySelectBox, new Vector2(topOfList.X - 32, topOfList.Y + 230), null, Color.White, 0, zero, scale, SpriteEffects.None, 1f);\r
+ else\r
+ spriteBatch.Draw(checkedBox, new Vector2(topOfList.X - 32, topOfList.Y + 225), null, Color.White, 0, zero, scale, SpriteEffects.None, 1f);\r
+\r
+ spriteBatch.DrawString(menuFont, "Chat with", new Vector2(topOfList.X + 152, topOfList.Y + 240), Color.DarkGray, 0f, zero, .6f, SpriteEffects.None, 1f);\r
+ if (!chatwith)\r
+ spriteBatch.Draw(deselectBox, new Vector2(topOfList.X + 218, topOfList.Y + 230), null, Color.White, 0, zero, scale, SpriteEffects.None, 1f);\r
+ else\r
+ spriteBatch.Draw(checkedBox, new Vector2(topOfList.X + 218, topOfList.Y + 225), null, Color.White, 0, zero, scale, SpriteEffects.None, 1f);\r
+ \r
+ }\r
}\r
}\r