diff --git a/src/ARKServerManager/Globalization/en-US/en-US.xaml b/src/ARKServerManager/Globalization/en-US/en-US.xaml index 41f0a832..90044820 100644 --- a/src/ARKServerManager/Globalization/en-US/en-US.xaml +++ b/src/ARKServerManager/Globalization/en-US/en-US.xaml @@ -915,6 +915,7 @@ If you proceed the entire SteamCMD folder will be removed including all mod cache downloads.\r\nAre you sure you want to reinstall SteamCMD? Reinstall SteamCMD Error An error occured while trying to reinstall SteamCMD. This has left SteamCmd in an unstable state, try reinstalling again or please report this.\r\nException: {0} + Steam WebAPI Key missing! Updates, downloads and installation of profiles could fail. Enter your Steam WebApiKey in the global settings Discord Bot Running Commands The discord bot has one or more running commands, do you want to continue shutting down the server manager? diff --git a/src/ARKServerManager/Styles/Default.xaml b/src/ARKServerManager/Styles/Default.xaml index c5bebb68..1e6cbf56 100644 --- a/src/ARKServerManager/Styles/Default.xaml +++ b/src/ARKServerManager/Styles/Default.xaml @@ -25,6 +25,8 @@ + + diff --git a/src/ARKServerManager/Windows/MainWindow.xaml b/src/ARKServerManager/Windows/MainWindow.xaml index 880bb2f0..42a02f37 100644 --- a/src/ARKServerManager/Windows/MainWindow.xaml +++ b/src/ARKServerManager/Windows/MainWindow.xaml @@ -43,6 +43,10 @@ + + + + diff --git a/src/ARKServerManager/Windows/MainWindow.xaml.cs b/src/ARKServerManager/Windows/MainWindow.xaml.cs index 5a29752b..5f232bab 100644 --- a/src/ARKServerManager/Windows/MainWindow.xaml.cs +++ b/src/ARKServerManager/Windows/MainWindow.xaml.cs @@ -1,5 +1,6 @@ using EO.Wpf; using NLog; +using ServerManagerTool.Common; using ServerManagerTool.Common.Enums; using ServerManagerTool.Common.Lib; using ServerManagerTool.Common.Utils; @@ -35,6 +36,7 @@ namespace ServerManagerTool public static readonly DependencyProperty AppInstanceProperty = DependencyProperty.Register(nameof(AppInstance), typeof(App), typeof(MainWindow), new PropertyMetadata(null)); public static readonly DependencyProperty ConfigProperty = DependencyProperty.Register(nameof(Config), typeof(Config), typeof(MainWindow), new PropertyMetadata(null)); + public static readonly DependencyProperty CommonConfigProperty = DependencyProperty.Register(nameof(CommonConfig), typeof(CommonConfig), typeof(MainWindow), new PropertyMetadata(null)); public static readonly DependencyProperty ServerManagerProperty = DependencyProperty.Register(nameof(ServerManager), typeof(ServerManager), typeof(MainWindow), new PropertyMetadata(null)); public static readonly DependencyProperty AutoBackupStateProperty = DependencyProperty.Register(nameof(AutoBackupState), typeof(Microsoft.Win32.TaskScheduler.TaskState), typeof(MainWindow), new PropertyMetadata(Microsoft.Win32.TaskScheduler.TaskState.Unknown)); public static readonly DependencyProperty AutoBackupStateStringProperty = DependencyProperty.Register(nameof(AutoBackupStateString), typeof(string), typeof(MainWindow), new PropertyMetadata(string.Empty)); @@ -52,6 +54,7 @@ namespace ServerManagerTool { this.AppInstance = App.Instance; this.Config = Config.Default; + this.CommonConfig = CommonConfig.Default; InitializeComponent(); WindowUtils.RemoveDefaultResourceDictionary(this, Config.Default.DefaultGlobalizationFile); @@ -102,6 +105,12 @@ namespace ServerManagerTool set { SetValue(ConfigProperty, value); } } + public CommonConfig CommonConfig + { + get { return GetValue(CommonConfigProperty) as CommonConfig; } + set { SetValue(CommonConfigProperty, value); } + } + public ServerManager ServerManager { get { return (ServerManager)GetValue(ServerManagerProperty); } diff --git a/src/ConanServerManager/Globalization/en-US/en-US.xaml b/src/ConanServerManager/Globalization/en-US/en-US.xaml index 4504a934..132884a3 100644 --- a/src/ConanServerManager/Globalization/en-US/en-US.xaml +++ b/src/ConanServerManager/Globalization/en-US/en-US.xaml @@ -696,6 +696,7 @@ If you proceed the entire SteamCMD folder will be removed including all mod cache downloads.\r\nAre you sure you want to reinstall SteamCMD? Reinstall SteamCMD Error An error occured while trying to reinstall SteamCMD. This has left SteamCmd in an unstable state, try reinstalling again or please report this.\r\nException: {0} + Steam WebAPI Key missing! Updates, downloads and installation of profiles could fail. Enter your Steam WebApiKey in the global settings Discord Bot Running Commands The discord bot has one or more running commands, do you want to continue shutting down the server manager? diff --git a/src/ConanServerManager/Styles/Default.xaml b/src/ConanServerManager/Styles/Default.xaml index 62d5c42a..4d98998e 100644 --- a/src/ConanServerManager/Styles/Default.xaml +++ b/src/ConanServerManager/Styles/Default.xaml @@ -24,6 +24,8 @@ + + diff --git a/src/ConanServerManager/Windows/MainWindow.xaml.cs b/src/ConanServerManager/Windows/MainWindow.xaml.cs index d9ec8a10..56b28f8a 100644 --- a/src/ConanServerManager/Windows/MainWindow.xaml.cs +++ b/src/ConanServerManager/Windows/MainWindow.xaml.cs @@ -1,5 +1,6 @@ using EO.Wpf; using NLog; +using ServerManagerTool.Common; using ServerManagerTool.Common.Enums; using ServerManagerTool.Common.Lib; using ServerManagerTool.Common.Utils; @@ -35,6 +36,7 @@ namespace ServerManagerTool public static readonly DependencyProperty AppInstanceProperty = DependencyProperty.Register(nameof(AppInstance), typeof(App), typeof(MainWindow), new PropertyMetadata(null)); public static readonly DependencyProperty ConfigProperty = DependencyProperty.Register(nameof(Config), typeof(Config), typeof(MainWindow), new PropertyMetadata(null)); + public static readonly DependencyProperty CommonConfigProperty = DependencyProperty.Register(nameof(CommonConfig), typeof(CommonConfig), typeof(MainWindow), new PropertyMetadata(null)); public static readonly DependencyProperty ServerManagerProperty = DependencyProperty.Register(nameof(ServerManager), typeof(ServerManager), typeof(MainWindow), new PropertyMetadata(null)); public static readonly DependencyProperty AutoBackupStateProperty = DependencyProperty.Register(nameof(AutoBackupState), typeof(Microsoft.Win32.TaskScheduler.TaskState), typeof(MainWindow), new PropertyMetadata(Microsoft.Win32.TaskScheduler.TaskState.Unknown)); public static readonly DependencyProperty AutoBackupStateStringProperty = DependencyProperty.Register(nameof(AutoBackupStateString), typeof(string), typeof(MainWindow), new PropertyMetadata(string.Empty)); @@ -52,6 +54,7 @@ namespace ServerManagerTool { this.AppInstance = App.Instance; this.Config = Config.Default; + this.CommonConfig = CommonConfig.Default; InitializeComponent(); WindowUtils.RemoveDefaultResourceDictionary(this, Config.Default.DefaultGlobalizationFile); @@ -102,6 +105,12 @@ namespace ServerManagerTool set { SetValue(ConfigProperty, value); } } + public CommonConfig CommonConfig + { + get { return GetValue(CommonConfigProperty) as CommonConfig; } + set { SetValue(CommonConfigProperty, value); } + } + public ServerManager ServerManager { get { return (ServerManager)GetValue(ServerManagerProperty); } diff --git a/src/ServerManager.Common/Converters/InvertStringNullOrEmptyToVisibilityConverter.cs b/src/ServerManager.Common/Converters/InvertStringNullOrEmptyToVisibilityConverter.cs new file mode 100644 index 00000000..74ed7904 --- /dev/null +++ b/src/ServerManager.Common/Converters/InvertStringNullOrEmptyToVisibilityConverter.cs @@ -0,0 +1,20 @@ +using System; +using System.Globalization; +using System.Windows; +using System.Windows.Data; + +namespace ServerManagerTool.Common.Converters +{ + public class InvertStringNullOrEmptyToVisibilityConverter : IValueConverter + { + public object Convert(object value, Type targetType, object parameter, CultureInfo culture) + { + return string.IsNullOrEmpty(value as string) ? Visibility.Visible : Visibility.Collapsed; + } + + public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) + { + throw new NotSupportedException("InvertStringNullOrEmptyToVisibilityConverter is a OneWay converter."); + } + } +} diff --git a/src/ServerManager.Common/Converters/StringNullOrEmptyToVisibilityConverter.cs b/src/ServerManager.Common/Converters/StringNullOrEmptyToVisibilityConverter.cs new file mode 100644 index 00000000..2fc756c6 --- /dev/null +++ b/src/ServerManager.Common/Converters/StringNullOrEmptyToVisibilityConverter.cs @@ -0,0 +1,20 @@ +using System; +using System.Globalization; +using System.Windows; +using System.Windows.Data; + +namespace ServerManagerTool.Common.Converters +{ + public class StringNullOrEmptyToVisibilityConverter : IValueConverter + { + public object Convert(object value, Type targetType, object parameter, CultureInfo culture) + { + return string.IsNullOrEmpty(value as string) ? Visibility.Collapsed : Visibility.Visible; + } + + public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) + { + throw new NotSupportedException("StringNullOrEmptyToVisibilityConverter is a OneWay converter."); + } + } +}