From dd0e691525cc4a51c98334e4b874f79ac3aecd95 Mon Sep 17 00:00:00 2001 From: Miepee Date: Mon, 29 Aug 2022 21:49:19 +0200 Subject: [PATCH] Add warning for com-upd. shortcuts, fix disable state for it --- AM2RLauncher/AM2RLauncher/Language/Text.Designer.cs | 6 ++++++ AM2RLauncher/AM2RLauncher/Language/Text.de.resx | 6 +++++- AM2RLauncher/AM2RLauncher/Language/Text.es.resx | 4 ++++ AM2RLauncher/AM2RLauncher/Language/Text.ja.resx | 4 ++++ AM2RLauncher/AM2RLauncher/Language/Text.resx | 4 ++++ AM2RLauncher/AM2RLauncher/Language/Text.ru.resx | 4 ++++ .../AM2RLauncher/Language/Text.zh-Hans.resx | 4 ++++ .../AM2RLauncher/MainForm/MainForm.Events.cs | 13 +++++++++++-- .../AM2RLauncher/MainForm/MainForm.StateMachine.cs | 1 + AM2RLauncher/AM2RLauncher/MainForm/MainForm.UI.cs | 1 + 10 files changed, 44 insertions(+), 3 deletions(-) diff --git a/AM2RLauncher/AM2RLauncher/Language/Text.Designer.cs b/AM2RLauncher/AM2RLauncher/Language/Text.Designer.cs index 9344aa7..e72af81 100644 --- a/AM2RLauncher/AM2RLauncher/Language/Text.Designer.cs +++ b/AM2RLauncher/AM2RLauncher/Language/Text.Designer.cs @@ -584,5 +584,11 @@ namespace AM2RLauncher.Language { return ResourceManager.GetString("CreateShortcut", resourceCulture); } } + + public static string ShortcutWarning { + get { + return ResourceManager.GetString("ShortcutWarning", resourceCulture); + } + } } } diff --git a/AM2RLauncher/AM2RLauncher/Language/Text.de.resx b/AM2RLauncher/AM2RLauncher/Language/Text.de.resx index 7b9b111..f569841 100644 --- a/AM2RLauncher/AM2RLauncher/Language/Text.de.resx +++ b/AM2RLauncher/AM2RLauncher/Language/Text.de.resx @@ -387,6 +387,10 @@ Bitte äußerste Vorsicht walten lassen. Der offizielle AM2R Matrix Space - DESKTOPVERKNÜPFUNG ERTELLEN + DESKTOPVERKNÜPFUNG ERSTELLEN + + + Das Starten der Community Updates durch Verknüpfungen umgeht den Launcher und dadurch auch automatische Updates. +Das Updaten von AM2R oder des Launchers kann nur durch das direkte Starten des Launchers passieren! \ No newline at end of file diff --git a/AM2RLauncher/AM2RLauncher/Language/Text.es.resx b/AM2RLauncher/AM2RLauncher/Language/Text.es.resx index f4a51e4..64202bd 100644 --- a/AM2RLauncher/AM2RLauncher/Language/Text.es.resx +++ b/AM2RLauncher/AM2RLauncher/Language/Text.es.resx @@ -389,4 +389,8 @@ Procede con cautela. CREAR ACCESO DIRECTO EN EL ESCRITORIO + + ¡Ejecutar las Actualizaciones de la Comunidad desde el acceso directo ignorará el Launcher evitando actualizaciones automáticas! +¡AM2R y el Launcher solo pueden actualizarse abriendo el Launcher directamente! + \ No newline at end of file diff --git a/AM2RLauncher/AM2RLauncher/Language/Text.ja.resx b/AM2RLauncher/AM2RLauncher/Language/Text.ja.resx index 084b650..52818c4 100644 --- a/AM2RLauncher/AM2RLauncher/Language/Text.ja.resx +++ b/AM2RLauncher/AM2RLauncher/Language/Text.ja.resx @@ -389,4 +389,8 @@ ショートカットをデスクトップに作成 + + ショートカットからコミュニティアップデートを起動するとランチャーがパスされるため自動更新されません。 +AM2Rやランチャーの更新は、ランチャーを直接起動することで実行されます。 + \ No newline at end of file diff --git a/AM2RLauncher/AM2RLauncher/Language/Text.resx b/AM2RLauncher/AM2RLauncher/Language/Text.resx index 25b0c47..6ca35d6 100644 --- a/AM2RLauncher/AM2RLauncher/Language/Text.resx +++ b/AM2RLauncher/AM2RLauncher/Language/Text.resx @@ -391,4 +391,8 @@ Proceed with caution. CREATE SHORTCUT ON DESKTOP + + Launching the Community Updates through the shortcut will bypass the Launcher and thus avoid automatic updates! +Updating AM2R or the Launcher can only be done by opening the Launcher directly! + \ No newline at end of file diff --git a/AM2RLauncher/AM2RLauncher/Language/Text.ru.resx b/AM2RLauncher/AM2RLauncher/Language/Text.ru.resx index 683c377..bb34614 100644 --- a/AM2RLauncher/AM2RLauncher/Language/Text.ru.resx +++ b/AM2RLauncher/AM2RLauncher/Language/Text.ru.resx @@ -389,4 +389,8 @@ СОЗДАТЬ ЯРЛЫК НА РАБОЧЕМ СТОЛЕ + + Запуск обновлений сообщества через ярлык проигнорирует автоматические обновления лаунчера! +Обновить AM2R и лаунчер можно только открыв лаунчер напрямую! + \ No newline at end of file diff --git a/AM2RLauncher/AM2RLauncher/Language/Text.zh-Hans.resx b/AM2RLauncher/AM2RLauncher/Language/Text.zh-Hans.resx index ca5b963..259b243 100644 --- a/AM2RLauncher/AM2RLauncher/Language/Text.zh-Hans.resx +++ b/AM2RLauncher/AM2RLauncher/Language/Text.zh-Hans.resx @@ -391,4 +391,8 @@ 创建桌面快捷方式 + + 通过快捷方式运行社区更新版本,将会绕过启动器从而避免自动更新! +更新 AM2R 或者启动器只能通过直接打开启动器来完成! + \ No newline at end of file diff --git a/AM2RLauncher/AM2RLauncher/MainForm/MainForm.Events.cs b/AM2RLauncher/AM2RLauncher/MainForm/MainForm.Events.cs index 2db4038..e3e45d2 100644 --- a/AM2RLauncher/AM2RLauncher/MainForm/MainForm.Events.cs +++ b/AM2RLauncher/AM2RLauncher/MainForm/MainForm.Events.cs @@ -773,6 +773,7 @@ public partial class MainForm : Form log.Info("SettingsProfileDropDown.SelectedIndex has been changed to " + modSettingsProfileDropDown.SelectedIndex + "."); if (modSettingsProfileDropDown.SelectedIndex <= 0 || modSettingsProfileDropDown.Items.Count == 0) { + desktopShortcutButton.Enabled = false; deleteModButton.Enabled = false; deleteModButton.ToolTip = null; updateModButton.Enabled = false; @@ -781,6 +782,7 @@ public partial class MainForm : Form } else { + desktopShortcutButton.Enabled = true; deleteModButton.Enabled = true; deleteModButton.ToolTip = HelperMethods.GetText(Text.DeleteModButtonToolTip, profileName); // On non-installable profiles we want to disable updating @@ -804,7 +806,14 @@ public partial class MainForm : Form ProfileXML profile = profileList[modSettingsProfileDropDown.SelectedIndex]; log.Info($"User wants to create a desktop shortcut for {profile.Name}."); - //TODO: warning if used on community updates + // We want to give a warning to users, so they don't complain with "why didn't I get 2.0???" + if (profile.Name == "Community Updates (Latest)") + { + Application.Instance.Invoke(() => + { + MessageBox.Show(Text.ShortcutWarning, Text.WarningWindowTitle, MessageBoxType.Warning); + }); + } string desktopFolder = Environment.GetFolderPath(Environment.SpecialFolder.Desktop, Environment.SpecialFolderOption.Create); string shortcutFile = ""; @@ -832,7 +841,7 @@ public partial class MainForm : Form // Replace values desktopEntryText = desktopEntryText.Replace("PROFILENAME", $"{profile.Name}"); - desktopEntryText = desktopEntryText.Replace("PROFILEDESCRIPTION", $"{profile.ProfileNotes}"); + desktopEntryText = desktopEntryText.Replace("PROFILEDESCRIPTION", $"A shortcut for {profile.Name}."); desktopEntryText = desktopEntryText.Replace("ICONPATH", $"{Core.PatchDataPath}/data/files_to_copy/icon.png"); string gameName; diff --git a/AM2RLauncher/AM2RLauncher/MainForm/MainForm.StateMachine.cs b/AM2RLauncher/AM2RLauncher/MainForm/MainForm.StateMachine.cs index 1ad2021..87fdd7f 100644 --- a/AM2RLauncher/AM2RLauncher/MainForm/MainForm.StateMachine.cs +++ b/AM2RLauncher/AM2RLauncher/MainForm/MainForm.StateMachine.cs @@ -197,6 +197,7 @@ public partial class MainForm // Only enable these, when we're not on the community updates if (modSettingsProfileDropDown.SelectedIndex > 0) { + desktopShortcutButton.Enabled = enabled; updateModButton.Enabled = profileList[modSettingsProfileDropDown.SelectedIndex].Installable; updateModButton.ToolTip = HelperMethods.GetText(Text.UpdateModButtonToolTip, selectedProfileName); deleteModButton.Enabled = enabled; diff --git a/AM2RLauncher/AM2RLauncher/MainForm/MainForm.UI.cs b/AM2RLauncher/AM2RLauncher/MainForm/MainForm.UI.cs index b4fdd3f..3546ffc 100644 --- a/AM2RLauncher/AM2RLauncher/MainForm/MainForm.UI.cs +++ b/AM2RLauncher/AM2RLauncher/MainForm/MainForm.UI.cs @@ -657,6 +657,7 @@ public partial class MainForm : Form modSettingsProfileDropDown.DataStore = profileDropDown.DataStore; // It's actually more comfortable if it's outside, because of GTK shenanigans modSettingsProfileDropDown.Bind(m => m.SelectedIndex, profileDropDown, p => p.SelectedIndex); + //TODO: this is copy pasted too often, make custom class for our buttons so we can just call *one* constructor. desktopShortcutButton = profileButton = new ColorButton { Text = Text.CreateShortcut,