From a6f2b6f912cbcc0ec61784da4ec4bbbce8a75fed Mon Sep 17 00:00:00 2001 From: Brett Hewitson Date: Sat, 18 Dec 2021 12:17:58 +1000 Subject: [PATCH] Add a reset to default button to discord bot section. Added Discord Bot section to the profile sync list. --- src/ARKServerManager/ARKServerManager.csproj | 2 + .../Enums/ServerProfileCategory.cs | 1 + .../Enums/ServerSettingsCustomLevelsAction.cs | 12 +++ .../Enums/ServerSettingsResetAction.cs | 44 ++++++++++ src/ARKServerManager/Lib/ServerProfile.cs | 29 +++++++ .../UserControls/ServerSettingsControl.xaml | 86 ++++++++++--------- .../ServerSettingsControl.xaml.cs | 58 +------------ src/ARKServerManager/VersionFeed.xml | 6 +- src/ARKServerManager/VersionFeedBeta.xml | 24 ++++++ .../Windows/ProfileSyncWindow.xaml.cs | 2 + .../ConanServerManager.csproj | 1 + .../Enums/ServerProfileCategory.cs | 1 + .../Enums/ServerSettingsResetAction.cs | 14 +++ src/ConanServerManager/Lib/ServerProfile.cs | 29 +++++++ .../UserControls/ServerSettingsControl.xaml | 12 ++- .../ServerSettingsControl.xaml.cs | 17 +--- src/ConanServerManager/VersionFeed.xml | 6 +- src/ConanServerManager/VersionFeedBeta.xml | 26 +++++- .../Windows/ProfileSyncWindow.xaml.cs | 2 + 19 files changed, 254 insertions(+), 118 deletions(-) create mode 100644 src/ARKServerManager/Enums/ServerSettingsCustomLevelsAction.cs create mode 100644 src/ARKServerManager/Enums/ServerSettingsResetAction.cs create mode 100644 src/ConanServerManager/Enums/ServerSettingsResetAction.cs diff --git a/src/ARKServerManager/ARKServerManager.csproj b/src/ARKServerManager/ARKServerManager.csproj index 380bd3cd..bd490e4e 100644 --- a/src/ARKServerManager/ARKServerManager.csproj +++ b/src/ARKServerManager/ARKServerManager.csproj @@ -184,6 +184,8 @@ + + diff --git a/src/ARKServerManager/Enums/ServerProfileCategory.cs b/src/ARKServerManager/Enums/ServerProfileCategory.cs index c923ae2e..12c68784 100644 --- a/src/ARKServerManager/Enums/ServerProfileCategory.cs +++ b/src/ARKServerManager/Enums/ServerProfileCategory.cs @@ -5,6 +5,7 @@ Unknown, Administration, AutomaticManagement, + DiscordBot, Rules, ChatAndNotifications, HudAndVisuals, diff --git a/src/ARKServerManager/Enums/ServerSettingsCustomLevelsAction.cs b/src/ARKServerManager/Enums/ServerSettingsCustomLevelsAction.cs new file mode 100644 index 00000000..55fd9120 --- /dev/null +++ b/src/ARKServerManager/Enums/ServerSettingsCustomLevelsAction.cs @@ -0,0 +1,12 @@ +namespace ServerManagerTool.Enums +{ + public enum ServerSettingsCustomLevelsAction + { + ExportPlayerLevels, + ImportPlayerLevels, + UpdatePlayerXPCap, + ExportDinoLevels, + ImportDinoLevels, + UpdateDinoXPCap, + } +} diff --git a/src/ARKServerManager/Enums/ServerSettingsResetAction.cs b/src/ARKServerManager/Enums/ServerSettingsResetAction.cs new file mode 100644 index 00000000..09b629fc --- /dev/null +++ b/src/ARKServerManager/Enums/ServerSettingsResetAction.cs @@ -0,0 +1,44 @@ +namespace ServerManagerTool.Enums +{ + public enum ServerSettingsResetAction + { + // Sections + AdministrationSection, + DiscordBotSection, + RulesSection, + ChatAndNotificationsSection, + HudAndVisualsSection, + PlayerSettingsSection, + DinoSettingsSection, + EnvironmentSection, + StructuresSection, + EngramsSection, + CustomLevelsSection, + SOTFSection, + PGMSection, + MapSpawnerOverridesSection, + CraftingOverridesSection, + SupplyCrateOverridesSection, + StackSizeOverridesSection, + PreventTransferOverridesSection, + + // Properties + MapNameTotalConversionProperty, + BanListProperty, + + PlayerMaxXpProperty, + DinoMaxXpProperty, + PlayerBaseStatMultipliers, + PlayerPerLevelStatMultipliers, + DinoWildPerLevelStatMultipliers, + DinoTamedPerLevelStatMultipliers, + DinoTamedAddPerLevelStatMultipliers, + DinoTamedAffinityPerLevelStatMultipliers, + DinoWildMutagenLevelBoost, + DinoBredMutagenLevelBoost, + ItemStatClamps, + RCONWindowExtents, + ServerOptions, + ServerLogOptions, + } +} diff --git a/src/ARKServerManager/Lib/ServerProfile.cs b/src/ARKServerManager/Lib/ServerProfile.cs index 09dc1038..ce9cf29c 100644 --- a/src/ARKServerManager/Lib/ServerProfile.cs +++ b/src/ARKServerManager/Lib/ServerProfile.cs @@ -5349,6 +5349,19 @@ namespace ServerManagerTool.Lib this.DinoSettings.RenderToView(); } + public void ResetDiscordBotSection() + { + this.ClearValue(DiscordChannelIdProperty); + this.ClearValue(DiscordAliasProperty); + + this.ClearValue(AllowDiscordBackupProperty); + this.ClearValue(AllowDiscordRestartProperty); + this.ClearValue(AllowDiscordShutdownProperty); + this.ClearValue(AllowDiscordStartProperty); + this.ClearValue(AllowDiscordStopProperty); + this.ClearValue(AllowDiscordUpdateProperty); + } + public void ResetEngramsSection() { this.ClearValue(AutoUnlockAllEngramsProperty); @@ -5695,6 +5708,9 @@ namespace ServerManagerTool.Lib case ServerProfileCategory.AutomaticManagement: SyncAutomaticManagement(sourceProfile); break; + case ServerProfileCategory.DiscordBot: + SyncDiscordBot(sourceProfile); + break; case ServerProfileCategory.Rules: SyncRulesSection(sourceProfile); break; @@ -6016,6 +6032,19 @@ namespace ServerManagerTool.Lib this.DinoSettings.RenderToView(); } + private void SyncDiscordBot(ServerProfile sourceProfile) + { + this.SetValue(DiscordChannelIdProperty, sourceProfile.DiscordChannelId); + this.SetValue(DiscordAliasProperty, sourceProfile.DiscordAlias); + + this.SetValue(AllowDiscordBackupProperty, sourceProfile.AllowDiscordBackup); + this.SetValue(AllowDiscordRestartProperty, sourceProfile.AllowDiscordRestart); + this.SetValue(AllowDiscordShutdownProperty, sourceProfile.AllowDiscordShutdown); + this.SetValue(AllowDiscordStartProperty, sourceProfile.AllowDiscordStart); + this.SetValue(AllowDiscordStopProperty, sourceProfile.AllowDiscordStop); + this.SetValue(AllowDiscordUpdateProperty, sourceProfile.AllowDiscordUpdate); + } + private void SyncEngramsSection(ServerProfile sourceProfile) { this.SetValue(AutoUnlockAllEngramsProperty, sourceProfile.AutoUnlockAllEngrams); diff --git a/src/ARKServerManager/UserControls/ServerSettingsControl.xaml b/src/ARKServerManager/UserControls/ServerSettingsControl.xaml index b845570c..434953fb 100644 --- a/src/ARKServerManager/UserControls/ServerSettingsControl.xaml +++ b/src/ARKServerManager/UserControls/ServerSettingsControl.xaml @@ -4,14 +4,13 @@ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:mts="clr-namespace:Microsoft.Win32.TaskScheduler;assembly=Microsoft.Win32.TaskScheduler" - xmlns:local="clr-namespace:ServerManagerTool" xmlns:cctl="clr-namespace:ServerManagerTool.Common.Controls;assembly=ServerManager.Common" xmlns:cc="clr-namespace:ServerManagerTool.Common.Converters;assembly=ServerManager.Common" xmlns:clib="clr-namespace:ServerManagerTool.Common.Lib;assembly=ServerManager.Common" xmlns:cvr="clr-namespace:ServerManagerTool.Common.ValidationRules;assembly=ServerManager.Common" xmlns:com="clr-namespace:ServerManagerTool.Common;assembly=ServerManager.Common" xmlns:enum="clr-namespace:ServerManagerTool.Enums" - xmlns:acenum="clr-namespace:ServerManagerTool.Enums;assembly=ArkServerManager.Common" + xmlns:cenum="clr-namespace:ServerManagerTool.Enums;assembly=ArkServerManager.Common" xmlns:vm="clr-namespace:ServerManagerTool.Lib.ViewModel" xmlns:sys="clr-namespace:System;assembly=mscorlib" mc:Ignorable="d" @@ -534,7 +533,7 @@ @@ -709,7 +708,7 @@