added Player Info and changed UI Text Positions
authorBernhard Lindner <bernhard@Bernhards-MacBook-Pro.local>
Tue, 18 Dec 2018 17:09:10 +0000 (18:09 +0100)
committerBernhard Lindner <bernhard@Bernhards-MacBook-Pro.local>
Tue, 18 Dec 2018 17:09:10 +0000 (18:09 +0100)
src/full_system/ConnectionTest/ConnectionTest/ConnectionTest/PostGamePage.cs
src/full_system/ConnectionTest/ConnectionTest/ConnectionTest/PreGamePage.cs

index 3faab33..a827f62 100644 (file)
@@ -37,10 +37,13 @@ namespace Bomberman
                 new ColumnDefinition(){Width = new GridLength(1, GridUnitType.Star)},
                 new ColumnDefinition(){Width = new GridLength(1, GridUnitType.Star)},
                 new ColumnDefinition(){Width = new GridLength(1, GridUnitType.Star)},
+                new ColumnDefinition(){Width = new GridLength(1, GridUnitType.Star)},
+                new ColumnDefinition(){Width = new GridLength(1, GridUnitType.Star)},
+
             };
-            outGrid.Children.Add(new Label() { Text = "Position" }, 0, 0);
-            outGrid.Children.Add(new Label() { Text = "ID" }, 1, 0);
-            outGrid.Children.Add(new Label() { Text = "Color" }, 2, 0);
+            outGrid.Children.Add(new Label() { Text = "Position" }, 1, 0);
+            outGrid.Children.Add(new Label() { Text = "ID" }, 2, 0);
+            outGrid.Children.Add(new Label() { Text = "Color" }, 3, 0);
 
 
             innerGrid.ColumnDefinitions = new ColumnDefinitionCollection()
@@ -48,6 +51,8 @@ namespace Bomberman
                 new ColumnDefinition(){Width = new GridLength(1, GridUnitType.Star)},
                 new ColumnDefinition(){Width = new GridLength(1, GridUnitType.Star)},
                 new ColumnDefinition(){Width = new GridLength(1, GridUnitType.Star)},
+                new ColumnDefinition(){Width = new GridLength(1, GridUnitType.Star)},
+                new ColumnDefinition(){Width = new GridLength(1, GridUnitType.Star)},
             };
 
             innerGrid.RowDefinitions = new RowDefinitionCollection();
@@ -67,9 +72,20 @@ namespace Bomberman
             for (int i = 0; i < pkg.Players.Count; i++)
             {
                 innerGrid.RowDefinitions.Add(new RowDefinition() { Height = GridLength.Auto });
-                innerGrid.Children.Add(new Label() { Text = "" + (i + 1) }, 0, i);
-                innerGrid.Children.Add(new Label() { Text = "" + pkg.Players[i].Id }, 1, i);
-                innerGrid.Children.Add(new Label() { Text = playerColorText[i % 4], TextColor = PlayerColor[i % 4] }, 2, i);
+                innerGrid.Children.Add(new Label() { Text = "" + (i + 1) }, 1, i);
+                innerGrid.Children.Add(new Label() { Text = "" + pkg.Players[i].Id }, 2, i);
+
+                if (pkg.Id == pkg.Players[i].Id)
+                {
+                    innerGrid.Children.Add(new Label() { Text = playerColorText[i % 4] + " (You)", TextColor = PlayerColor[i % 4] }, 3, i);
+
+                }
+                else
+                {
+                    innerGrid.Children.Add(new Label() { Text = playerColorText[i % 4], TextColor = PlayerColor[i % 4] }, 3, i);
+                }
+
+
 
             }
 
index 547a039..75d4f36 100644 (file)
@@ -60,14 +60,18 @@ namespace Bomberman
             {
                 new ColumnDefinition(){Width = new GridLength(1, GridUnitType.Star)},
                 new ColumnDefinition(){Width = new GridLength(1, GridUnitType.Star)},
+                new ColumnDefinition(){Width = new GridLength(1, GridUnitType.Star)},
+                new ColumnDefinition(){Width = new GridLength(1, GridUnitType.Star)},
             };
-            outGrid.Children.Add(new Label() { Text = "ID" }, 0, 0);
-            outGrid.Children.Add(new Label() { Text = "Color" }, 1, 0);
+            outGrid.Children.Add(new Label() { Text = "ID" }, 1, 0);
+            outGrid.Children.Add(new Label() { Text = "Color" }, 2, 0);
 
             innerGrid.ColumnDefinitions = new ColumnDefinitionCollection()
             {
                 new ColumnDefinition(){Width = new GridLength(1, GridUnitType.Star)},
                 new ColumnDefinition(){Width = new GridLength(1, GridUnitType.Star)},
+                new ColumnDefinition(){Width = new GridLength(1, GridUnitType.Star)},
+                new ColumnDefinition(){Width = new GridLength(1, GridUnitType.Star)},
             };
 
             innerGrid.RowDefinitions = new RowDefinitionCollection();
@@ -97,10 +101,16 @@ namespace Bomberman
             for (int i = 0; i < pkg.Players.Count; i++)
             {
                 innerGrid.RowDefinitions.Add(new RowDefinition() { Height = GridLength.Auto });
-                innerGrid.Children.Add(new Label() { Text = "" + pkg.Players[i].Id }, 0, i);
-                innerGrid.Children.Add(new Label() { Text = playerColorText[i%4], TextColor = PlayerColor[i%4] }, 1, i);
-                //innerGrid.Children.Add(new Label() { Text = "Color-Value", TextColor = Color.Yellow }, 1, i);
-                //innerGrid.Children.Add(colorLable[(i % 4)], 1, i);
+                innerGrid.Children.Add(new Label() { Text = "" + pkg.Players[i].Id }, 1, i);
+
+                if (pkg.Id == pkg.Players[i].Id)
+                {
+                    innerGrid.Children.Add(new Label() { Text = playerColorText[i % 4] + " (You)", TextColor = PlayerColor[i % 4] }, 2, i);
+                }
+                else
+                {
+                    innerGrid.Children.Add(new Label() { Text = playerColorText[i % 4], TextColor = PlayerColor[i % 4] }, 2, i);
+                }
             }
 
             scrollView.Content = innerGrid;