diff --git a/YJMPD-UWP/Helpers/Extensions.cs b/YJMPD-UWP/Helpers/Extensions.cs
index c017007..8b35c03 100644
--- a/YJMPD-UWP/Helpers/Extensions.cs
+++ b/YJMPD-UWP/Helpers/Extensions.cs
@@ -13,5 +13,16 @@ namespace YJMPD_UWP.Helpers
(token.Type == JTokenType.String && token.ToString() == String.Empty) ||
(token.Type == JTokenType.Null);
}
+
+ public static string UppercaseFirst(this string s)
+ {
+ // Check for empty string.
+ if (string.IsNullOrEmpty(s))
+ {
+ return string.Empty;
+ }
+ // Return char and concat substring.
+ return char.ToUpper(s[0]) + s.Substring(1).ToLower();
+ }
}
}
diff --git a/YJMPD-UWP/MainPage.xaml b/YJMPD-UWP/MainPage.xaml
index c318e39..c721c11 100644
--- a/YJMPD-UWP/MainPage.xaml
+++ b/YJMPD-UWP/MainPage.xaml
@@ -20,12 +20,12 @@
@@ -35,15 +35,19 @@
+
@@ -99,12 +103,19 @@
-
+
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
@@ -115,18 +126,14 @@
-
-
-
-
-
-
+
+
-
+
diff --git a/YJMPD-UWP/Model/ApiHandler.cs b/YJMPD-UWP/Model/ApiHandler.cs
index f47e3e2..f79b235 100644
--- a/YJMPD-UWP/Model/ApiHandler.cs
+++ b/YJMPD-UWP/Model/ApiHandler.cs
@@ -36,7 +36,6 @@ namespace YJMPD_UWP.Model
public void HandleMessage(JObject o)
{
- Debug.WriteLine(o.ToString());
Command c = (Command)Enum.Parse(typeof(Command), o["command"].ToString());
switch (c)
diff --git a/YJMPD-UWP/Model/NetworkHandler.cs b/YJMPD-UWP/Model/NetworkHandler.cs
index a72c447..0b2bcf8 100644
--- a/YJMPD-UWP/Model/NetworkHandler.cs
+++ b/YJMPD-UWP/Model/NetworkHandler.cs
@@ -50,7 +50,11 @@ namespace YJMPD_UWP.Model
if (Status != NetworkStatus.CONNECTED)
return "error";
- return await din.ReadLineAsync();
+ string data = await din.ReadLineAsync();
+
+ Debug.WriteLine("Receiving -> " + data);
+
+ return data;
}
public async Task Write(string data)
@@ -58,7 +62,7 @@ namespace YJMPD_UWP.Model
if (Status != NetworkStatus.CONNECTED)
return false;
- Debug.WriteLine(data);
+ Debug.WriteLine("Sending -> " + data);
dout.WriteString(data + Environment.NewLine);
await dout.StoreAsync();
@@ -98,7 +102,6 @@ namespace YJMPD_UWP.Model
while (running)
{
- Debug.WriteLine("Awaiting incoming data... " + workItem.Status.ToString());
string data = "";
diff --git a/YJMPD-UWP/ViewModels/MainPageVM.cs b/YJMPD-UWP/ViewModels/MainPageVM.cs
index 0993326..2102c77 100644
--- a/YJMPD-UWP/ViewModels/MainPageVM.cs
+++ b/YJMPD-UWP/ViewModels/MainPageVM.cs
@@ -1,4 +1,5 @@
using System;
+using YJMPD_UWP.Helpers;
namespace YJMPD_UWP.ViewModels
{
@@ -31,7 +32,7 @@ namespace YJMPD_UWP.ViewModels
{
get
{
- return App.Game.Status.ToString();
+ return App.Game.Status.ToString().UppercaseFirst();
}
}
@@ -39,7 +40,10 @@ namespace YJMPD_UWP.ViewModels
{
get
{
- return App.Game.Players.Count + " players";
+ if (App.Game.Players.Count == 1)
+ return "1 player";
+ else
+ return App.Game.Players.Count + " players";
}
}