mirror of
https://github.com/tribufu/ServerManagers
synced 2026-05-06 15:17:34 +00:00
commit
174b5f14c9
38 changed files with 502 additions and 331 deletions
|
|
@ -252,6 +252,8 @@
|
|||
<Compile Include="Lib\ViewConverters\MapNameValueConverter.cs" />
|
||||
<Compile Include="Lib\ViewModel\Engram.cs" />
|
||||
<Compile Include="Lib\ViewModel\EngramSettings.cs" />
|
||||
<Compile Include="Lib\ViewModel\GameDataFile.cs" />
|
||||
<Compile Include="Lib\ViewModel\GameDataFileList.cs" />
|
||||
<Compile Include="Utils\DiscordBotHelper.cs" />
|
||||
<Compile Include="Utils\DiscordPluginHelper.cs" />
|
||||
<Compile Include="Utils\ModUtils.cs" />
|
||||
|
|
|
|||
|
|
@ -1098,7 +1098,7 @@
|
|||
<sys:String x:Key="ServerSettings_MapPathTooltip">标准地图名称 (例如. TheIsland,TheCenter,ScorchedEarth_P,Ragnarok).或本地MOD地图 例如:(/Game/Mods/504122600/Valhalla) 数字是MOD ID 后面是MOD地图名字,记得更新你的服务器下载MOD地图。</sys:String>
|
||||
<sys:String x:Key="ServerSettings_TotalConversionLabel">总转换MOD ID:</sys:String>
|
||||
<sys:String x:Key="ServerSettings_TotalConversionTooltip">总转换MOD ID,是方舟里的一个模式转换!.</sys:String>
|
||||
<sys:String x:Key="ServerSettings_FindTotalConversionMapNameTooltip">读取总转换MOD ID找到地图名称</sys:String>
|
||||
<sys:String x:Key="ServerSettings_FindTotalConversionMapNameTooltip">读取总转换MOD ID找到地图名称</sys:String>
|
||||
<sys:String x:Key="ServerSettings_FindTotalConversionMapNameSuccessTitle">查找总转换地图名称</sys:String>
|
||||
<sys:String x:Key="ServerSettings_FindTotalConversionMapNameSuccessLabel">地图名称已更新。</sys:String>
|
||||
<sys:String x:Key="ServerSettings_FindTotalConversionMapNameErrorTitle">查找总转换地图名称错误</sys:String>
|
||||
|
|
@ -1107,6 +1107,8 @@
|
|||
<sys:String x:Key="ServerSettings_ModIdsTooltip">每个Mod ID编号之间请使用“,”小写逗号来分开,以及以启动顺序来排列.</sys:String>
|
||||
<sys:String x:Key="ServerSettings_ModDetailsTooltip">查看MOD详细信息.</sys:String>
|
||||
<sys:String x:Key="ServerSettings_ModUpgradeTooltip">升级/下载 MOD到目前可用的最新版本。</sys:String>
|
||||
<sys:String x:Key="ServerSettings_ResetServerButtonLabel">重置</sys:String>
|
||||
<sys:String x:Key="ServerSettings_ResetServerButtonTooltip">删除所有的服务器、玩家和部落文件,并将你的服务器重新设置为新的。</sys:String>
|
||||
|
||||
<sys:String x:Key="ServerSettings_SavesLabel">保存</sys:String>
|
||||
<sys:String x:Key="ServerSettings_AutoSavesPeriodLabel">自动保存时间:</sys:String>
|
||||
|
|
@ -1180,7 +1182,7 @@
|
|||
<sys:String x:Key="ServerSettings_StasisKeepControllersTooltip">如果启用,服务器可以通过将人工智能保存在静态生物的内存中来获得性能。 注意:你的服务器必须有大量的内存,否则你的服务器会有很大的内存开销。</sys:String>
|
||||
<sys:String x:Key="ServerSettings_UseNoHangDetectionLabel">无挂起检测</sys:String>
|
||||
<sys:String x:Key="ServerSettings_UseNoHangDetectionTooltip">如果启用,可防止因挂起而导致的某些类型的崩溃(服务器挂起时,可能会出现服务器滞后的情况)。</sys:String>
|
||||
<sys:String x:Key="ServerSettings_NoDinosLabel">没有恐龙</sys:String>
|
||||
<sys:String x:Key="ServerSettings_NoDinosLabel">没有恐龙</sys:String>
|
||||
<sys:String x:Key="ServerSettings_NoDinosTooltip">如果启用,则不会在地图上产生恐龙。</sys:String>
|
||||
<sys:String x:Key="ServerSettings_ServerAllowAnselLabel">服务器允许NVIDIA Ansel技术</sys:String>
|
||||
<sys:String x:Key="ServerSettings_ServerAllowAnselTooltip">如果启用,在单个玩家中激活NVIDIA Ansel支持。 连接到服务器时,即使通电和点亮,这也会导致大多数灯(灯)不再起作用。</sys:String>
|
||||
|
|
@ -1519,6 +1521,10 @@
|
|||
<sys:String x:Key="ServerSettings_HexagonRewardMultiplierTooltip">设置六角币获得倍数.</sys:String>
|
||||
<sys:String x:Key="ServerSettings_HexagonCostMultiplierLabel">六角币消耗倍数</sys:String>
|
||||
<sys:String x:Key="ServerSettings_HexagonCostMultiplierTooltip">设置六角币消耗倍数.</sys:String>
|
||||
|
||||
<sys:String x:Key="ServerSettings_FjordurLabel">维京岛Fjordur</sys:String>
|
||||
<sys:String x:Key="ServerSettings_UseFjordurTraversalBuffLabel">启用维京生物群落的传送装置</sys:String>
|
||||
<sys:String x:Key="ServerSettings_UseFjordurTraversalBuffTooltip">如果启用,将允许在维京地图上进行生物群落传送。</sys:String>
|
||||
|
||||
<sys:String x:Key="ServerSettings_ItemStatClampsLabel">物品品质设置</sys:String>
|
||||
<sys:String x:Key="ServerSettings_ItemStatClampsNoteLabel">注意:这将永久改变现有物品的品质.</sys:String>
|
||||
|
|
|
|||
|
|
@ -17,6 +17,8 @@ namespace ServerManagerTool.Lib
|
|||
|
||||
public const string RCONINPUTMODE_COMMAND = "Command";
|
||||
|
||||
public static event EventHandler GameDataLoaded;
|
||||
|
||||
public static string MainDataFolder = Path.Combine(Environment.CurrentDirectory, Config.Default.GameDataDir);
|
||||
public static string UserDataFolder = Path.Combine(Config.Default.DataDir, Config.Default.GameDataDir);
|
||||
|
||||
|
|
@ -26,6 +28,12 @@ namespace ServerManagerTool.Lib
|
|||
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);
|
||||
|
|
@ -174,6 +182,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 Creatures
|
||||
|
|
|
|||
|
|
@ -26,10 +26,6 @@ namespace ServerManagerTool.Lib
|
|||
{
|
||||
}
|
||||
|
||||
public void UpdateForLocalization()
|
||||
{
|
||||
}
|
||||
|
||||
public void Update(bool recursive = true)
|
||||
{
|
||||
IsEnabled = this.Count > 0;
|
||||
|
|
@ -118,7 +114,15 @@ namespace ServerManagerTool.Lib
|
|||
resource.Update();
|
||||
}
|
||||
|
||||
ValidStatus = IsValid ? (BaseCraftingResourceRequirements.Any(i => i.ValidStatus == "N") ? "N" : (BaseCraftingResourceRequirements.Any(i => i.ValidStatus == "W") ? "W" : "Y")) : "N";
|
||||
ValidStatus = IsValid
|
||||
? (BaseCraftingResourceRequirements.Any(i => i.ValidStatus == "N")
|
||||
? "N"
|
||||
: (BaseCraftingResourceRequirements.Any(i => i.ValidStatus == "W")
|
||||
? "W"
|
||||
: (GameData.HasItemForClass(ItemClassString)
|
||||
? "Y"
|
||||
: "W")))
|
||||
: "N";
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -186,7 +190,11 @@ namespace ServerManagerTool.Lib
|
|||
|
||||
public void Update()
|
||||
{
|
||||
ValidStatus = IsValid ? (GameData.HasItemForClass(ResourceItemTypeString) ? "Y" : "W") : "N";
|
||||
ValidStatus = IsValid
|
||||
? (GameData.HasItemForClass(ResourceItemTypeString)
|
||||
? "Y"
|
||||
: "W")
|
||||
: "N";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -25,10 +25,6 @@ namespace ServerManagerTool.Lib
|
|||
{
|
||||
}
|
||||
|
||||
public void UpdateForLocalization()
|
||||
{
|
||||
}
|
||||
|
||||
public void Update()
|
||||
{
|
||||
IsEnabled = this.Count > 0;
|
||||
|
|
@ -98,7 +94,11 @@ namespace ServerManagerTool.Lib
|
|||
|
||||
public void Update()
|
||||
{
|
||||
ValidStatus = IsValid ? (GameData.HasCreatureForClass(DinoClassString) ? "Y" : "W") : "N";
|
||||
ValidStatus = IsValid
|
||||
? (GameData.HasCreatureForClass(DinoClassString)
|
||||
? "Y"
|
||||
: "W")
|
||||
: "N";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -44,10 +44,6 @@ namespace ServerManagerTool.Lib
|
|||
}
|
||||
}
|
||||
|
||||
public void UpdateForLocalization()
|
||||
{
|
||||
}
|
||||
|
||||
public void Update()
|
||||
{
|
||||
IsEnabled = this.Count > 0;
|
||||
|
|
@ -160,7 +156,11 @@ namespace ServerManagerTool.Lib
|
|||
|
||||
public void Update()
|
||||
{
|
||||
ValidStatus = IsValid ? (GameData.HasItemForClass(ItemClassString) ? "Y" : "W") : "N";
|
||||
ValidStatus = IsValid
|
||||
? (GameData.HasItemForClass(ItemClassString)
|
||||
? "Y"
|
||||
: "W")
|
||||
: "N";
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -72,10 +72,6 @@ namespace ServerManagerTool.Lib
|
|||
}
|
||||
}
|
||||
|
||||
public void UpdateForLocalization()
|
||||
{
|
||||
}
|
||||
|
||||
public void Update(bool recursive = true)
|
||||
{
|
||||
IsEnabled = this.Count > 0;
|
||||
|
|
@ -226,7 +222,15 @@ namespace ServerManagerTool.Lib
|
|||
itemSet.Update(recursive);
|
||||
}
|
||||
|
||||
ValidStatus = IsViewValid ? (ItemSets.Any(i => i.ValidStatus == "N") ? "N" : (ItemSets.Any(i => i.ValidStatus == "W") ? "W" : "Y")) : "N";
|
||||
ValidStatus = IsViewValid
|
||||
? (ItemSets.Any(i => i.ValidStatus == "N")
|
||||
? "N"
|
||||
: (ItemSets.Any(i => i.ValidStatus == "W")
|
||||
? "W"
|
||||
: (GameData.HasSupplyCrateForClass(SupplyCrateClassString)
|
||||
? "Y"
|
||||
: "W")))
|
||||
: "N";
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -340,7 +344,13 @@ namespace ServerManagerTool.Lib
|
|||
itemEntry.Update(recursive);
|
||||
}
|
||||
|
||||
ValidStatus = IsViewValid ? (ItemEntries.Any(i => i.ValidStatus == "N") ? "N" : (ItemEntries.Any(i => i.ValidStatus == "W") ? "W" : "Y")) : "N";
|
||||
ValidStatus = IsViewValid
|
||||
? (ItemEntries.Any(i => i.ValidStatus == "N")
|
||||
? "N"
|
||||
: (ItemEntries.Any(i => i.ValidStatus == "W")
|
||||
? "W"
|
||||
: "Y"))
|
||||
: "N";
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -495,7 +505,13 @@ namespace ServerManagerTool.Lib
|
|||
item.Update();
|
||||
}
|
||||
|
||||
ValidStatus = IsViewValid ? (Items.Any(i => i.ValidStatus == "N") ? "N" : (Items.Any(i => i.ValidStatus == "W") ? "W" : "Y")) : "N";
|
||||
ValidStatus = IsViewValid
|
||||
? (Items.Any(i => i.ValidStatus == "N")
|
||||
? "N"
|
||||
: (Items.Any(i => i.ValidStatus == "W")
|
||||
? "W"
|
||||
: "Y"))
|
||||
: "N";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -317,13 +317,5 @@ namespace ServerManagerTool.Lib.ViewModel
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void UpdateForLocalization()
|
||||
{
|
||||
//foreach (var dinoSetting in this)
|
||||
//{
|
||||
// dinoSetting.FriendlyName = GameData.FriendlyNameForClass(dinoSetting.ClassName);
|
||||
//}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -174,10 +174,6 @@ namespace ServerManagerTool.Lib.ViewModel
|
|||
}
|
||||
}
|
||||
|
||||
public void UpdateForLocalization()
|
||||
{
|
||||
}
|
||||
|
||||
#region INotifyPropertyChanged
|
||||
private Dictionary<string, object> _properties = new Dictionary<string, object>();
|
||||
|
||||
|
|
|
|||
51
src/ARKServerManager/Lib/ViewModel/GameDataFile.cs
Normal file
51
src/ARKServerManager/Lib/ViewModel/GameDataFile.cs
Normal file
|
|
@ -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); }
|
||||
}
|
||||
}
|
||||
}
|
||||
12
src/ARKServerManager/Lib/ViewModel/GameDataFileList.cs
Normal file
12
src/ARKServerManager/Lib/ViewModel/GameDataFileList.cs
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
using ServerManagerTool.Common.Model;
|
||||
|
||||
namespace ServerManagerTool.Lib.ViewModel
|
||||
{
|
||||
public class GameDataFileList : SortableObservableCollection<GameDataFile>
|
||||
{
|
||||
public override string ToString()
|
||||
{
|
||||
return $"{nameof(GameDataFile)} - {Count}";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -195,10 +195,6 @@ namespace ServerManagerTool.Lib.ViewModel
|
|||
}
|
||||
}
|
||||
|
||||
public void UpdateForLocalization()
|
||||
{
|
||||
}
|
||||
|
||||
public void Update(bool recursive = true)
|
||||
{
|
||||
foreach (var npcSpawn in this)
|
||||
|
|
@ -307,7 +303,15 @@ namespace ServerManagerTool.Lib.ViewModel
|
|||
itemSet.Update();
|
||||
}
|
||||
|
||||
ValidStatus = IsViewValid ? (NPCSpawnEntrySettings.Any(i => i.ValidStatus == "N") ? "N" : (NPCSpawnEntrySettings.Any(i => i.ValidStatus == "W") ? "W" : "Y")) : "N";
|
||||
ValidStatus = IsViewValid
|
||||
? (NPCSpawnEntrySettings.Any(i => i.ValidStatus == "N")
|
||||
? "N"
|
||||
: (NPCSpawnEntrySettings.Any(i => i.ValidStatus == "W")
|
||||
? "W"
|
||||
: (GameData.HasMapSpawnerForClass(NPCSpawnEntriesContainerClassString)
|
||||
? "Y"
|
||||
: "W")))
|
||||
: "N";
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -354,7 +358,11 @@ namespace ServerManagerTool.Lib.ViewModel
|
|||
|
||||
public void Update()
|
||||
{
|
||||
ValidStatus = IsValid ? (GameData.HasCreatureForClass(NPCClassString) ? "Y" : "W") : "N";
|
||||
ValidStatus = IsValid
|
||||
? (GameData.HasCreatureForClass(NPCClassString)
|
||||
? "Y"
|
||||
: "W")
|
||||
: "N";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -40,7 +40,11 @@ namespace ServerManagerTool.Lib.ViewModel
|
|||
|
||||
public void Update()
|
||||
{
|
||||
ValidStatus = IsViewValid ? (GameData.HasItemForClass(ItemClassString) ? "Y" : "W") : "N";
|
||||
ValidStatus = IsViewValid
|
||||
? (GameData.HasItemForClass(ItemClassString)
|
||||
? "Y"
|
||||
: "W")
|
||||
: "N";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -128,7 +128,14 @@
|
|||
<Setter Property="Margin" Value="2"/>
|
||||
<Setter Property="Padding" Value="0"/>
|
||||
</Style>
|
||||
|
||||
|
||||
<Style x:Key="ButtonStyle4" TargetType="Button" BasedOn="{StaticResource {x:Type Button}}">
|
||||
<Setter Property="BorderThickness" Value="0"/>
|
||||
<Setter Property="Height" Value="22"/>
|
||||
<Setter Property="Margin" Value="2"/>
|
||||
<Setter Property="Padding" Value="0"/>
|
||||
</Style>
|
||||
|
||||
<Style x:Key="ButtonStyle5" TargetType="Button" BasedOn="{StaticResource ButtonStyle1}">
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
|
|
@ -563,6 +570,12 @@
|
|||
<Setter Property="TextWrapping" Value="Wrap"/>
|
||||
</Style>
|
||||
|
||||
<ContentControl x:Key="ServerMonitorButtonContent">
|
||||
<StackPanel Orientation="Horizontal" Height="20" Margin="0,0,5,0">
|
||||
<Image Margin="5,1,5,0" Source="{com:Icon Path=/Ark Server Manager;component/Art/Servers.ico,Size=32}" Width="16" VerticalAlignment="Center"/>
|
||||
<Label Content="{DynamicResource ServerMonitor_Title}" VerticalAlignment="Center" Padding="0"/>
|
||||
</StackPanel>
|
||||
</ContentControl>
|
||||
<ContentControl x:Key="SupportZipButtonContent">
|
||||
<StackPanel Orientation="Horizontal" Height="27">
|
||||
<Image Margin="5,0,5,0" Source="{com:Icon Path=/Ark Server Manager;component/Art/Zip.ico,Size=32}" Width="16" VerticalAlignment="Center"/>
|
||||
|
|
|
|||
|
|
@ -65,6 +65,8 @@ namespace ServerManagerTool
|
|||
}
|
||||
|
||||
this.DataContext = this;
|
||||
|
||||
GameData.GameDataLoaded += GameData_GameDataLoaded;
|
||||
}
|
||||
|
||||
public App AppInstance
|
||||
|
|
@ -396,15 +398,21 @@ 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);
|
||||
}
|
||||
|
||||
|
|
@ -490,6 +498,11 @@ namespace ServerManagerTool
|
|||
}
|
||||
}
|
||||
|
||||
public void CloseControl()
|
||||
{
|
||||
GameData.GameDataLoaded -= GameData_GameDataLoaded;
|
||||
}
|
||||
|
||||
private void PopulateWindowsStatesMainWindowComboBox()
|
||||
{
|
||||
var selectedValue = this.WindowStateMainWindowComboBox?.SelectedValue ?? Config.MainWindow_WindowState;
|
||||
|
|
|
|||
|
|
@ -342,9 +342,36 @@ 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.RefreshBaseDinoModList();
|
||||
this.RefreshBaseEngramModList();
|
||||
this.RefreshBaseResourceModList();
|
||||
|
||||
this.RefreshBaseDinoList();
|
||||
this.RefreshBaseMapSpawnerList();
|
||||
this.RefreshBasePrimalItemList();
|
||||
this.RefreshBaseSupplyCrateList();
|
||||
this.RefreshBaseGameMapsList();
|
||||
this.RefreshBaseTotalConversionsList();
|
||||
this.RefreshBaseBranchesList();
|
||||
this.RefreshBaseEventsList();
|
||||
this.RefreshProcessPrioritiesList();
|
||||
this.RefreshCustomLevelProgressionsInformation();
|
||||
|
||||
this.HarvestResourceItemAmountClassMultipliersListBox.Items.Refresh();
|
||||
|
||||
this.Settings.ConfigOverrideItemCraftingCosts.Update();
|
||||
this.Settings.ConfigOverrideItemMaxQuantity.Update();
|
||||
this.Settings.ConfigOverrideSupplyCrateItems.Update();
|
||||
this.Settings.NPCSpawnSettings.Update();
|
||||
this.Settings.PreventTransferForClassNames.Update();
|
||||
}
|
||||
|
||||
private static void ServerPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
|
||||
{
|
||||
var ssc = (ServerSettingsControl)d;
|
||||
|
|
@ -378,30 +405,8 @@ namespace ServerManagerTool
|
|||
{
|
||||
this.CurrentCulture = Thread.CurrentThread.CurrentCulture;
|
||||
|
||||
this.Settings.DinoSettings.UpdateForLocalization();
|
||||
this.Settings.EngramSettings.UpdateForLocalization();
|
||||
this.Settings.NPCSpawnSettings.UpdateForLocalization();
|
||||
this.Settings.ConfigOverrideSupplyCrateItems.UpdateForLocalization();
|
||||
this.Settings.ConfigOverrideItemMaxQuantity.UpdateForLocalization();
|
||||
|
||||
this.RefreshBaseDinoModList();
|
||||
this.RefreshBaseEngramModList();
|
||||
this.RefreshBaseResourceModList();
|
||||
|
||||
this.RefreshBaseDinoList();
|
||||
this.RefreshBaseMapSpawnerList();
|
||||
this.RefreshBasePrimalItemList();
|
||||
this.RefreshBaseSupplyCrateList();
|
||||
this.RefreshBaseGameMapsList();
|
||||
this.RefreshBaseTotalConversionsList();
|
||||
this.RefreshBaseBranchesList();
|
||||
this.RefreshBaseEventsList();
|
||||
this.RefreshProcessPrioritiesList();
|
||||
|
||||
this.HarvestResourceItemAmountClassMultipliersListBox.Items.Refresh();
|
||||
|
||||
this.RefreshCustomLevelProgressionsInformation();
|
||||
this.UpdateLastStartedDetails(false);
|
||||
GameData_GameDataLoaded(source, e);
|
||||
|
||||
Runtime.UpdateServerStatusString();
|
||||
}
|
||||
|
|
@ -3487,6 +3492,12 @@ namespace ServerManagerTool
|
|||
#endregion
|
||||
|
||||
#region Methods
|
||||
public void CloseControl()
|
||||
{
|
||||
GameData.GameDataLoaded -= GameData_GameDataLoaded;
|
||||
GlobalizedApplication.Instance.GlobalizationManager.ResourceDictionaryChangedEvent -= ResourceDictionaryChangedEvent;
|
||||
}
|
||||
|
||||
public void RefreshBaseDinoModList()
|
||||
{
|
||||
var selectedValue = SelectedModDino;
|
||||
|
|
|
|||
|
|
@ -5,7 +5,31 @@
|
|||
<title>Ark Server Manager Version Feed</title>
|
||||
<subtitle>This is the Ark Server Manager release version feed.</subtitle>
|
||||
<link href="http://arkservermanager.freeforums.net/" />
|
||||
<updated>2022-06-16T00:00:00Z</updated>
|
||||
<updated>2022-06-17T00:00:00Z</updated>
|
||||
|
||||
<entry>
|
||||
<id>urn:uuid:1AE0925B-64EB-4177-B834-7A75FA46E807</id>
|
||||
<title>1.1.433 (1.1.433.2)</title>
|
||||
<summary>1.1.433.2</summary>
|
||||
<link href="" />
|
||||
<updated>2022-06-17T00:00:00Z</updated>
|
||||
<content type="xhtml">
|
||||
<div xmlns="http://www.w3.org/1999/xhtml" style="font-family: Arial, Verdana, Helvetica, Sans-Serif;font-size: .8em;">
|
||||
<p>
|
||||
<u style="font-size: .9em;">CHANGE</u>
|
||||
<br/>
|
||||
<ul>
|
||||
<li>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.</li>
|
||||
<li>zh-CN Translation file updated.</li>
|
||||
</ul>
|
||||
</p>
|
||||
</div>
|
||||
</content>
|
||||
<author>
|
||||
<name>bletch</name>
|
||||
<email>bletch1971@hotmail.com</email>
|
||||
</author>
|
||||
</entry>
|
||||
|
||||
<entry>
|
||||
<id>urn:uuid:93A04A12-C632-4C2B-AC76-42D9E476431C</id>
|
||||
|
|
|
|||
|
|
@ -5,48 +5,21 @@
|
|||
<title>Ark Server Manager Version Feed</title>
|
||||
<subtitle>This is the Ark Server Manager beta version feed.</subtitle>
|
||||
<link href="http://arkservermanager.freeforums.net/" />
|
||||
<updated>2022-06-16T00:00:00Z</updated>
|
||||
<updated>2022-06-17T00:00:00Z</updated>
|
||||
|
||||
<entry>
|
||||
<id>urn:uuid:DB240E90-17B0-4DE1-B60B-0D5E4753810F</id>
|
||||
<title>1.1.432 (1.1.432.4)</title>
|
||||
<summary>1.1.432.4</summary>
|
||||
<id>urn:uuid:1AE0925B-64EB-4177-B834-7A75FA46E807</id>
|
||||
<title>1.1.433 (1.1.433.2)</title>
|
||||
<summary>1.1.433.2</summary>
|
||||
<link href="" />
|
||||
<updated>2022-06-16T00:00:00Z</updated>
|
||||
<content type="xhtml">
|
||||
<div xmlns="http://www.w3.org/1999/xhtml" style="font-family: Arial, Verdana, Helvetica, Sans-Serif;font-size: .8em;">
|
||||
<p>
|
||||
<u style="font-size: .9em;">NEW</u>
|
||||
<br/>
|
||||
<ul>
|
||||
<li>Profile Settings - Rules Section - Added UseFjordurTraversalBuff setting. Located in the Fjordur group at the bottom of the Rules section.</li>
|
||||
</ul>
|
||||
</p>
|
||||
</div>
|
||||
</content>
|
||||
<author>
|
||||
<name>bletch</name>
|
||||
<email>bletch1971@hotmail.com</email>
|
||||
</author>
|
||||
</entry>
|
||||
|
||||
<entry>
|
||||
<id>urn:uuid:EB7309A6-5E1F-4F97-A813-CDCFC51A9A7C</id>
|
||||
<title>1.1.432 (1.1.432.3)</title>
|
||||
<summary>1.1.432.3</summary>
|
||||
<link href="" />
|
||||
<updated>2022-06-16T00:00:00Z</updated>
|
||||
<updated>2022-06-17T00:00:00Z</updated>
|
||||
<content type="xhtml">
|
||||
<div xmlns="http://www.w3.org/1999/xhtml" style="font-family: Arial, Verdana, Helvetica, Sans-Serif;font-size: .8em;">
|
||||
<p>
|
||||
<u style="font-size: .9em;">CHANGE</u>
|
||||
<br/>
|
||||
<ul>
|
||||
<li>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.</li>
|
||||
<li>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.</li>
|
||||
<li>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.</li>
|
||||
<li>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.</li>
|
||||
<li>Server Monitor - added shutdown reason.</li>
|
||||
<li>zh-CN Translation file updated.</li>
|
||||
</ul>
|
||||
</p>
|
||||
</div>
|
||||
|
|
@ -58,41 +31,18 @@
|
|||
</entry>
|
||||
|
||||
<entry>
|
||||
<id>urn:uuid:93A04A12-C632-4C2B-AC76-42D9E476431C</id>
|
||||
<title>1.1.432 (1.1.432.2)</title>
|
||||
<summary>1.1.432.2</summary>
|
||||
<id>urn:uuid:1AE0925B-64EB-4177-B834-7A75FA46E807</id>
|
||||
<title>1.1.433 (1.1.433.1)</title>
|
||||
<summary>1.1.433.1</summary>
|
||||
<link href="" />
|
||||
<updated>2022-06-16T00:00:00Z</updated>
|
||||
<updated>2022-06-17T00:00:00Z</updated>
|
||||
<content type="xhtml">
|
||||
<div xmlns="http://www.w3.org/1999/xhtml" style="font-family: Arial, Verdana, Helvetica, Sans-Serif;font-size: .8em;">
|
||||
<p>
|
||||
<u style="font-size: .9em;">CHANGE</u>
|
||||
<br/>
|
||||
<ul>
|
||||
<li>Gamedata Files - changed the Fjordur official mod to the correct mod id.</li>
|
||||
</ul>
|
||||
</p>
|
||||
</div>
|
||||
</content>
|
||||
<author>
|
||||
<name>bletch</name>
|
||||
<email>bletch1971@hotmail.com</email>
|
||||
</author>
|
||||
</entry>
|
||||
|
||||
<entry>
|
||||
<id>urn:uuid:93A04A12-C632-4C2B-AC76-42D9E476431C</id>
|
||||
<title>1.1.432 (1.1.432.1)</title>
|
||||
<summary>1.1.432.1</summary>
|
||||
<link href="" />
|
||||
<updated>2022-06-16T00:00:00Z</updated>
|
||||
<content type="xhtml">
|
||||
<div xmlns="http://www.w3.org/1999/xhtml" style="font-family: Arial, Verdana, Helvetica, Sans-Serif;font-size: .8em;">
|
||||
<p>
|
||||
<u style="font-size: .9em;">NEW</u>
|
||||
<br/>
|
||||
<ul>
|
||||
<li>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.</li>
|
||||
<li>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.</li>
|
||||
</ul>
|
||||
</p>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -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
|
|||
/// </summary>
|
||||
public partial class GameDataWindow : Window
|
||||
{
|
||||
public class GameDataFileList : SortableObservableCollection<GameDataFile>
|
||||
{
|
||||
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)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -94,38 +94,35 @@
|
|||
<ColumnDefinition MinWidth="25"/>
|
||||
<ColumnDefinition MinWidth="25"/>
|
||||
<ColumnDefinition MinWidth="25"/>
|
||||
<ColumnDefinition MinWidth="25"/>
|
||||
<ColumnDefinition MinWidth="25"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<Button Grid.Row="0" Grid.Column="5" Margin="5,2,0,0" Grid.ColumnSpan="3" Click="Donate_Click" ToolTip="{DynamicResource MainWindow_DonateTooltip}" Style="{StaticResource ButtonStyle3}">
|
||||
<Button Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="5" Margin="5,2,0,0" HorizontalAlignment="Right" Click="Donate_Click" ToolTip="{DynamicResource MainWindow_DonateTooltip}" Style="{StaticResource ButtonStyle3}">
|
||||
<Image Source="../Art/Donate.png"/>
|
||||
</Button>
|
||||
|
||||
<Button Grid.Row="2" Grid.Column="0" Margin="5,0,0,0" Click="ServerMonitor_Click" ToolTip="{DynamicResource MainWindow_OpenServerMonitorTooltip}" Style="{StaticResource ButtonStyle1}">
|
||||
<Image Source="{com:Icon Path=/Ark Server Manager;component/Art/Servers.ico,Size=32}"/>
|
||||
<Button Grid.Row="0" Grid.Column="5" Margin="5,2,0,0" HorizontalAlignment="Right" Click="Help_Click" ToolTip="{DynamicResource MainWindow_OpenHelpTooltip}" Style="{StaticResource ButtonStyle1}">
|
||||
<Image Source="{com:Icon Path=/Ark Server Manager;component/Art/Help.ico,Size=32}"/>
|
||||
</Button>
|
||||
<Button Grid.Row="2" Grid.Column="1" Margin="5,0,0,0" HorizontalAlignment="Right" Click="GameData_Click" ToolTip="{DynamicResource MainWindow_OpenGameDataTooltip}" Style="{StaticResource ButtonStyle1}">
|
||||
|
||||
<Button Grid.Row="1" Grid.Column="0" Grid.ColumnSpan="6" Margin="5,0,0,0" Height="26" HorizontalAlignment="Right" Click="ServerMonitor_Click" Content="{StaticResource ServerMonitorButtonContent}" ToolTip="{DynamicResource MainWindow_OpenServerMonitorTooltip}"/>
|
||||
|
||||
<Button Grid.Row="2" Grid.Column="0" Margin="5,0,0,0" HorizontalAlignment="Right" Click="GameData_Click" ToolTip="{DynamicResource MainWindow_OpenGameDataTooltip}" Style="{StaticResource ButtonStyle1}">
|
||||
<Image Source="{com:Icon Path=/Ark Server Manager;component/Art/Document.ico,Size=32}"/>
|
||||
</Button>
|
||||
<Button Grid.Row="2" Grid.Column="2" Margin="5,0,0,0" HorizontalAlignment="Right" Click="Plugins_Click" ToolTip="{DynamicResource MainWindow_OpenPluginsTooltip}" Style="{StaticResource ButtonStyle1}">
|
||||
<Button Grid.Row="2" Grid.Column="1" Margin="5,0,0,0" HorizontalAlignment="Right" Click="Plugins_Click" ToolTip="{DynamicResource MainWindow_OpenPluginsTooltip}" Style="{StaticResource ButtonStyle1}">
|
||||
<Image Source="{com:Icon Path=/Ark Server Manager;component/Art/Plugin.ico,Size=32}"/>
|
||||
</Button>
|
||||
<Button Grid.Row="2" Grid.Column="3" Margin="5,0,0,0" HorizontalAlignment="Right" Click="OpenLogFolder_Click" ToolTip="{DynamicResource MainWindow_OpenLogFolderTooltip}" Style="{StaticResource ButtonStyle1}">
|
||||
<Button Grid.Row="2" Grid.Column="2" Margin="5,0,0,0" HorizontalAlignment="Right" Click="OpenLogFolder_Click" ToolTip="{DynamicResource MainWindow_OpenLogFolderTooltip}" Style="{StaticResource ButtonStyle1}">
|
||||
<Image Source="{com:Icon Path=/Ark Server Manager;component/Art/Logs.ico,Size=32}"/>
|
||||
</Button>
|
||||
<Button Grid.Row="2" Grid.Column="4" Margin="5,0,0,0" HorizontalAlignment="Right" Click="RCON_Click" ToolTip="{DynamicResource MainWindow_OpenRCONTooltip}" Style="{StaticResource ButtonStyle1}">
|
||||
<Button Grid.Row="2" Grid.Column="3" Margin="5,0,0,0" HorizontalAlignment="Right" Click="RCON_Click" ToolTip="{DynamicResource MainWindow_OpenRCONTooltip}" Style="{StaticResource ButtonStyle1}">
|
||||
<Image Source="{com:Icon Path=/Ark Server Manager;component/Art/Command.ico,Size=32}"/>
|
||||
</Button>
|
||||
<Button Grid.Row="2" Grid.Column="5" Margin="5,0,0,0" HorizontalAlignment="Right" Click="SteamCMD_Click" ToolTip="{DynamicResource MainWindow_SteamCMDTooltip}" Style="{StaticResource ButtonStyle1}">
|
||||
<Button Grid.Row="2" Grid.Column="4" Margin="5,0,0,0" HorizontalAlignment="Right" Click="SteamCMD_Click" ToolTip="{DynamicResource MainWindow_SteamCMDTooltip}" Style="{StaticResource ButtonStyle1}">
|
||||
<Image Source="{com:Icon Path=/Ark Server Manager;component/Art/Steam.ico,Size=32}"/>
|
||||
</Button>
|
||||
<Button Grid.Row="2" Grid.Column="6" Margin="5,0,0,0" HorizontalAlignment="Right" Click="Settings_Click" ToolTip="{DynamicResource MainWindow_OpenSettingsTooltip}" Style="{StaticResource ButtonStyle1}">
|
||||
<Button Grid.Row="2" Grid.Column="5" Margin="5,0,0,0" HorizontalAlignment="Right" Click="Settings_Click" ToolTip="{DynamicResource MainWindow_OpenSettingsTooltip}" Style="{StaticResource ButtonStyle1}">
|
||||
<Image Source="{com:Icon Path=/Ark Server Manager;component/Art/Settings.ico,Size=32}"/>
|
||||
</Button>
|
||||
<Button Grid.Row="2" Grid.Column="7" Margin="5,2,0,0" HorizontalAlignment="Right" Click="Help_Click" ToolTip="{DynamicResource MainWindow_OpenHelpTooltip}" Style="{StaticResource ButtonStyle1}">
|
||||
<Image Source="{com:Icon Path=/Ark Server Manager;component/Art/Help.ico,Size=32}"/>
|
||||
</Button>
|
||||
</Grid>
|
||||
|
||||
<Grid DockPanel.Dock="Right" VerticalAlignment="Top" Margin="10,0,10,0">
|
||||
|
|
@ -353,11 +350,11 @@
|
|||
</Grid>
|
||||
</DockPanel>
|
||||
|
||||
<eo:TabControl Name="Tabs" Grid.Row ="1" Margin="0,5,0,0" ShowCloseTabButton="True" ShowNewTabButton="True" NewItemRequested="Servers_AddNew" PreviewItemClose="Servers_Remove" ItemsSource="{Binding ServerManager.Servers}">
|
||||
<eo:TabControl Name="Tabs" Grid.Row="1" Margin="0" ShowCloseTabButton="True" ShowNewTabButton="True" NewItemRequested="Servers_AddNew" PreviewItemClose="Servers_Remove" ItemsSource="{Binding ServerManager.Servers}">
|
||||
<eo:TabControl.HeaderTemplate>
|
||||
<DataTemplate>
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<Button Grid.Row="0" Grid.Column="4" Margin="5,0,0,0" Command="{Binding StatusButtonCommand, ElementName=Main}" CommandParameter="{Binding}">
|
||||
<StackPanel Orientation="Horizontal" Height="20">
|
||||
<Button Margin="0" Command="{Binding StatusButtonCommand, ElementName=Main}" CommandParameter="{Binding}">
|
||||
<Button.Style>
|
||||
<Style BasedOn="{StaticResource ButtonStyle5}" TargetType="{x:Type Button}">
|
||||
<Style.Triggers>
|
||||
|
|
@ -418,7 +415,7 @@
|
|||
</Style.Triggers>
|
||||
</Style>
|
||||
</Button.Style>
|
||||
<Image Margin="0,2" VerticalAlignment="Center" Width="16" Height="16">
|
||||
<Image Margin="0" VerticalAlignment="Center" Width="16" Height="16">
|
||||
<Image.Style>
|
||||
<Style TargetType="{x:Type Image}">
|
||||
<Style.Triggers>
|
||||
|
|
@ -459,7 +456,7 @@
|
|||
</Image.Style>
|
||||
</Image>
|
||||
</Button>
|
||||
<TextBlock Margin="2" VerticalAlignment="Center" Text="{Binding Profile.ProfileName}" ToolTip="{Binding Profile.ProfileToolTip}">
|
||||
<TextBlock Margin="0" VerticalAlignment="Center" Text="{Binding Profile.ProfileName}">
|
||||
<TextBlock.Style>
|
||||
<Style TargetType="{x:Type TextBlock}">
|
||||
<Setter Property="Foreground" Value="Black"/>
|
||||
|
|
@ -505,7 +502,7 @@
|
|||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate>
|
||||
<Image Margin="0,2" VerticalAlignment="Center" Source="{com:Icon Path=/Ark Server Manager;component/Art/Delete.ico,Size=32}" Width="16" Height="16" ToolTip="{DynamicResource MainWindow_CloseProfileTooltip}"/>
|
||||
<Image Margin="2" VerticalAlignment="Center" Source="{com:Icon Path=/Ark Server Manager;component/Art/Delete.ico,Size=32}" Width="10" Height="10" ToolTip="{DynamicResource MainWindow_CloseProfileTooltip}"/>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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}" >
|
||||
<Window.Resources>
|
||||
<ResourceDictionary>
|
||||
|
|
@ -16,6 +17,6 @@
|
|||
</ResourceDictionary>
|
||||
</Window.Resources>
|
||||
<Grid>
|
||||
<local:GlobalSettingsControl x:Name="globalSettingsControl" HorizontalAlignment="Stretch" VerticalContentAlignment="Stretch" Background="{StaticResource BeigeGradient}"/>
|
||||
<sm:GlobalSettingsControl x:Name="globalSettingsControl" HorizontalAlignment="Stretch" VerticalContentAlignment="Stretch" Background="{StaticResource BeigeGradient}"/>
|
||||
</Grid>
|
||||
</Window>
|
||||
|
|
|
|||
|
|
@ -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())
|
||||
|
|
|
|||
|
|
@ -212,6 +212,8 @@
|
|||
<Compile Include="Lib\ServerRcon.cs" />
|
||||
<Compile Include="Lib\ViewConverters\EnumDescriptionTypeConverter.cs" />
|
||||
<Compile Include="Lib\ViewConverters\MapNameValueConverter.cs" />
|
||||
<Compile Include="Lib\ViewModel\GameDataFile.cs" />
|
||||
<Compile Include="Lib\ViewModel\GameDataFileList.cs" />
|
||||
<Compile Include="Lib\ViewModel\PlayerInfo.cs" />
|
||||
<Compile Include="Utils\DiscordBotHelper.cs" />
|
||||
<Compile Include="Utils\DiscordPluginHelper.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
|
||||
|
|
|
|||
51
src/ConanServerManager/Lib/ViewModel/GameDataFile.cs
Normal file
51
src/ConanServerManager/Lib/ViewModel/GameDataFile.cs
Normal file
|
|
@ -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); }
|
||||
}
|
||||
}
|
||||
}
|
||||
12
src/ConanServerManager/Lib/ViewModel/GameDataFileList.cs
Normal file
12
src/ConanServerManager/Lib/ViewModel/GameDataFileList.cs
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
using ServerManagerTool.Common.Model;
|
||||
|
||||
namespace ServerManagerTool.Lib.ViewModel
|
||||
{
|
||||
public class GameDataFileList : SortableObservableCollection<GameDataFile>
|
||||
{
|
||||
public override string ToString()
|
||||
{
|
||||
return $"{nameof(GameDataFile)} - {Count}";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -118,6 +118,12 @@
|
|||
<Setter Property="Margin" Value="2"/>
|
||||
<Setter Property="Padding" Value="0"/>
|
||||
</Style>
|
||||
<Style x:Key="ButtonStyle4" TargetType="Button" BasedOn="{StaticResource {x:Type Button}}">
|
||||
<Setter Property="BorderThickness" Value="0"/>
|
||||
<Setter Property="Height" Value="22"/>
|
||||
<Setter Property="Margin" Value="2"/>
|
||||
<Setter Property="Padding" Value="0"/>
|
||||
</Style>
|
||||
<Style x:Key="ButtonStyle5" TargetType="Button" BasedOn="{StaticResource ButtonStyle1}">
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
|
|
@ -507,6 +513,12 @@
|
|||
|
||||
<SolidColorBrush x:Key="WarningMessage" Color="Red"/>
|
||||
|
||||
<ContentControl x:Key="ServerMonitorButtonContent">
|
||||
<StackPanel Orientation="Horizontal" Height="20" Margin="0,0,5,0">
|
||||
<Image Margin="5,1,5,0" Source="{com:Icon Path=/ConanServerManager;component/Art/Servers.ico,Size=32}" Width="16" VerticalAlignment="Center"/>
|
||||
<Label Content="{DynamicResource ServerMonitor_Title}" VerticalAlignment="Center" Padding="0"/>
|
||||
</StackPanel>
|
||||
</ContentControl>
|
||||
<ContentControl x:Key="SupportZipButtonContent">
|
||||
<StackPanel Orientation="Horizontal" Height="27">
|
||||
<Image Margin="5,0,5,0" Source="{com:Icon Path=/ConanServerManager;component/Art/Zip.ico,Size=32}" Width="16" VerticalAlignment="Center"/>
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
|
|
|
|||
|
|
@ -5,7 +5,30 @@
|
|||
<title>Conan Server Manager Version Feed</title>
|
||||
<subtitle>This is the Conan Server Manager release version feed.</subtitle>
|
||||
<link href="http://servermanagers.freeforums.net/" />
|
||||
<updated>2022-06-13T00:00:00Z</updated>
|
||||
<updated>2022-06-17T00:00:00Z</updated>
|
||||
|
||||
<entry>
|
||||
<id>urn:uuid:15FEC514-38B7-4367-BE79-1E00983E7EBB</id>
|
||||
<title>1.1.76 (1.1.76.1)</title>
|
||||
<summary>1.1.76.1</summary>
|
||||
<link href="" />
|
||||
<updated>2022-06-17T00:00:00Z</updated>
|
||||
<content type="xhtml">
|
||||
<div xmlns="http://www.w3.org/1999/xhtml" style="font-family: Arial, Verdana, Helvetica, Sans-Serif;font-size: .8em;">
|
||||
<p>
|
||||
<u style="font-size: .9em;">CHANGE</u>
|
||||
<br/>
|
||||
<ul>
|
||||
<li>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.</li>
|
||||
</ul>
|
||||
</p>
|
||||
</div>
|
||||
</content>
|
||||
<author>
|
||||
<name>bletch</name>
|
||||
<email>bletch1971@hotmail.com</email>
|
||||
</author>
|
||||
</entry>
|
||||
|
||||
<entry>
|
||||
<id>urn:uuid:4E189446-9861-4B64-9B27-0E3E655CD1CA</id>
|
||||
|
|
|
|||
|
|
@ -5,44 +5,21 @@
|
|||
<title>Conan Server Manager Version Feed</title>
|
||||
<subtitle>This is the Conan Server Manager beta version feed.</subtitle>
|
||||
<link href="http://servermanagers.freeforums.net/" />
|
||||
<updated>2022-06-16T00:00:00Z</updated>
|
||||
<updated>2022-06-17T00:00:00Z</updated>
|
||||
|
||||
<entry>
|
||||
<id>urn:uuid:4E189446-9861-4B64-9B27-0E3E655CD1CA</id>
|
||||
<title>1.1.75 (1.1.75.2)</title>
|
||||
<summary>1.1.75.2</summary>
|
||||
<id>urn:uuid:15FEC514-38B7-4367-BE79-1E00983E7EBB</id>
|
||||
<title>1.1.76 (1.1.76.1)</title>
|
||||
<summary>1.1.76.1</summary>
|
||||
<link href="" />
|
||||
<updated>2022-06-16T00:00:00Z</updated>
|
||||
<updated>2022-06-17T00:00:00Z</updated>
|
||||
<content type="xhtml">
|
||||
<div xmlns="http://www.w3.org/1999/xhtml" style="font-family: Arial, Verdana, Helvetica, Sans-Serif;font-size: .8em;">
|
||||
<p>
|
||||
<u style="font-size: .9em;">CHANGE</u>
|
||||
<br/>
|
||||
<ul>
|
||||
<li>Server Monitor - added shutdown reason.</li>
|
||||
</ul>
|
||||
</p>
|
||||
</div>
|
||||
</content>
|
||||
<author>
|
||||
<name>bletch</name>
|
||||
<email>bletch1971@hotmail.com</email>
|
||||
</author>
|
||||
</entry>
|
||||
|
||||
<entry>
|
||||
<id>urn:uuid:4E189446-9861-4B64-9B27-0E3E655CD1CA</id>
|
||||
<title>1.1.75 (1.1.75.1)</title>
|
||||
<summary>1.1.75.1</summary>
|
||||
<link href="" />
|
||||
<updated>2022-06-16T00:00:00Z</updated>
|
||||
<content type="xhtml">
|
||||
<div xmlns="http://www.w3.org/1999/xhtml" style="font-family: Arial, Verdana, Helvetica, Sans-Serif;font-size: .8em;">
|
||||
<p>
|
||||
<u style="font-size: .9em;">NEW</u>
|
||||
<br/>
|
||||
<ul>
|
||||
<li>Reset Server - added new button to reset your server. This will delete all server files and reset your server back to new.</li>
|
||||
<li>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.</li>
|
||||
</ul>
|
||||
</p>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -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
|
|||
/// </summary>
|
||||
public partial class GameDataWindow : Window
|
||||
{
|
||||
public class GameDataFileList : SortableObservableCollection<GameDataFile>
|
||||
{
|
||||
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)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -93,35 +93,32 @@
|
|||
<ColumnDefinition MinWidth="25"/>
|
||||
<ColumnDefinition MinWidth="25"/>
|
||||
<ColumnDefinition MinWidth="25"/>
|
||||
<ColumnDefinition MinWidth="25"/>
|
||||
<ColumnDefinition MinWidth="25"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<Button Grid.Row="0" Grid.Column="4" Margin="5,2,0,0" Grid.ColumnSpan="3" Click="Donate_Click" ToolTip="{DynamicResource MainWindow_DonateTooltip}" Style="{StaticResource ButtonStyle3}">
|
||||
<Button Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="4" Margin="5,2,0,0" HorizontalAlignment="Right" Click="Donate_Click" ToolTip="{DynamicResource MainWindow_DonateTooltip}" Style="{StaticResource ButtonStyle3}">
|
||||
<Image Source="../Art/Donate.png"/>
|
||||
</Button>
|
||||
|
||||
<Button Grid.Row="2" Grid.Column="0" Margin="5,0,0,0" Click="ServerMonitor_Click" ToolTip="{DynamicResource MainWindow_OpenServerMonitorTooltip}" Style="{StaticResource ButtonStyle1}">
|
||||
<Image Source="{com:Icon Path=/ConanServerManager;component/Art/Servers.ico,Size=32}"/>
|
||||
<Button Grid.Row="0" Grid.Column="4" Margin="5,0,0,0" Click="Help_Click" ToolTip="{DynamicResource MainWindow_OpenHelpTooltip}" Style="{StaticResource ButtonStyle1}">
|
||||
<Image Source="{com:Icon Path=/ConanServerManager;component/Art/Help.ico,Size=32}"/>
|
||||
</Button>
|
||||
<Button Grid.Row="2" Grid.Column="1" Margin="5,0,0,0" HorizontalAlignment="Right" Click="GameData_Click" ToolTip="{DynamicResource MainWindow_OpenGameDataTooltip}" Style="{StaticResource ButtonStyle1}">
|
||||
|
||||
<Button Grid.Row="1" Grid.Column="0" Grid.ColumnSpan="5" Margin="5,0,0,0" Height="26" HorizontalAlignment="Right" Click="ServerMonitor_Click" Content="{StaticResource ServerMonitorButtonContent}" ToolTip="{DynamicResource MainWindow_OpenServerMonitorTooltip}"/>
|
||||
|
||||
<Button Grid.Row="2" Grid.Column="0" Margin="5,0,0,0" HorizontalAlignment="Right" Click="GameData_Click" ToolTip="{DynamicResource MainWindow_OpenGameDataTooltip}" Style="{StaticResource ButtonStyle1}">
|
||||
<Image Source="{com:Icon Path=/ConanServerManager;component/Art/Document.ico,Size=32}"/>
|
||||
</Button>
|
||||
<Button Grid.Row="2" Grid.Column="2" Margin="5,0,0,0" Click="Plugins_Click" ToolTip="{DynamicResource MainWindow_OpenPluginsTooltip}" Style="{StaticResource ButtonStyle1}">
|
||||
<Button Grid.Row="2" Grid.Column="1" Margin="5,0,0,0" Click="Plugins_Click" ToolTip="{DynamicResource MainWindow_OpenPluginsTooltip}" Style="{StaticResource ButtonStyle1}">
|
||||
<Image Source="{com:Icon Path=/ConanServerManager;component/Art/Plugin.ico,Size=32}"/>
|
||||
</Button>
|
||||
<Button Grid.Row="2" Grid.Column="3" Margin="5,0,0,0" Click="OpenLogFolder_Click" ToolTip="{DynamicResource MainWindow_OpenLogFolderTooltip}" Style="{StaticResource ButtonStyle1}">
|
||||
<Button Grid.Row="2" Grid.Column="2" Margin="5,0,0,0" Click="OpenLogFolder_Click" ToolTip="{DynamicResource MainWindow_OpenLogFolderTooltip}" Style="{StaticResource ButtonStyle1}">
|
||||
<Image Source="{com:Icon Path=/ConanServerManager;component/Art/Logs.ico,Size=32}"/>
|
||||
</Button>
|
||||
<Button Grid.Row="2" Grid.Column="4" Margin="5,0,0,0" Click="SteamCMD_Click" ToolTip="{DynamicResource MainWindow_SteamCMDTooltip}" Style="{StaticResource ButtonStyle1}">
|
||||
<Button Grid.Row="2" Grid.Column="3" Margin="5,0,0,0" Click="SteamCMD_Click" ToolTip="{DynamicResource MainWindow_SteamCMDTooltip}" Style="{StaticResource ButtonStyle1}">
|
||||
<Image Source="{com:Icon Path=/ConanServerManager;component/Art/Steam.ico,Size=32}"/>
|
||||
</Button>
|
||||
<Button Grid.Row="2" Grid.Column="5" Margin="5,0,0,0" Click="Settings_Click" ToolTip="{DynamicResource MainWindow_OpenSettingsTooltip}" Style="{StaticResource ButtonStyle1}">
|
||||
<Button Grid.Row="2" Grid.Column="4" Margin="5,0,0,0" Click="Settings_Click" ToolTip="{DynamicResource MainWindow_OpenSettingsTooltip}" Style="{StaticResource ButtonStyle1}">
|
||||
<Image Source="{com:Icon Path=/ConanServerManager;component/Art/Settings.ico,Size=32}"/>
|
||||
</Button>
|
||||
<Button Grid.Row="2" Grid.Column="6" Margin="5,0,0,0" Click="Help_Click" ToolTip="{DynamicResource MainWindow_OpenHelpTooltip}" Style="{StaticResource ButtonStyle1}">
|
||||
<Image Source="{com:Icon Path=/ConanServerManager;component/Art/Help.ico,Size=32}"/>
|
||||
</Button>
|
||||
</Grid>
|
||||
|
||||
<Grid DockPanel.Dock="Right" VerticalAlignment="Top" Margin="10,0,10,0">
|
||||
|
|
@ -351,11 +348,11 @@
|
|||
</Grid>
|
||||
</DockPanel>
|
||||
|
||||
<eo:TabControl Name="Tabs" Grid.Row ="1" Margin="0,5,0,0" ShowCloseTabButton="True" ShowNewTabButton="True" NewItemRequested="Servers_AddNew" PreviewItemClose="Servers_Remove" ItemsSource="{Binding ServerManager.Servers}">
|
||||
<eo:TabControl Name="Tabs" Grid.Row="1" Margin="0" ShowCloseTabButton="True" ShowNewTabButton="True" NewItemRequested="Servers_AddNew" PreviewItemClose="Servers_Remove" ItemsSource="{Binding ServerManager.Servers}">
|
||||
<eo:TabControl.HeaderTemplate>
|
||||
<DataTemplate >
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<Button Grid.Row="0" Grid.Column="4" Margin="5,0,0,0" Command="{Binding StatusButtonCommand, ElementName=Main}" CommandParameter="{Binding}">
|
||||
<StackPanel Orientation="Horizontal" Height="20">
|
||||
<Button Margin="0" Command="{Binding StatusButtonCommand, ElementName=Main}" CommandParameter="{Binding}">
|
||||
<Button.Style>
|
||||
<Style BasedOn="{StaticResource ButtonStyle5}" TargetType="{x:Type Button}">
|
||||
<Style.Triggers>
|
||||
|
|
@ -416,7 +413,7 @@
|
|||
</Style.Triggers>
|
||||
</Style>
|
||||
</Button.Style>
|
||||
<Image Margin="0,2" VerticalAlignment="Center" Width="16" Height="16">
|
||||
<Image Margin="0" VerticalAlignment="Center" Width="16" Height="16">
|
||||
<Image.Style>
|
||||
<Style TargetType="{x:Type Image}">
|
||||
<Style.Triggers>
|
||||
|
|
@ -457,7 +454,7 @@
|
|||
</Image.Style>
|
||||
</Image>
|
||||
</Button>
|
||||
<TextBlock Margin="2" VerticalAlignment="Center" Text="{Binding Profile.ProfileName}" ToolTip="{Binding Profile.ProfileToolTip}"/>
|
||||
<TextBlock Margin="0" VerticalAlignment="Center" Text="{Binding Profile.ProfileName}"/>
|
||||
</StackPanel>
|
||||
</DataTemplate>
|
||||
</eo:TabControl.HeaderTemplate>
|
||||
|
|
@ -489,7 +486,7 @@
|
|||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate>
|
||||
<Image Margin="0,2" VerticalAlignment="Center" Source="{com:Icon Path=/ConanServerManager;component/Art/Delete.ico,Size=32}" Width="16" Height="16" ToolTip="{DynamicResource MainWindow_CloseProfileTooltip}"/>
|
||||
<Image Margin="2" VerticalAlignment="Center" Source="{com:Icon Path=/ConanServerManager;component/Art/Delete.ico,Size=32}" Width="10" Height="10" ToolTip="{DynamicResource MainWindow_CloseProfileTooltip}"/>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -13,24 +13,14 @@ namespace ServerManagerTool
|
|||
/// </summary>
|
||||
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())
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue