Gamedata Files - when adding, deleteing or reloading the gamedata files via the gamedata window, the server manager will reload them and update the settings window.
+
+
+
+
+
+ bletch
+ bletch1971@hotmail.com
+
+ urn:uuid:93A04A12-C632-4C2B-AC76-42D9E476431C
diff --git a/src/ARKServerManager/VersionFeedBeta.xml b/src/ARKServerManager/VersionFeedBeta.xml
index d81948c4..29239e89 100644
--- a/src/ARKServerManager/VersionFeedBeta.xml
+++ b/src/ARKServerManager/VersionFeedBeta.xml
@@ -5,94 +5,21 @@
Ark Server Manager Version FeedThis is the Ark Server Manager beta version feed.
- 2022-06-16T00:00:00Z
+ 2022-06-17T00:00:00Z
- urn:uuid:DB240E90-17B0-4DE1-B60B-0D5E4753810F
- 1.1.432 (1.1.432.4)
- 1.1.432.4
+ urn:uuid:1AE0925B-64EB-4177-B834-7A75FA46E807
+ 1.1.433 (1.1.433.1)
+ 1.1.433.1
- 2022-06-16T00:00:00Z
-
-
-
- NEW
-
-
-
Profile Settings - Rules Section - Added UseFjordurTraversalBuff setting. Located in the Fjordur group at the bottom of the Rules section.
Crafting Override Grids - Added new icons to show Good (green), Warning (orange) or Bad (red). Warnings will show for items not familiar with (raw class names, not loaded via gamedata files), Errors will show for missing items.
-
Prevent Transfer Grids - Added new icons to show Good (green), Warning (orange) or Bad (red). Warnings will show for creatures not familiar with (raw class names, not loaded via gamedata files), Errors will show for missing creatures.
-
Map Spawner Grids - Added new icons to show Good (green), Warning (orange) or Bad (red). Warnings will show for spawners/creatures not familiar with (raw class names, not loaded via gamedata files), Errors will show for missing spawners/creatures.
-
Stack Size Grid - Added new icons to show Good (green), Warning (orange) or Bad (red). Warnings will show for items not familiar with (raw class names, not loaded via gamedata files), Errors will show for missing items.
Reset Server - added new button to reset your server. This will delete all server, player and tribe files and reset your server back to new.
+
Gamedata Files - when adding, deleteing or reloading the gamedata files via the gamedata window, the server manager will reload them and update the settings window.
diff --git a/src/ARKServerManager/Windows/GameDataWindow.xaml.cs b/src/ARKServerManager/Windows/GameDataWindow.xaml.cs
index f0f46328..a27ecd85 100644
--- a/src/ARKServerManager/Windows/GameDataWindow.xaml.cs
+++ b/src/ARKServerManager/Windows/GameDataWindow.xaml.cs
@@ -1,7 +1,7 @@
using Microsoft.WindowsAPICodePack.Dialogs;
-using ServerManagerTool.Common.Model;
using ServerManagerTool.Common.Utils;
using ServerManagerTool.Lib;
+using ServerManagerTool.Lib.ViewModel;
using ServerManagerTool.Utils;
using System;
using System.Collections.Generic;
@@ -19,60 +19,6 @@ namespace ServerManagerTool
///
public partial class GameDataWindow : Window
{
- public class GameDataFileList : SortableObservableCollection
- {
- public override string ToString()
- {
- return $"{nameof(GameDataFile)} - {Count}";
- }
- }
-
- public class GameDataFile : DependencyObject
- {
- public static readonly DependencyProperty CreatedDateProperty = DependencyProperty.Register(nameof(CreatedDate), typeof(DateTime), typeof(GameDataFile), new PropertyMetadata(DateTime.MinValue));
- public static readonly DependencyProperty FileProperty = DependencyProperty.Register(nameof(File), typeof(string), typeof(GameDataFile), new PropertyMetadata(string.Empty));
- public static readonly DependencyProperty FileNameProperty = DependencyProperty.Register(nameof(FileName), typeof(string), typeof(GameDataFile), new PropertyMetadata(string.Empty));
- public static readonly DependencyProperty IsUserDataProperty = DependencyProperty.Register(nameof(IsUserData), typeof(bool), typeof(GameDataFile), new PropertyMetadata(true));
- public static readonly DependencyProperty VersionProperty = DependencyProperty.Register(nameof(Version), typeof(string), typeof(GameDataFile), new PropertyMetadata(string.Empty));
- public static readonly DependencyProperty HasErrorProperty = DependencyProperty.Register(nameof(HasError), typeof(bool), typeof(GameDataFile), new PropertyMetadata(false));
-
- public DateTime CreatedDate
- {
- get { return (DateTime)GetValue(CreatedDateProperty); }
- set { SetValue(CreatedDateProperty, value); }
- }
-
- public string File
- {
- get { return (string)GetValue(FileProperty); }
- set { SetValue(FileProperty, value); }
- }
-
- public string FileName
- {
- get { return (string)GetValue(FileNameProperty); }
- set { SetValue(FileNameProperty, value); }
- }
-
- public bool IsUserData
- {
- get { return (bool)GetValue(IsUserDataProperty); }
- set { SetValue(IsUserDataProperty, value); }
- }
-
- public string Version
- {
- get { return (string)GetValue(VersionProperty); }
- set { SetValue(VersionProperty, value); }
- }
-
- public bool HasError
- {
- get { return (bool)GetValue(HasErrorProperty); }
- set { SetValue(HasErrorProperty, value); }
- }
- }
-
private readonly GlobalizedApplication _globalizer = GlobalizedApplication.Instance;
public static readonly DependencyProperty GameDataFilesProperty = DependencyProperty.Register(nameof(GameDataFiles), typeof(GameDataFileList), typeof(GameDataWindow), new PropertyMetadata(null));
@@ -117,6 +63,7 @@ namespace ServerManagerTool
try
{
AddGameDataFile(GameData.UserDataFolder, dialog.FileName);
+ GameData.Reload();
}
catch (Exception ex)
{
@@ -135,6 +82,7 @@ namespace ServerManagerTool
{
DeleteAllGameDataFiles(GameData.UserDataFolder);
}
+ GameData.Reload();
}
catch (Exception ex)
{
@@ -166,6 +114,7 @@ namespace ServerManagerTool
try
{
ReloadGameDataFiles();
+ GameData.Reload();
}
catch (Exception ex)
{
@@ -182,6 +131,7 @@ namespace ServerManagerTool
{
var gameDataItem = ((GameDataFile)((Button)e.Source).DataContext);
DeleteGameDataFile(gameDataItem.File, true);
+ GameData.Reload();
}
catch (Exception ex)
{
diff --git a/src/ARKServerManager/Windows/MainWindow.xaml.cs b/src/ARKServerManager/Windows/MainWindow.xaml.cs
index 56dd84f5..d8b09181 100644
--- a/src/ARKServerManager/Windows/MainWindow.xaml.cs
+++ b/src/ARKServerManager/Windows/MainWindow.xaml.cs
@@ -246,6 +246,13 @@ namespace ServerManagerTool
this.Activate();
}
+ protected override void OnClosed(EventArgs e)
+ {
+ GlobalizedApplication.Instance.GlobalizationManager.ResourceDictionaryChangedEvent -= ResourceDictionaryChangedEvent;
+
+ base.OnClosed(e);
+ }
+
protected override void OnClosing(System.ComponentModel.CancelEventArgs e)
{
if (DiscordBotHelper.HasRunningCommands)
diff --git a/src/ARKServerManager/Windows/RCONWindow.xaml.cs b/src/ARKServerManager/Windows/RCONWindow.xaml.cs
index 405d370d..8939ef6d 100644
--- a/src/ARKServerManager/Windows/RCONWindow.xaml.cs
+++ b/src/ARKServerManager/Windows/RCONWindow.xaml.cs
@@ -245,6 +245,7 @@ namespace ServerManagerTool
// hook into the language change event
GlobalizedApplication.Instance.GlobalizationManager.ResourceDictionaryChangedEvent += ResourceDictionaryChangedEvent;
+ GameData.GameDataLoaded += GameData_GameDataLoaded;
}
#region Properties
@@ -684,13 +685,19 @@ namespace ServerManagerTool
return new RCONWindow(parameters);
}
- private void ResourceDictionaryChangedEvent(object source, ResourceDictionaryChangedEventArgs e)
+ private void GameData_GameDataLoaded(object sender, EventArgs e)
{
PopulateRconInputModesComboBox();
}
+ private void ResourceDictionaryChangedEvent(object source, ResourceDictionaryChangedEventArgs e)
+ {
+ GameData_GameDataLoaded(source, e);
+ }
+
protected override void OnClosed(EventArgs e)
{
+ GameData.GameDataLoaded -= GameData_GameDataLoaded;
GlobalizedApplication.Instance.GlobalizationManager.ResourceDictionaryChangedEvent -= ResourceDictionaryChangedEvent;
if (this.RCONParameters?.Server?.Runtime != null)
diff --git a/src/ARKServerManager/Windows/SettingsWindow.xaml b/src/ARKServerManager/Windows/SettingsWindow.xaml
index f2826aa5..e133195d 100644
--- a/src/ARKServerManager/Windows/SettingsWindow.xaml
+++ b/src/ARKServerManager/Windows/SettingsWindow.xaml
@@ -3,9 +3,10 @@
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
- xmlns:local="clr-namespace:ServerManagerTool"
+ xmlns:sm="clr-namespace:ServerManagerTool"
mc:Ignorable="d"
MinWidth="800" MinHeight="600" Width="800" Height="700" ResizeMode="CanResizeWithGrip" WindowStyle="ToolWindow" WindowStartupLocation="CenterOwner" ShowInTaskbar="False"
+ Closing="SettingsWindow_Closing"
Icon="../Art/favicon.ico" Title="{DynamicResource Settings_Title}" >
@@ -16,6 +17,6 @@
-
+
diff --git a/src/ARKServerManager/Windows/SettingsWindow.xaml.cs b/src/ARKServerManager/Windows/SettingsWindow.xaml.cs
index a5d07092..70b3318f 100644
--- a/src/ARKServerManager/Windows/SettingsWindow.xaml.cs
+++ b/src/ARKServerManager/Windows/SettingsWindow.xaml.cs
@@ -1,5 +1,6 @@
using ServerManagerTool.Common.Utils;
using System;
+using System.ComponentModel;
using System.IO;
using System.Reflection;
using System.Windows;
@@ -20,8 +21,15 @@ namespace ServerManagerTool
WindowUtils.RemoveDefaultResourceDictionary(this, Config.Default.DefaultGlobalizationFile);
}
+ private void SettingsWindow_Closing(object sender, CancelEventArgs e)
+ {
+ if (!globalSettingsControl.IsEnabled)
+ e.Cancel = true;
+ }
+
protected override void OnClosed(EventArgs e)
{
+ globalSettingsControl.CloseControl();
globalSettingsControl.ApplyChangesToConfig();
if (SecurityUtils.IsAdministrator())
diff --git a/src/ConanServerManager/ConanServerManager.csproj b/src/ConanServerManager/ConanServerManager.csproj
index 8ec0afaf..34913ede 100644
--- a/src/ConanServerManager/ConanServerManager.csproj
+++ b/src/ConanServerManager/ConanServerManager.csproj
@@ -212,6 +212,8 @@
+
+
diff --git a/src/ConanServerManager/Lib/GameData.cs b/src/ConanServerManager/Lib/GameData.cs
index 1c5d8c5c..5273f852 100644
--- a/src/ConanServerManager/Lib/GameData.cs
+++ b/src/ConanServerManager/Lib/GameData.cs
@@ -12,12 +12,20 @@ namespace ServerManagerTool.Lib
{
public const string RCONINPUTMODE_COMMAND = "Command";
+ public static event EventHandler GameDataLoaded;
+
public static string MainDataFolder = Path.Combine(Environment.CurrentDirectory, Config.Default.GameDataRelativePath);
public static string UserDataFolder = Path.Combine(Config.Default.DataPath, Config.Default.GameDataRelativePath);
private static MainGameData gameData = null;
public static void Initialize()
+ {
+ Load();
+ OnGameDataLoaded();
+ }
+
+ private static void Load()
{
// read static game data
GameDataUtils.ReadAllData(out gameData, MainDataFolder, Config.Default.GameDataExtension, Config.Default.GameDataApplication);
@@ -74,6 +82,19 @@ namespace ServerManagerTool.Lib
}
}
+ private static void OnGameDataLoaded()
+ {
+ GameDataLoaded?.Invoke(null, EventArgs.Empty);
+ }
+
+ public static void Reload()
+ {
+ gameData = null;
+
+ Load();
+ OnGameDataLoaded();
+ }
+
public static string FriendlyNameForClass(string className, bool returnNullIfNotFound = false) => string.IsNullOrWhiteSpace(className) ? (returnNullIfNotFound ? null : string.Empty) : GlobalizedApplication.Instance.GetResourceString(className) ?? (returnNullIfNotFound ? null : className);
#region Game Maps
diff --git a/src/ConanServerManager/Lib/ViewModel/GameDataFile.cs b/src/ConanServerManager/Lib/ViewModel/GameDataFile.cs
new file mode 100644
index 00000000..29951370
--- /dev/null
+++ b/src/ConanServerManager/Lib/ViewModel/GameDataFile.cs
@@ -0,0 +1,51 @@
+using System;
+using System.Windows;
+
+namespace ServerManagerTool.Lib.ViewModel
+{
+ public class GameDataFile : DependencyObject
+ {
+ public static readonly DependencyProperty CreatedDateProperty = DependencyProperty.Register(nameof(CreatedDate), typeof(DateTime), typeof(GameDataFile), new PropertyMetadata(DateTime.MinValue));
+ public static readonly DependencyProperty FileProperty = DependencyProperty.Register(nameof(File), typeof(string), typeof(GameDataFile), new PropertyMetadata(string.Empty));
+ public static readonly DependencyProperty FileNameProperty = DependencyProperty.Register(nameof(FileName), typeof(string), typeof(GameDataFile), new PropertyMetadata(string.Empty));
+ public static readonly DependencyProperty IsUserDataProperty = DependencyProperty.Register(nameof(IsUserData), typeof(bool), typeof(GameDataFile), new PropertyMetadata(true));
+ public static readonly DependencyProperty VersionProperty = DependencyProperty.Register(nameof(Version), typeof(string), typeof(GameDataFile), new PropertyMetadata(string.Empty));
+ public static readonly DependencyProperty HasErrorProperty = DependencyProperty.Register(nameof(HasError), typeof(bool), typeof(GameDataFile), new PropertyMetadata(false));
+
+ public DateTime CreatedDate
+ {
+ get { return (DateTime)GetValue(CreatedDateProperty); }
+ set { SetValue(CreatedDateProperty, value); }
+ }
+
+ public string File
+ {
+ get { return (string)GetValue(FileProperty); }
+ set { SetValue(FileProperty, value); }
+ }
+
+ public string FileName
+ {
+ get { return (string)GetValue(FileNameProperty); }
+ set { SetValue(FileNameProperty, value); }
+ }
+
+ public bool IsUserData
+ {
+ get { return (bool)GetValue(IsUserDataProperty); }
+ set { SetValue(IsUserDataProperty, value); }
+ }
+
+ public string Version
+ {
+ get { return (string)GetValue(VersionProperty); }
+ set { SetValue(VersionProperty, value); }
+ }
+
+ public bool HasError
+ {
+ get { return (bool)GetValue(HasErrorProperty); }
+ set { SetValue(HasErrorProperty, value); }
+ }
+ }
+}
diff --git a/src/ConanServerManager/Lib/ViewModel/GameDataFileList.cs b/src/ConanServerManager/Lib/ViewModel/GameDataFileList.cs
new file mode 100644
index 00000000..13c68573
--- /dev/null
+++ b/src/ConanServerManager/Lib/ViewModel/GameDataFileList.cs
@@ -0,0 +1,12 @@
+using ServerManagerTool.Common.Model;
+
+namespace ServerManagerTool.Lib.ViewModel
+{
+ public class GameDataFileList : SortableObservableCollection
+ {
+ public override string ToString()
+ {
+ return $"{nameof(GameDataFile)} - {Count}";
+ }
+ }
+}
diff --git a/src/ConanServerManager/UserControls/GlobalSettingsControl.xaml.cs b/src/ConanServerManager/UserControls/GlobalSettingsControl.xaml.cs
index 45f5d5e6..9e83704f 100644
--- a/src/ConanServerManager/UserControls/GlobalSettingsControl.xaml.cs
+++ b/src/ConanServerManager/UserControls/GlobalSettingsControl.xaml.cs
@@ -63,6 +63,8 @@ namespace ServerManagerTool
}
this.DataContext = this;
+
+ GameData.GameDataLoaded += GameData_GameDataLoaded;
}
public App AppInstance
@@ -398,14 +400,19 @@ namespace ServerManagerTool
e.Handled = true;
}
+ private void GameData_GameDataLoaded(object sender, EventArgs e)
+ {
+ PopulateRconMessageModesComboBox();
+ }
+
private void LanguageSelectionComboBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
Config.CultureName = AvailableLanguages.Instance.SelectedLanguage;
PopulateWindowsStatesMainWindowComboBox();
PopulateWindowsStatesServerMonitorWindowComboBox();
- PopulateRconMessageModesComboBox();
PopulateTaskPrioritiesComboBox();
+ GameData_GameDataLoaded(sender, e);
App.Instance.OnResourceDictionaryChanged(Config.CultureName);
}
@@ -492,6 +499,11 @@ namespace ServerManagerTool
}
}
+ public void CloseControl()
+ {
+ GameData.GameDataLoaded -= GameData_GameDataLoaded;
+ }
+
private void PopulateWindowsStatesMainWindowComboBox()
{
var selectedValue = this.WindowStateMainWindowComboBox?.SelectedValue ?? Config.MainWindow_WindowState;
diff --git a/src/ConanServerManager/UserControls/ServerSettingsControl.xaml.cs b/src/ConanServerManager/UserControls/ServerSettingsControl.xaml.cs
index 023c862a..beb76349 100644
--- a/src/ConanServerManager/UserControls/ServerSettingsControl.xaml.cs
+++ b/src/ConanServerManager/UserControls/ServerSettingsControl.xaml.cs
@@ -153,9 +153,18 @@ namespace ServerManagerTool
// hook into the language change event
GlobalizedApplication.Instance.GlobalizationManager.ResourceDictionaryChangedEvent += ResourceDictionaryChangedEvent;
+ GameData.GameDataLoaded += GameData_GameDataLoaded;
}
#region Event Methods
+ private void GameData_GameDataLoaded(object sender, EventArgs e)
+ {
+ this.RefreshBaseGameMapsList();
+ this.RefreshBaseBranchesList();
+ this.RefreshProcessPrioritiesList();
+ this.RefreshServerRegionsList();
+ }
+
private static void ServerPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
{
var ssc = (ServerSettingsControl)d;
@@ -184,11 +193,8 @@ namespace ServerManagerTool
{
this.CurrentCulture = Thread.CurrentThread.CurrentCulture;
- this.RefreshBaseGameMapsList();
- this.RefreshBaseBranchesList();
- this.RefreshProcessPrioritiesList();
- this.RefreshServerRegionsList();
this.UpdateLastStartedDetails(false);
+ GameData_GameDataLoaded(source, e);
Runtime.UpdateServerStatusString();
}
@@ -1248,6 +1254,12 @@ namespace ServerManagerTool
#endregion
#region Methods
+ public void CloseControl()
+ {
+ GameData.GameDataLoaded -= GameData_GameDataLoaded;
+ GlobalizedApplication.Instance.GlobalizationManager.ResourceDictionaryChangedEvent -= ResourceDictionaryChangedEvent;
+ }
+
public void RefreshBaseGameMapsList()
{
var newList = new ComboBoxItemList();
diff --git a/src/ConanServerManager/VersionFeed.xml b/src/ConanServerManager/VersionFeed.xml
index a5fbbf7b..b4c602a0 100644
--- a/src/ConanServerManager/VersionFeed.xml
+++ b/src/ConanServerManager/VersionFeed.xml
@@ -5,7 +5,30 @@
Conan Server Manager Version FeedThis is the Conan Server Manager release version feed.
- 2022-06-13T00:00:00Z
+ 2022-06-17T00:00:00Z
+
+
+ urn:uuid:15FEC514-38B7-4367-BE79-1E00983E7EBB
+ 1.1.76 (1.1.76.1)
+ 1.1.76.1
+
+ 2022-06-17T00:00:00Z
+
+
+
+ CHANGE
+
+
+
Gamedata Files - when adding, deleteing or reloading the gamedata files via the gamedata window, the server manager will reload them and update the settings window.
+
+
+
+
+
+ bletch
+ bletch1971@hotmail.com
+
+ urn:uuid:4E189446-9861-4B64-9B27-0E3E655CD1CA
diff --git a/src/ConanServerManager/VersionFeedBeta.xml b/src/ConanServerManager/VersionFeedBeta.xml
index 9b72aa19..1a97222c 100644
--- a/src/ConanServerManager/VersionFeedBeta.xml
+++ b/src/ConanServerManager/VersionFeedBeta.xml
@@ -5,44 +5,21 @@
Conan Server Manager Version FeedThis is the Conan Server Manager beta version feed.
- 2022-06-16T00:00:00Z
+ 2022-06-17T00:00:00Z
- urn:uuid:4E189446-9861-4B64-9B27-0E3E655CD1CA
- 1.1.75 (1.1.75.2)
- 1.1.75.2
+ urn:uuid:15FEC514-38B7-4367-BE79-1E00983E7EBB
+ 1.1.76 (1.1.76.1)
+ 1.1.76.1
- 2022-06-16T00:00:00Z
+ 2022-06-17T00:00:00Z
Reset Server - added new button to reset your server. This will delete all server files and reset your server back to new.
+
Gamedata Files - when adding, deleteing or reloading the gamedata files via the gamedata window, the server manager will reload them and update the settings window.
diff --git a/src/ConanServerManager/Windows/GameDataWindow.xaml.cs b/src/ConanServerManager/Windows/GameDataWindow.xaml.cs
index d1b1ec2a..1c57d243 100644
--- a/src/ConanServerManager/Windows/GameDataWindow.xaml.cs
+++ b/src/ConanServerManager/Windows/GameDataWindow.xaml.cs
@@ -1,7 +1,7 @@
using Microsoft.WindowsAPICodePack.Dialogs;
-using ServerManagerTool.Common.Model;
using ServerManagerTool.Common.Utils;
using ServerManagerTool.Lib;
+using ServerManagerTool.Lib.ViewModel;
using ServerManagerTool.Utils;
using System;
using System.Collections.Generic;
@@ -19,60 +19,6 @@ namespace ServerManagerTool
///
public partial class GameDataWindow : Window
{
- public class GameDataFileList : SortableObservableCollection
- {
- public override string ToString()
- {
- return $"{nameof(GameDataFile)} - {Count}";
- }
- }
-
- public class GameDataFile : DependencyObject
- {
- public static readonly DependencyProperty CreatedDateProperty = DependencyProperty.Register(nameof(CreatedDate), typeof(DateTime), typeof(GameDataFile), new PropertyMetadata(DateTime.MinValue));
- public static readonly DependencyProperty FileProperty = DependencyProperty.Register(nameof(File), typeof(string), typeof(GameDataFile), new PropertyMetadata(string.Empty));
- public static readonly DependencyProperty FileNameProperty = DependencyProperty.Register(nameof(FileName), typeof(string), typeof(GameDataFile), new PropertyMetadata(string.Empty));
- public static readonly DependencyProperty IsUserDataProperty = DependencyProperty.Register(nameof(IsUserData), typeof(bool), typeof(GameDataFile), new PropertyMetadata(true));
- public static readonly DependencyProperty VersionProperty = DependencyProperty.Register(nameof(Version), typeof(string), typeof(GameDataFile), new PropertyMetadata(string.Empty));
- public static readonly DependencyProperty HasErrorProperty = DependencyProperty.Register(nameof(HasError), typeof(bool), typeof(GameDataFile), new PropertyMetadata(false));
-
- public DateTime CreatedDate
- {
- get { return (DateTime)GetValue(CreatedDateProperty); }
- set { SetValue(CreatedDateProperty, value); }
- }
-
- public string File
- {
- get { return (string)GetValue(FileProperty); }
- set { SetValue(FileProperty, value); }
- }
-
- public string FileName
- {
- get { return (string)GetValue(FileNameProperty); }
- set { SetValue(FileNameProperty, value); }
- }
-
- public bool IsUserData
- {
- get { return (bool)GetValue(IsUserDataProperty); }
- set { SetValue(IsUserDataProperty, value); }
- }
-
- public string Version
- {
- get { return (string)GetValue(VersionProperty); }
- set { SetValue(VersionProperty, value); }
- }
-
- public bool HasError
- {
- get { return (bool)GetValue(HasErrorProperty); }
- set { SetValue(HasErrorProperty, value); }
- }
- }
-
private readonly GlobalizedApplication _globalizer = GlobalizedApplication.Instance;
public static readonly DependencyProperty GameDataFilesProperty = DependencyProperty.Register(nameof(GameDataFiles), typeof(GameDataFileList), typeof(GameDataWindow), new PropertyMetadata(null));
@@ -117,6 +63,7 @@ namespace ServerManagerTool
try
{
AddGameDataFile(GameData.UserDataFolder, dialog.FileName);
+ GameData.Reload();
}
catch (Exception ex)
{
@@ -135,6 +82,7 @@ namespace ServerManagerTool
{
DeleteAllGameDataFiles(GameData.UserDataFolder);
}
+ GameData.Reload();
}
catch (Exception ex)
{
@@ -166,6 +114,7 @@ namespace ServerManagerTool
try
{
ReloadGameDataFiles();
+ GameData.Reload();
}
catch (Exception ex)
{
@@ -182,6 +131,7 @@ namespace ServerManagerTool
{
var gameDataItem = ((GameDataFile)((Button)e.Source).DataContext);
DeleteGameDataFile(gameDataItem.File, true);
+ GameData.Reload();
}
catch (Exception ex)
{
diff --git a/src/ConanServerManager/Windows/MainWindow.xaml.cs b/src/ConanServerManager/Windows/MainWindow.xaml.cs
index 0f44483a..751a6251 100644
--- a/src/ConanServerManager/Windows/MainWindow.xaml.cs
+++ b/src/ConanServerManager/Windows/MainWindow.xaml.cs
@@ -246,6 +246,13 @@ namespace ServerManagerTool
this.Activate();
}
+ protected override void OnClosed(EventArgs e)
+ {
+ GlobalizedApplication.Instance.GlobalizationManager.ResourceDictionaryChangedEvent -= ResourceDictionaryChangedEvent;
+
+ base.OnClosed(e);
+ }
+
protected override void OnClosing(System.ComponentModel.CancelEventArgs e)
{
if (DiscordBotHelper.HasRunningCommands)
diff --git a/src/ConanServerManager/Windows/RconWindow.xaml.cs b/src/ConanServerManager/Windows/RconWindow.xaml.cs
index 84e4ca29..c137a187 100644
--- a/src/ConanServerManager/Windows/RconWindow.xaml.cs
+++ b/src/ConanServerManager/Windows/RconWindow.xaml.cs
@@ -238,6 +238,7 @@ namespace ServerManagerTool
// hook into the language change event
GlobalizedApplication.Instance.GlobalizationManager.ResourceDictionaryChangedEvent += ResourceDictionaryChangedEvent;
+ GameData.GameDataLoaded += GameData_GameDataLoaded;
}
#region Properties
@@ -554,13 +555,19 @@ namespace ServerManagerTool
return window;
}
- private void ResourceDictionaryChangedEvent(object source, ResourceDictionaryChangedEventArgs e)
+ private void GameData_GameDataLoaded(object sender, EventArgs e)
{
PopulateRconInputModesComboBox();
}
+ private void ResourceDictionaryChangedEvent(object source, ResourceDictionaryChangedEventArgs e)
+ {
+ GameData_GameDataLoaded(source, e);
+ }
+
protected override void OnClosed(EventArgs e)
{
+ GameData.GameDataLoaded -= GameData_GameDataLoaded;
GlobalizedApplication.Instance.GlobalizationManager.ResourceDictionaryChangedEvent -= ResourceDictionaryChangedEvent;
if (this.RconParameters?.Server?.Runtime != null)
diff --git a/src/ConanServerManager/Windows/SettingsWindow.xaml.cs b/src/ConanServerManager/Windows/SettingsWindow.xaml.cs
index 95eef649..e4555fda 100644
--- a/src/ConanServerManager/Windows/SettingsWindow.xaml.cs
+++ b/src/ConanServerManager/Windows/SettingsWindow.xaml.cs
@@ -13,24 +13,14 @@ namespace ServerManagerTool
///
public partial class SettingsWindow : Window
{
- public static readonly DependencyProperty AppInstanceProperty = DependencyProperty.Register(nameof(AppInstance), typeof(App), typeof(SettingsWindow), new PropertyMetadata(null));
-
private readonly GlobalizedApplication _globalizer = GlobalizedApplication.Instance;
public SettingsWindow()
{
- this.AppInstance = App.Instance;
-
InitializeComponent();
WindowUtils.RemoveDefaultResourceDictionary(this, Config.Default.DefaultGlobalizationFile);
}
- public App AppInstance
- {
- get { return GetValue(AppInstanceProperty) as App; }
- set { SetValue(AppInstanceProperty, value); }
- }
-
private void SettingsWindow_Closing(object sender, CancelEventArgs e)
{
if (!globalSettingsControl.IsEnabled)
@@ -39,6 +29,7 @@ namespace ServerManagerTool
protected override void OnClosed(EventArgs e)
{
+ globalSettingsControl.CloseControl();
globalSettingsControl.ApplyChangesToConfig();
if (SecurityUtils.IsAdministrator())