mirror of
https://github.com/tribufu/ServerManagers
synced 2026-05-06 15:17:34 +00:00
Grid Changes
- added good, warning and bad icons to the map spawner and prevent transfer grids.
This commit is contained in:
parent
9df02ec05e
commit
ca9c053f08
8 changed files with 172 additions and 17 deletions
|
|
@ -5212,7 +5212,7 @@
|
|||
</StackPanel>
|
||||
</GroupBox.Header>
|
||||
|
||||
<DataGrid Name="NPCSpawnSettingsGrid" ItemsSource="{Binding NPCSpawnSettings}" SelectedItem="{Binding Path=SelectedNPCSpawnSetting, ElementName=SettingsControl, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged, NotifyOnSourceUpdated=True}" AutoGenerateColumns="False" CanUserAddRows="False" CanUserDeleteRows="False" CanUserReorderColumns="False" CanUserSortColumns="true" SelectionMode="Single" CanUserResizeColumns="False" CanUserResizeRows="False" RowHeaderWidth="25">
|
||||
<DataGrid Name="NPCSpawnSettingsGrid" ItemsSource="{Binding NPCSpawnSettings}" SelectedItem="{Binding Path=SelectedNPCSpawnSetting, ElementName=SettingsControl, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged, NotifyOnSourceUpdated=True}" AutoGenerateColumns="False" CanUserAddRows="False" CanUserDeleteRows="False" CanUserReorderColumns="False" CanUserSortColumns="true" SelectionMode="Single" CanUserResizeColumns="False" CanUserResizeRows="False" RowHeaderWidth="25" SourceUpdated="NPCSpawnSettingsGrids_SourceUpdated">
|
||||
<DataGrid.Resources>
|
||||
<Style TargetType="{x:Type DataGridRow}">
|
||||
<Style.Resources>
|
||||
|
|
@ -5229,6 +5229,28 @@
|
|||
<SolidColorBrush Color="#FFB4B4B4"/>
|
||||
</DataGrid.VerticalGridLinesBrush>
|
||||
|
||||
<DataGrid.RowHeaderTemplate>
|
||||
<DataTemplate>
|
||||
<Image HorizontalAlignment="Center" VerticalAlignment="Center" Width="16" Height="16">
|
||||
<Image.Style>
|
||||
<Style TargetType="{x:Type Image}">
|
||||
<Style.Triggers>
|
||||
<DataTrigger Binding="{Binding DataContext.ValidStatus, RelativeSource={RelativeSource AncestorType=DataGridRow}}" Value="Y">
|
||||
<Setter Property="Source" Value="{com:Icon Path=/Ark Server Manager;component/Art/StatusGood.ico,Size=32}"/>
|
||||
</DataTrigger>
|
||||
<DataTrigger Binding="{Binding DataContext.ValidStatus, RelativeSource={RelativeSource AncestorType=DataGridRow}}" Value="N">
|
||||
<Setter Property="Source" Value="{com:Icon Path=/Ark Server Manager;component/Art/StatusBad.ico,Size=32}"/>
|
||||
</DataTrigger>
|
||||
<DataTrigger Binding="{Binding DataContext.ValidStatus, RelativeSource={RelativeSource AncestorType=DataGridRow}}" Value="W">
|
||||
<Setter Property="Source" Value="{com:Icon Path=/Ark Server Manager;component/Art/StatusWarning.ico,Size=32}"/>
|
||||
</DataTrigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
</Image.Style>
|
||||
</Image>
|
||||
</DataTemplate>
|
||||
</DataGrid.RowHeaderTemplate>
|
||||
|
||||
<DataGrid.Columns>
|
||||
<DataGridTemplateColumn Width="1*" CanUserSort="True">
|
||||
<DataGridTemplateColumn.Header>
|
||||
|
|
@ -5236,7 +5258,7 @@
|
|||
</DataGridTemplateColumn.Header>
|
||||
<DataGridTemplateColumn.CellTemplate>
|
||||
<DataTemplate>
|
||||
<ComboBox IsReadOnly="True" IsEditable="True" ItemsSource="{Binding Source={StaticResource NPCSpawnContainerTypes}}" Text="{Binding ContainerType, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" PreviewMouseWheel="ComboBox_PreviewMouseWheel"/>
|
||||
<ComboBox IsReadOnly="True" IsEditable="True" ItemsSource="{Binding Source={StaticResource NPCSpawnContainerTypes}}" Text="{Binding ContainerType, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged, NotifyOnSourceUpdated=True}" PreviewMouseWheel="ComboBox_PreviewMouseWheel"/>
|
||||
</DataTemplate>
|
||||
</DataGridTemplateColumn.CellTemplate>
|
||||
</DataGridTemplateColumn>
|
||||
|
|
@ -5246,7 +5268,7 @@
|
|||
</DataGridTemplateColumn.Header>
|
||||
<DataGridTemplateColumn.CellTemplate>
|
||||
<DataTemplate>
|
||||
<ComboBox IsEditable="True" ItemsSource="{Binding BaseMapSpawnerList, ElementName=SettingsControl}" SelectedValue="{Binding NPCSpawnEntriesContainerClassString, Mode=TwoWay, UpdateSourceTrigger=Explicit}" SelectedValuePath="ValueMember" DisplayMemberPath="DisplayMember" LostFocus="ComboBoxItemList_LostFocus" PreviewMouseWheel="ComboBox_PreviewMouseWheel"/>
|
||||
<ComboBox IsEditable="True" ItemsSource="{Binding BaseMapSpawnerList, ElementName=SettingsControl}" SelectedValue="{Binding NPCSpawnEntriesContainerClassString, Mode=TwoWay, UpdateSourceTrigger=Explicit, NotifyOnSourceUpdated=True}" SelectedValuePath="ValueMember" DisplayMemberPath="DisplayMember" LostFocus="ComboBoxItemList_LostFocus" PreviewMouseWheel="ComboBox_PreviewMouseWheel"/>
|
||||
</DataTemplate>
|
||||
</DataGridTemplateColumn.CellTemplate>
|
||||
</DataGridTemplateColumn>
|
||||
|
|
@ -5287,7 +5309,7 @@
|
|||
</StackPanel>
|
||||
</GroupBox.Header>
|
||||
|
||||
<DataGrid Name="NPCSpawnEntrySettingsGrid" ItemsSource="{Binding Path=SelectedNPCSpawnSetting.NPCSpawnEntrySettings, ElementName=SettingsControl}" AutoGenerateColumns="False" CanUserAddRows="False" CanUserDeleteRows="False" CanUserReorderColumns="False" CanUserSortColumns="true" SelectionMode="Single" CanUserResizeColumns="False" CanUserResizeRows="False" RowHeaderWidth="25">
|
||||
<DataGrid Name="NPCSpawnEntrySettingsGrid" ItemsSource="{Binding Path=SelectedNPCSpawnSetting.NPCSpawnEntrySettings, ElementName=SettingsControl}" AutoGenerateColumns="False" CanUserAddRows="False" CanUserDeleteRows="False" CanUserReorderColumns="False" CanUserSortColumns="true" SelectionMode="Single" CanUserResizeColumns="False" CanUserResizeRows="False" RowHeaderWidth="25" SourceUpdated="NPCSpawnSettingsGrids_SourceUpdated">
|
||||
<DataGrid.Resources>
|
||||
<clib:BindingProxy x:Key="proxySelectedNPCSpawnSetting" Data="{Binding Path=SelectedNPCSpawnSetting, ElementName=SettingsControl}" />
|
||||
<Style TargetType="{x:Type DataGridRow}">
|
||||
|
|
@ -5305,6 +5327,28 @@
|
|||
<SolidColorBrush Color="#FFB4B4B4"/>
|
||||
</DataGrid.VerticalGridLinesBrush>
|
||||
|
||||
<DataGrid.RowHeaderTemplate>
|
||||
<DataTemplate>
|
||||
<Image HorizontalAlignment="Center" VerticalAlignment="Center" Width="16" Height="16">
|
||||
<Image.Style>
|
||||
<Style TargetType="{x:Type Image}">
|
||||
<Style.Triggers>
|
||||
<DataTrigger Binding="{Binding DataContext.ValidStatus, RelativeSource={RelativeSource AncestorType=DataGridRow}}" Value="Y">
|
||||
<Setter Property="Source" Value="{com:Icon Path=/Ark Server Manager;component/Art/StatusGood.ico,Size=32}"/>
|
||||
</DataTrigger>
|
||||
<DataTrigger Binding="{Binding DataContext.ValidStatus, RelativeSource={RelativeSource AncestorType=DataGridRow}}" Value="N">
|
||||
<Setter Property="Source" Value="{com:Icon Path=/Ark Server Manager;component/Art/StatusBad.ico,Size=32}"/>
|
||||
</DataTrigger>
|
||||
<DataTrigger Binding="{Binding DataContext.ValidStatus, RelativeSource={RelativeSource AncestorType=DataGridRow}}" Value="W">
|
||||
<Setter Property="Source" Value="{com:Icon Path=/Ark Server Manager;component/Art/StatusWarning.ico,Size=32}"/>
|
||||
</DataTrigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
</Image.Style>
|
||||
</Image>
|
||||
</DataTemplate>
|
||||
</DataGrid.RowHeaderTemplate>
|
||||
|
||||
<DataGrid.Columns>
|
||||
<DataGridTextColumn Width="1*" Binding="{Binding AnEntryName}" Visibility="{Binding Data.ShowEntryNameColumn, Converter={StaticResource BooleanToVisibilityConverter}, Source={StaticResource proxySelectedNPCSpawnSetting}}">
|
||||
<DataGridTextColumn.Header>
|
||||
|
|
@ -5318,7 +5362,7 @@
|
|||
</DataGridTemplateColumn.Header>
|
||||
<DataGridTemplateColumn.CellTemplate>
|
||||
<DataTemplate>
|
||||
<ComboBox IsEditable="True" ItemsSource="{Binding BaseDinoList, ElementName=SettingsControl}" SelectedValue="{Binding NPCClassString, Mode=TwoWay, UpdateSourceTrigger=Explicit}" SelectedValuePath="ValueMember" DisplayMemberPath="DisplayMember" LostFocus="ComboBoxItemList_LostFocus" PreviewMouseWheel="ComboBox_PreviewMouseWheel"/>
|
||||
<ComboBox IsEditable="True" ItemsSource="{Binding BaseDinoList, ElementName=SettingsControl}" SelectedValue="{Binding NPCClassString, Mode=TwoWay, UpdateSourceTrigger=Explicit, NotifyOnSourceUpdated=True}" SelectedValuePath="ValueMember" DisplayMemberPath="DisplayMember" LostFocus="ComboBoxItemList_LostFocus" PreviewMouseWheel="ComboBox_PreviewMouseWheel"/>
|
||||
</DataTemplate>
|
||||
</DataGridTemplateColumn.CellTemplate>
|
||||
</DataGridTemplateColumn>
|
||||
|
|
@ -5947,7 +5991,7 @@
|
|||
</StackPanel>
|
||||
</GroupBox.Header>
|
||||
|
||||
<DataGrid Name="PreventTransferOverrideGrid" ItemsSource="{Binding PreventTransferForClassNames}" AutoGenerateColumns="False" CanUserAddRows="False" CanUserDeleteRows="False" CanUserReorderColumns="False" CanUserSortColumns="true" SelectionMode="Single" CanUserResizeRows="False" RowHeaderWidth="25">
|
||||
<DataGrid Name="PreventTransferOverrideGrid" ItemsSource="{Binding PreventTransferForClassNames}" AutoGenerateColumns="False" CanUserAddRows="False" CanUserDeleteRows="False" CanUserReorderColumns="False" CanUserSortColumns="true" SelectionMode="Single" CanUserResizeRows="False" RowHeaderWidth="25" SourceUpdated="PreventTransferOverrideGrids_SourceUpdated">
|
||||
<DataGrid.Resources>
|
||||
<Style TargetType="{x:Type DataGridRow}">
|
||||
<Style.Resources>
|
||||
|
|
@ -5964,6 +6008,28 @@
|
|||
<SolidColorBrush Color="#FFB4B4B4"/>
|
||||
</DataGrid.VerticalGridLinesBrush>
|
||||
|
||||
<DataGrid.RowHeaderTemplate>
|
||||
<DataTemplate>
|
||||
<Image HorizontalAlignment="Center" VerticalAlignment="Center" Width="16" Height="16">
|
||||
<Image.Style>
|
||||
<Style TargetType="{x:Type Image}">
|
||||
<Style.Triggers>
|
||||
<DataTrigger Binding="{Binding DataContext.ValidStatus, RelativeSource={RelativeSource AncestorType=DataGridRow}}" Value="Y">
|
||||
<Setter Property="Source" Value="{com:Icon Path=/Ark Server Manager;component/Art/StatusGood.ico,Size=32}"/>
|
||||
</DataTrigger>
|
||||
<DataTrigger Binding="{Binding DataContext.ValidStatus, RelativeSource={RelativeSource AncestorType=DataGridRow}}" Value="N">
|
||||
<Setter Property="Source" Value="{com:Icon Path=/Ark Server Manager;component/Art/StatusBad.ico,Size=32}"/>
|
||||
</DataTrigger>
|
||||
<DataTrigger Binding="{Binding DataContext.ValidStatus, RelativeSource={RelativeSource AncestorType=DataGridRow}}" Value="W">
|
||||
<Setter Property="Source" Value="{com:Icon Path=/Ark Server Manager;component/Art/StatusWarning.ico,Size=32}"/>
|
||||
</DataTrigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
</Image.Style>
|
||||
</Image>
|
||||
</DataTemplate>
|
||||
</DataGrid.RowHeaderTemplate>
|
||||
|
||||
<DataGrid.Columns>
|
||||
<DataGridTemplateColumn Width="2*" CanUserSort="True" SortMemberPath="DisplayName">
|
||||
<DataGridTemplateColumn.Header>
|
||||
|
|
@ -5971,7 +6037,7 @@
|
|||
</DataGridTemplateColumn.Header>
|
||||
<DataGridTemplateColumn.CellTemplate>
|
||||
<DataTemplate>
|
||||
<ComboBox IsEditable="True" ItemsSource="{Binding BaseDinoList, ElementName=SettingsControl}" SelectedValue="{Binding DinoClassString, Mode=TwoWay, UpdateSourceTrigger=Explicit}" SelectedValuePath="ValueMember" DisplayMemberPath="DisplayMember" LostFocus="ComboBoxItemList_LostFocus" PreviewMouseWheel="ComboBox_PreviewMouseWheel"/>
|
||||
<ComboBox IsEditable="True" ItemsSource="{Binding BaseDinoList, ElementName=SettingsControl}" SelectedValue="{Binding DinoClassString, Mode=TwoWay, UpdateSourceTrigger=Explicit, NotifyOnSourceUpdated=True}" SelectedValuePath="ValueMember" DisplayMemberPath="DisplayMember" LostFocus="ComboBoxItemList_LostFocus" PreviewMouseWheel="ComboBox_PreviewMouseWheel"/>
|
||||
</DataTemplate>
|
||||
</DataGridTemplateColumn.CellTemplate>
|
||||
</DataGridTemplateColumn>
|
||||
|
|
|
|||
|
|
@ -1319,6 +1319,16 @@ namespace ServerManagerTool
|
|||
Settings.ConfigOverrideItemCraftingCosts.Update();
|
||||
}
|
||||
|
||||
private void PreventTransferOverrideGrids_SourceUpdated(object sender, DataTransferEventArgs e)
|
||||
{
|
||||
Settings.PreventTransferForClassNames.Update();
|
||||
}
|
||||
|
||||
private void NPCSpawnSettingsGrids_SourceUpdated(object sender, DataTransferEventArgs e)
|
||||
{
|
||||
Settings.NPCSpawnSettings.Update();
|
||||
}
|
||||
|
||||
#region Dinos
|
||||
private void DinoCustomization_Reset(object sender, RoutedEventArgs e)
|
||||
{
|
||||
|
|
@ -2895,6 +2905,7 @@ namespace ServerManagerTool
|
|||
private void AddNPCSpawn_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
Settings.NPCSpawnSettings.Add(new NPCSpawnSettings());
|
||||
Settings.NPCSpawnSettings.Update();
|
||||
}
|
||||
|
||||
private void AddNPCSpawnEntry_Click(object sender, RoutedEventArgs e)
|
||||
|
|
@ -2906,6 +2917,7 @@ namespace ServerManagerTool
|
|||
}
|
||||
|
||||
SelectedNPCSpawnSetting.NPCSpawnEntrySettings.Add(new NPCSpawnEntrySettings());
|
||||
Settings.NPCSpawnSettings.Update();
|
||||
}
|
||||
|
||||
private void ClearNPCSpawn_Click(object sender, RoutedEventArgs e)
|
||||
|
|
@ -2915,6 +2927,7 @@ namespace ServerManagerTool
|
|||
|
||||
SelectedNPCSpawnSetting = null;
|
||||
Settings.NPCSpawnSettings.Clear();
|
||||
Settings.NPCSpawnSettings.Update();
|
||||
}
|
||||
|
||||
private void ClearNPCSpawnEntry_Click(object sender, RoutedEventArgs e)
|
||||
|
|
@ -2923,6 +2936,7 @@ namespace ServerManagerTool
|
|||
return;
|
||||
|
||||
SelectedNPCSpawnSetting?.NPCSpawnEntrySettings.Clear();
|
||||
Settings.NPCSpawnSettings.Update();
|
||||
}
|
||||
|
||||
private void PasteNPCSpawn_Click(object sender, RoutedEventArgs e)
|
||||
|
|
@ -2973,6 +2987,7 @@ namespace ServerManagerTool
|
|||
|
||||
var item = ((NPCSpawnSettings)((Button)e.Source).DataContext);
|
||||
Settings.NPCSpawnSettings.Remove(item);
|
||||
Settings.NPCSpawnSettings.Update();
|
||||
}
|
||||
|
||||
private void RemoveNPCSpawnEntry_Click(object sender, RoutedEventArgs e)
|
||||
|
|
@ -2985,6 +3000,7 @@ namespace ServerManagerTool
|
|||
|
||||
var item = ((NPCSpawnEntrySettings)((Button)e.Source).DataContext);
|
||||
SelectedNPCSpawnSetting.NPCSpawnEntrySettings.Remove(item);
|
||||
Settings.NPCSpawnSettings.Update();
|
||||
}
|
||||
|
||||
private void SaveNPCSpawns_Click(object sender, RoutedEventArgs e)
|
||||
|
|
@ -3007,12 +3023,12 @@ namespace ServerManagerTool
|
|||
|
||||
private void SaveNPCSpawn_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
Settings.NPCSpawnSettings.RenderToModel();
|
||||
|
||||
var item = ((NPCSpawnSettings)((Button)e.Source).DataContext);
|
||||
if (item == null)
|
||||
return;
|
||||
|
||||
Settings.NPCSpawnSettings.RenderToModel();
|
||||
|
||||
string iniName = null;
|
||||
string iniValue = null;
|
||||
switch (item.ContainerType)
|
||||
|
|
@ -3362,7 +3378,7 @@ namespace ServerManagerTool
|
|||
private void AddPreventTransferOverride_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
Settings.PreventTransferForClassNames.Add(new PreventTransferOverride());
|
||||
Settings.PreventTransferForClassNames.IsEnabled = true;
|
||||
Settings.PreventTransferForClassNames.Update();
|
||||
}
|
||||
|
||||
private void ClearPreventTransferOverrides_Click(object sender, RoutedEventArgs e)
|
||||
|
|
@ -3371,7 +3387,7 @@ namespace ServerManagerTool
|
|||
return;
|
||||
|
||||
Settings.PreventTransferForClassNames.Clear();
|
||||
Settings.PreventTransferForClassNames.IsEnabled = false;
|
||||
Settings.PreventTransferForClassNames.Update();
|
||||
}
|
||||
|
||||
private void PastePreventTransferOverride_Click(object sender, RoutedEventArgs e)
|
||||
|
|
@ -3422,7 +3438,7 @@ namespace ServerManagerTool
|
|||
|
||||
var item = ((PreventTransferOverride)((Button)e.Source).DataContext);
|
||||
Settings.PreventTransferForClassNames.Remove(item);
|
||||
Settings.PreventTransferForClassNames.IsEnabled = Settings.PreventTransferForClassNames.Count > 0;
|
||||
Settings.PreventTransferForClassNames.Update();
|
||||
}
|
||||
|
||||
private void SavePreventTransferOverride_Click(object sender, RoutedEventArgs e)
|
||||
|
|
@ -3447,6 +3463,8 @@ namespace ServerManagerTool
|
|||
if (item == null)
|
||||
return;
|
||||
|
||||
Settings.PreventTransferForClassNames.RenderToModel();
|
||||
|
||||
var iniName = Settings.PreventTransferForClassNames.IniCollectionKey;
|
||||
var iniValue = $"{iniName}={item.ToINIValue()}";
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue