From b97792f717840cb20f47d1a988c052652362c29a Mon Sep 17 00:00:00 2001 From: Miepee Date: Thu, 21 Jul 2022 14:48:35 +0200 Subject: [PATCH] Remove old fixed Eto workaround, bring back logger ref to not crash --- AM2RLauncher/AM2RLauncher.Gtk/Program.cs | 2 ++ AM2RLauncher/AM2RLauncher.Mac/Program.cs | 2 ++ AM2RLauncher/AM2RLauncher.Wpf/Program.cs | 2 ++ AM2RLauncher/AM2RLauncher/MainForm/MainForm.Events.cs | 10 +++------- AM2RLauncher/AM2RLauncherLib/Profile.cs | 1 + 5 files changed, 10 insertions(+), 7 deletions(-) diff --git a/AM2RLauncher/AM2RLauncher.Gtk/Program.cs b/AM2RLauncher/AM2RLauncher.Gtk/Program.cs index c5d24df..4138dc9 100644 --- a/AM2RLauncher/AM2RLauncher.Gtk/Program.cs +++ b/AM2RLauncher/AM2RLauncher.Gtk/Program.cs @@ -9,6 +9,8 @@ using System.Text.RegularExpressions; using AM2RLauncherLib; using Application = Eto.Forms.Application; using FileInfo = System.IO.FileInfo; +using log4net.Repository.Hierarchy; + // ReSharper disable LocalizableElement - we want hardcoded strings for console writes. namespace AM2RLauncher.Gtk; diff --git a/AM2RLauncher/AM2RLauncher.Mac/Program.cs b/AM2RLauncher/AM2RLauncher.Mac/Program.cs index f19c7b4..628edb2 100644 --- a/AM2RLauncher/AM2RLauncher.Mac/Program.cs +++ b/AM2RLauncher/AM2RLauncher.Mac/Program.cs @@ -4,6 +4,8 @@ using log4net.Config; using System; using System.IO; using AM2RLauncherLib; +using log4net.Repository.Hierarchy; + // ReSharper disable LocalizableElement - we want hardcoded strings for console writes. namespace AM2RLauncher.Mac; diff --git a/AM2RLauncher/AM2RLauncher.Wpf/Program.cs b/AM2RLauncher/AM2RLauncher.Wpf/Program.cs index abf50fd..2a3597a 100644 --- a/AM2RLauncher/AM2RLauncher.Wpf/Program.cs +++ b/AM2RLauncher/AM2RLauncher.Wpf/Program.cs @@ -4,6 +4,8 @@ using log4net.Config; using System; using System.IO; using AM2RLauncherLib; +using log4net.Repository.Hierarchy; + // ReSharper disable LocalizableElement - we want hardcoded strings for console writes. namespace AM2RLauncher.Wpf; diff --git a/AM2RLauncher/AM2RLauncher/MainForm/MainForm.Events.cs b/AM2RLauncher/AM2RLauncher/MainForm/MainForm.Events.cs index 2deca04..7a87b04 100644 --- a/AM2RLauncher/AM2RLauncher/MainForm/MainForm.Events.cs +++ b/AM2RLauncher/AM2RLauncher/MainForm/MainForm.Events.cs @@ -110,12 +110,8 @@ public partial class MainForm : Form } } - // This needs to be made invisible, otherwise a tray indicator will be visible (on linux?) that clicking crashes the application - //TODO: this sounds like an eto issue. check if this can get reproduced. - trayIndicator.Visible = false; - if (e.Cancel) - log.Info("Cancelled MainForm closing event during UpdateState." + updateState + "."); + log.Info($"Cancelled MainForm closing event during UpdateState.{updateState}."); else log.Info("Successfully closed MainForm. Exiting main thread."); } @@ -172,12 +168,12 @@ public partial class MainForm : Form MessageBox.Show(this, Text.InternetConnectionDrop, Text.WarningWindowTitle, MessageBoxType.Warning); } // Error message on protected folders. See this for more info: https://docs.microsoft.com/en-us/microsoft-365/security/defender-endpoint/controlled-folders - else if (errMessage.Contains("access is denied")) + /*else if (errMessage.Contains("access is denied")) TODO: implement this { // Needs localizable text, logging and message box // Also, check if this is the right place for it. throw new NotImplementedException(); - } + }*/ else { log.Error(ex.Message + "\n*****Stack Trace*****\n\n" + ex.StackTrace); diff --git a/AM2RLauncher/AM2RLauncherLib/Profile.cs b/AM2RLauncher/AM2RLauncherLib/Profile.cs index 74d4ba7..e8365dd 100644 --- a/AM2RLauncher/AM2RLauncherLib/Profile.cs +++ b/AM2RLauncher/AM2RLauncherLib/Profile.cs @@ -412,6 +412,7 @@ public static class Profile // Delete 1.1's data.win, we don't need it anymore! // TODO: *theoretically* if someone would make some game like serradius in gms2 and push that as a yyc am2r mod, this *will* break! + // Becauase GMS2 YYC *does* ship the data.win file, contrary to GMS1.4 File.Delete($"{profilePath}/data.win"); } else