diff --git a/WeeXnes/App.xaml.cs b/WeeXnes/App.xaml.cs index adaa07d..443d901 100644 --- a/WeeXnes/App.xaml.cs +++ b/WeeXnes/App.xaml.cs @@ -42,6 +42,7 @@ namespace WeeXnes { Environment.CurrentDirectory = Application.StartupPath; Console.Data.Colors.colored_output = false; + Console.Data.Formatting.timestamp_prefix = true; SetExceptionHandler(); CheckForDebugMode(); CheckUpdatedFiles(); diff --git a/WeeXnes/Core/Console.cs b/WeeXnes/Core/Console.cs index 8d2144c..e823cba 100644 --- a/WeeXnes/Core/Console.cs +++ b/WeeXnes/Core/Console.cs @@ -25,6 +25,7 @@ namespace WeeXnes.Core public static class Formatting { + public static bool timestamp_prefix = false; public static string success_char = "✓"; public static string warning_char = "⌬"; public static string info_char = "◈"; @@ -47,7 +48,9 @@ namespace WeeXnes.Core VanillaConsole.BackgroundColor = color; VanillaConsole.ForegroundColor = foregroundColor; } - + DateTime currentTime = DateTime.Now; + if (Data.Formatting.timestamp_prefix) + text = currentTime.ToString("[HH:mm:ss]") + text; VanillaConsole.WriteLine(text + " "); if (Data.Colors.colored_output) { diff --git a/WeeXnes/Core/Global.cs b/WeeXnes/Core/Global.cs index 1a9aec2..273648c 100644 --- a/WeeXnes/Core/Global.cs +++ b/WeeXnes/Core/Global.cs @@ -8,7 +8,7 @@ namespace WeeXnes.Core { public class Information { - public const string Version = "4.5.1.1"; + public const string Version = "4.5.1.2"; public const string EncryptionHash = "8zf5#RdyQ]$4x4_"; public const string ApiUrl = "https://api.github.com/repos/weexnes/weexnessuite/releases/latest"; } diff --git a/WeeXnes/Core/HandleLaunchArguments.cs b/WeeXnes/Core/HandleLaunchArguments.cs index e5f05ab..10047db 100644 --- a/WeeXnes/Core/HandleLaunchArguments.cs +++ b/WeeXnes/Core/HandleLaunchArguments.cs @@ -1,6 +1,7 @@ using System; using System.Net; using System.Runtime.InteropServices; +using System.Text; using System.Windows; namespace WeeXnes.Core diff --git a/WeeXnes/Core/LoginLib.cs b/WeeXnes/Core/LoginLib.cs index 7ad7d19..129dda8 100644 --- a/WeeXnes/Core/LoginLib.cs +++ b/WeeXnes/Core/LoginLib.cs @@ -41,13 +41,16 @@ namespace WeeXnes.Core this.ExceptionCache.Value = ex; } }; - this._loginWorker.RunWorkerCompleted += (sender, args) => - { - Console.WriteLine("LoginWorker complete"); - }; + this._loginWorker.RunWorkerCompleted += LoginWorkerOnRunWorkerCompleted; this._loginUrl = loginUrl; this._userDataUrl = userDataUrl; } + + private void LoginWorkerOnRunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e) + { + Console.WriteLine("LoginWorker complete"); + } + public string Login(string email, string password) { if (String.IsNullOrEmpty(email)) diff --git a/WeeXnes/MainWindow.xaml.cs b/WeeXnes/MainWindow.xaml.cs index 80dd627..ef56f1c 100644 --- a/WeeXnes/MainWindow.xaml.cs +++ b/WeeXnes/MainWindow.xaml.cs @@ -1,4 +1,5 @@ using System; +using System.Text; using System.Windows; using WeeXnes.Core; using ButtonBase = System.Windows.Controls.Primitives.ButtonBase; diff --git a/WeeXnes/Views/ProfileView/ProfileView.xaml.cs b/WeeXnes/Views/ProfileView/ProfileView.xaml.cs index f157ed5..b49dc10 100644 --- a/WeeXnes/Views/ProfileView/ProfileView.xaml.cs +++ b/WeeXnes/Views/ProfileView/ProfileView.xaml.cs @@ -22,9 +22,9 @@ namespace WeeXnes.Views.ProfileView auth.ExceptionCache.ValueChanged += LoginWorkerException; auth._currentUserCache.ValueChanged += userCacheChanged; LoginView.errorStringCache.ValueChanged += errorStringChanged; + Console.WriteLine("Event hooks loaded"); Console.WriteLine("Error Hooks loaded"); - Console.WriteLine("Event hooks loaded"); if (auth._currentUserCache.Value == null) { LoadingScreen.Visibility = Visibility.Visible; @@ -84,6 +84,7 @@ namespace WeeXnes.Views.ProfileView LoginView.errorStringCache.ValueChanged -= errorStringChanged; Console.WriteLine("Event hooks unloaded"); + Console.WriteLine("Error hooks unloaded"); } private void errorStringChanged() { diff --git a/WeeXnes/Views/Settings/SettingsView.xaml.cs b/WeeXnes/Views/Settings/SettingsView.xaml.cs index d2a4110..a1c5bdf 100644 --- a/WeeXnes/Views/Settings/SettingsView.xaml.cs +++ b/WeeXnes/Views/Settings/SettingsView.xaml.cs @@ -55,7 +55,7 @@ namespace WeeXnes.Views.Settings private void ButtonCheckForUpdates_OnClick(object sender, RoutedEventArgs e) { - + Console.WriteLine("Checking for Updates..."); try { using(WebClient webClient = new WebClient()) @@ -66,9 +66,14 @@ namespace WeeXnes.Views.Settings GithubApiResponse apiResponseData = JsonConvert.DeserializeObject(downloadString); if (apiResponseData.tag_name != Information.Version) { + Console.WriteLine("Update found"); UpdateFoundView.Data.updateResponse = apiResponseData; NavigationService.Navigate(new Uri("/Views/Settings/UpdateFoundView.xaml",UriKind.Relative)); } + else + { + Console.WriteLine("No Update found"); + } } } catch (Exception ex) @@ -87,7 +92,7 @@ namespace WeeXnes.Views.Settings } catch (Exception ex) { - MessageBox.Show(ex.Message); + Console.Error(ex.Message); } } @@ -100,7 +105,7 @@ namespace WeeXnes.Views.Settings } catch (Exception ex) { - MessageBox.Show(ex.Message); + Console.Error(ex.Message); } } @@ -113,7 +118,7 @@ namespace WeeXnes.Views.Settings } catch (Exception ex) { - MessageBox.Show(ex.Message); + Console.Error(ex.Message); } } @@ -144,11 +149,13 @@ namespace WeeXnes.Views.Settings private void dbg_throwException(object sender, RoutedEventArgs e) { + Console.Warning("Creating ArithmeticException for Debugging"); Functions.ThrowTestException(new ArithmeticException()); } private void TimedShutdown_OnClick(object sender, RoutedEventArgs e) { + Console.WriteLine("Setting timed shutdown in " + (Convert.ToInt32(ShutdownTimer.Value)) + "mins"); System.Diagnostics.Process process = new System.Diagnostics.Process(); System.Diagnostics.ProcessStartInfo startInfo = new System.Diagnostics.ProcessStartInfo(); startInfo.WindowStyle = System.Diagnostics.ProcessWindowStyle.Hidden; @@ -160,6 +167,7 @@ namespace WeeXnes.Views.Settings private void ResetShutdown_OnClick(object sender, RoutedEventArgs e) { + Console.WriteLine("Canceling timed shutdown"); System.Diagnostics.Process process = new System.Diagnostics.Process(); System.Diagnostics.ProcessStartInfo startInfo = new System.Diagnostics.ProcessStartInfo(); startInfo.WindowStyle = System.Diagnostics.ProcessWindowStyle.Hidden; diff --git a/WeeXnes/WeeXnes.csproj b/WeeXnes/WeeXnes.csproj index 728b63b..70a22f2 100644 --- a/WeeXnes/WeeXnes.csproj +++ b/WeeXnes/WeeXnes.csproj @@ -4,7 +4,7 @@ Debug AnyCPU - 4.5.1.1 + 4.5.1.2 {4B33CEE7-C74D-43B9-B99A-8B273D5195BC} WinExe WeeXnes