]> Dogcows Code - chaz/carfire/commitdiff
player list graphics and stuff added
authorbrady <brady@92bb83a3-7c8f-8a45-bc97-515c4e399668>
Fri, 19 Mar 2010 07:43:26 +0000 (07:43 +0000)
committerbrady <brady@92bb83a3-7c8f-8a45-bc97-515c4e399668>
Fri, 19 Mar 2010 07:43:26 +0000 (07:43 +0000)
git-svn-id: https://bd85.net/svn/cs3505_group@11 92bb83a3-7c8f-8a45-bc97-515c4e399668

Project06/lobbyTest/lobbyTest/Content/Content.contentproj
Project06/lobbyTest/lobbyTest/Content/background.png [deleted file]
Project06/lobbyTest/lobbyTest/Content/checkedBox.png [new file with mode: 0644]
Project06/lobbyTest/lobbyTest/Content/deselectBox.png [new file with mode: 0644]
Project06/lobbyTest/lobbyTest/Content/emptySelectBox.png [new file with mode: 0644]
Project06/lobbyTest/lobbyTest/Content/menuItem.png [new file with mode: 0644]
Project06/lobbyTest/lobbyTest/LobbyGUI.cs

index 6305bbe9c4fdc2240180418f2a2adc4ca53c6ba7..9877d52f792f86d227ee1c95c93b25526a773c7c 100644 (file)
       <Private>False</Private>\r
     </Reference>\r
   </ItemGroup>\r
-  <ItemGroup>\r
-    <Compile Include="background.png">\r
-      <Name>background</Name>\r
-      <Importer>TextureImporter</Importer>\r
-      <Processor>TextureProcessor</Processor>\r
-    </Compile>\r
-  </ItemGroup>\r
   <ItemGroup>\r
     <Compile Include="cs.png">\r
       <Name>cs</Name>\r
       <Processor>TextureProcessor</Processor>\r
     </Compile>\r
   </ItemGroup>\r
+  <ItemGroup>\r
+    <Compile Include="background.png">\r
+      <Name>background</Name>\r
+      <Importer>TextureImporter</Importer>\r
+      <Processor>TextureProcessor</Processor>\r
+    </Compile>\r
+  </ItemGroup>\r
+  <ItemGroup>\r
+    <Compile Include="checkedBox.png">\r
+      <Name>checkedBox</Name>\r
+      <Importer>TextureImporter</Importer>\r
+      <Processor>TextureProcessor</Processor>\r
+    </Compile>\r
+  </ItemGroup>\r
+  <ItemGroup>\r
+    <Compile Include="deselectBox.png">\r
+      <Name>deselectBox</Name>\r
+      <Importer>TextureImporter</Importer>\r
+      <Processor>TextureProcessor</Processor>\r
+    </Compile>\r
+  </ItemGroup>\r
+  <ItemGroup>\r
+    <Compile Include="emptySelectBox.png">\r
+      <Name>emptySelectBox</Name>\r
+      <Importer>TextureImporter</Importer>\r
+      <Processor>TextureProcessor</Processor>\r
+    </Compile>\r
+  </ItemGroup>\r
+  <ItemGroup>\r
+    <Compile Include="menuItem.png">\r
+      <Name>menuItem</Name>\r
+      <Importer>TextureImporter</Importer>\r
+      <Processor>TextureProcessor</Processor>\r
+    </Compile>\r
+  </ItemGroup>\r
   <Import Project="$(MSBuildExtensionsPath)\Microsoft\XNA Game Studio\v3.0\Microsoft.Xna.GameStudio.ContentPipeline.targets" />\r
   <!-- To modify your build process, add your task inside one of the targets below and uncomment it. \r
        Other similar extension points exist, see Microsoft.Common.targets.\r
diff --git a/Project06/lobbyTest/lobbyTest/Content/background.png b/Project06/lobbyTest/lobbyTest/Content/background.png
deleted file mode 100644 (file)
index 4f6616a..0000000
Binary files a/Project06/lobbyTest/lobbyTest/Content/background.png and /dev/null differ
diff --git a/Project06/lobbyTest/lobbyTest/Content/checkedBox.png b/Project06/lobbyTest/lobbyTest/Content/checkedBox.png
new file mode 100644 (file)
index 0000000..3462dc3
Binary files /dev/null and b/Project06/lobbyTest/lobbyTest/Content/checkedBox.png differ
diff --git a/Project06/lobbyTest/lobbyTest/Content/deselectBox.png b/Project06/lobbyTest/lobbyTest/Content/deselectBox.png
new file mode 100644 (file)
index 0000000..cb4d2d0
Binary files /dev/null and b/Project06/lobbyTest/lobbyTest/Content/deselectBox.png differ
diff --git a/Project06/lobbyTest/lobbyTest/Content/emptySelectBox.png b/Project06/lobbyTest/lobbyTest/Content/emptySelectBox.png
new file mode 100644 (file)
index 0000000..5373a1b
Binary files /dev/null and b/Project06/lobbyTest/lobbyTest/Content/emptySelectBox.png differ
diff --git a/Project06/lobbyTest/lobbyTest/Content/menuItem.png b/Project06/lobbyTest/lobbyTest/Content/menuItem.png
new file mode 100644 (file)
index 0000000..cf45ebd
Binary files /dev/null and b/Project06/lobbyTest/lobbyTest/Content/menuItem.png differ
index a5f3c5cc6045643c17e72b56d8bc8a6cf79ee2b3..49702d585ba152bf07461cc7b49c4d73ccc44f03 100644 (file)
@@ -11,6 +11,8 @@ namespace lobbyTest
 {\r
     public class lobbyGUI\r
     {\r
+        float scale;\r
+\r
         Texture2D background;\r
         Texture2D spotLight;\r
         Texture2D cs;\r
@@ -29,6 +31,13 @@ namespace lobbyTest
         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
@@ -76,6 +85,15 @@ namespace lobbyTest
             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
@@ -87,6 +105,8 @@ namespace lobbyTest
 \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
@@ -119,18 +139,26 @@ namespace lobbyTest
                     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
@@ -144,7 +172,7 @@ namespace lobbyTest
         /// </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
@@ -162,16 +190,17 @@ namespace lobbyTest
                     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
@@ -192,5 +221,77 @@ namespace lobbyTest
                 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
This page took 0.037895 seconds and 4 git commands to generate.