mirror of
https://github.com/tribufu/ServerManagers
synced 2026-05-06 15:17:34 +00:00
130 lines
11 KiB
XML
130 lines
11 KiB
XML
<Window x:Class="ServerManagerTool.PlayerListWindow"
|
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
|
xmlns:cc="clr-namespace:ServerManagerTool.Common.Converters;assembly=ServerManager.Common"
|
|
xmlns:clib="clr-namespace:ServerManagerTool.Common.Lib;assembly=ServerManager.Common"
|
|
xmlns:com="clr-namespace:ServerManagerTool.Common;assembly=ServerManager.Common"
|
|
xmlns:en="clr-namespace:ServerManagerTool.Enums"
|
|
xmlns:rcon="clr-namespace:ServerManagerTool.Lib.ViewModel.RCON"
|
|
MinWidth="300" MinHeight="200" Width="300" Height="500" ResizeMode="CanResizeWithGrip" WindowStyle="ToolWindow"
|
|
SizeChanged="Window_SizeChanged" LocationChanged="Window_LocationChanged"
|
|
Icon="../Art/favicon.ico" Title="{Binding PlayerListParameters.WindowTitle}"
|
|
FocusManager.FocusedElement="{Binding ElementName=PlayerListFilterStringTextBox}"
|
|
Name="PlayerList">
|
|
<Window.Resources>
|
|
<ResourceDictionary>
|
|
<ResourceDictionary.MergedDictionaries>
|
|
<ResourceDictionary Source="..\Globalization\en-US\en-US.xaml"/>
|
|
<ResourceDictionary Source="..\Styles\Default.xaml"/>
|
|
</ResourceDictionary.MergedDictionaries>
|
|
</ResourceDictionary>
|
|
</Window.Resources>
|
|
|
|
<Grid Background="{StaticResource GradientBackground}">
|
|
<DockPanel x:Name="dockPanel">
|
|
<Border DockPanel.Dock="Top" BorderThickness="1" BorderBrush="LightGray" Margin="2" Background="{StaticResource HeaderBrush}">
|
|
<DockPanel Margin="2,2,2,1" LastChildFill="False">
|
|
<StackPanel Orientation="Horizontal" DockPanel.Dock="Left">
|
|
<Menu VerticalAlignment="Center" Margin="1" Background="{StaticResource HeaderBrush}">
|
|
<MenuItem Header="{DynamicResource PlayerList_Menu_Players}">
|
|
<MenuItem Header="{DynamicResource PlayerList_Menu_Sort}">
|
|
<MenuItem Header="{DynamicResource PlayerList_Menu_SortName}" IsCheckable="True" Command="{Binding SortPlayersCommand}" CommandParameter="{x:Static en:PlayerSortType.Name}" IsChecked="{Binding PlayerSorting, Converter={StaticResource EnumConverter}, ConverterParameter=Name}"/>
|
|
<MenuItem Header="{DynamicResource PlayerList_Menu_SortTribe}" IsCheckable="True" Command="{Binding SortPlayersCommand}" CommandParameter="{x:Static en:PlayerSortType.Tribe}" IsChecked="{Binding PlayerSorting, Converter={StaticResource EnumConverter}, ConverterParameter=Tribe}"/>
|
|
<MenuItem Header="{DynamicResource PlayerList_Menu_SortLastUpdated}" IsCheckable="True" Command="{Binding SortPlayersCommand}" CommandParameter="{x:Static en:PlayerSortType.LastUpdated}" IsChecked="{Binding PlayerSorting, Converter={StaticResource EnumConverter}, ConverterParameter=LastUpdated}"/>
|
|
</MenuItem>
|
|
<MenuItem Header="{DynamicResource PlayerList_Menu_Filter}">
|
|
<MenuItem Header="{DynamicResource PlayerList_Menu_FilterOffline}" IsCheckable="True" Command="{Binding FilterPlayersCommand}" CommandParameter="{x:Static en:PlayerFilterType.Offline}" IsChecked="{Binding PlayerFiltering, Converter={StaticResource EnumFlagsConverter}, ConverterParameter=Offline, Mode=OneWay}"/>
|
|
<MenuItem Header="{DynamicResource PlayerList_Menu_FilterAdmin}" IsCheckable="True" Command="{Binding FilterPlayersCommand}" CommandParameter="{x:Static en:PlayerFilterType.Admin}" IsChecked="{Binding PlayerFiltering, Converter={StaticResource EnumFlagsConverter}, ConverterParameter=Admin, Mode=OneWay}"/>
|
|
<MenuItem Header="{DynamicResource PlayerList_Menu_FilterWhitelisted}" IsCheckable="True" Command="{Binding FilterPlayersCommand}" CommandParameter="{x:Static en:PlayerFilterType.Whitelisted}" IsChecked="{Binding PlayerFiltering, Converter={StaticResource EnumFlagsConverter}, ConverterParameter=Whitelisted, Mode=OneWay}"/>
|
|
<MenuItem Header="{DynamicResource PlayerList_Menu_FilterInvalid}" IsCheckable="True" Command="{Binding FilterPlayersCommand}" CommandParameter="{x:Static en:PlayerFilterType.Invalid}" IsChecked="{Binding PlayerFiltering, Converter={StaticResource EnumFlagsConverter}, ConverterParameter=Invalid, Mode=OneWay}"/>
|
|
</MenuItem>
|
|
</MenuItem>
|
|
</Menu>
|
|
</StackPanel>
|
|
</DockPanel>
|
|
</Border>
|
|
|
|
<DockPanel DockPanel.Dock="Right" MinWidth="200" Margin="1,1,2,1" DataContext="{Binding}">
|
|
<DockPanel DockPanel.Dock="Top">
|
|
<Label DockPanel.Dock="Left" Content="{DynamicResource General_FilterLabel}" HorizontalAlignment="Center" VerticalAlignment="Center" />
|
|
<Button DockPanel.Dock="Right" Margin="5,0,5,0" Width="22" Height="22" HorizontalAlignment="Right" VerticalAlignment="Center" Click="FilterPlayerList_Click" ToolTip="{DynamicResource General_FilterButtonTooltip}">
|
|
<Image Source="{com:Icon Path=/Ark Server Manager;component/Art/Filter.ico,Size=32}"/>
|
|
</Button>
|
|
<TextBox x:Name="PlayerListFilterStringTextBox" DockPanel.Dock="Left" Text="{Binding PlayerListFilterString, Mode=TwoWay}" BorderBrush="LightGray" VerticalAlignment="Center" VerticalContentAlignment="Center" IsTabStop="True" Margin="0" Padding="2"/>
|
|
</DockPanel>
|
|
|
|
<StackPanel DockPanel.Dock="Top" Orientation="Horizontal">
|
|
<Label Content="{DynamicResource PlayerList_ProfileCountLabel}" HorizontalAlignment="Center"/>
|
|
<Label Content="{Binding ServerPlayers.Players.Count, FallbackValue=0}" HorizontalAlignment="Center"/>
|
|
<Label Content="{DynamicResource PlayerList_ProfileInvalidCountLabel}" HorizontalAlignment="Center">
|
|
<Label.Style>
|
|
<Style BasedOn="{StaticResource {x:Type Label}}" TargetType="{x:Type Label}">
|
|
<Setter Property="Foreground" Value="Black"/>
|
|
<Style.Triggers>
|
|
<DataTrigger Binding="{Binding ServerPlayers.CountInvalidPlayers, FallbackValue=0, Converter={cc:GreaterThanIntValueConverter 0}}" Value="true">
|
|
<Setter Property="Foreground" Value="Red"/>
|
|
</DataTrigger>
|
|
</Style.Triggers>
|
|
</Style>
|
|
</Label.Style>
|
|
</Label>
|
|
<Label Content="{Binding ServerPlayers.CountInvalidPlayers, FallbackValue=0}" HorizontalAlignment="Center">
|
|
<Label.Style>
|
|
<Style BasedOn="{StaticResource {x:Type Label}}" TargetType="{x:Type Label}">
|
|
<Setter Property="Foreground" Value="Black"/>
|
|
<Style.Triggers>
|
|
<DataTrigger Binding="{Binding ServerPlayers.CountInvalidPlayers, FallbackValue=0, Converter={cc:GreaterThanIntValueConverter 0}}" Value="true">
|
|
<Setter Property="Foreground" Value="Red"/>
|
|
</DataTrigger>
|
|
</Style.Triggers>
|
|
</Style>
|
|
</Label.Style>
|
|
</Label>
|
|
</StackPanel>
|
|
|
|
<ListBox DockPanel.Dock="Top" ItemsSource="{Binding ServerPlayers.Players}" BorderBrush="LightGray" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch" Padding="-3,0,-3,0">
|
|
<ListBox.Resources>
|
|
<clib:BindingProxy x:Key="proxy" Data="{Binding ElementName=PlayerList}"/>
|
|
</ListBox.Resources>
|
|
|
|
<ListBox.ItemContainerStyle>
|
|
<Style TargetType="ListBoxItem">
|
|
<Setter Property="ContextMenu">
|
|
<Setter.Value>
|
|
<ContextMenu>
|
|
<MenuItem Header="{DynamicResource PlayerList_Menu_ViewProfile}" Command="{Binding Source={StaticResource proxy}, Path=Data.ViewPlayerProfileCommand}" CommandParameter="{Binding}" />
|
|
<MenuItem Header="{DynamicResource PlayerList_Menu_ViewTribe}" Command="{Binding Source={StaticResource proxy}, Path=Data.ViewPlayerTribeCommand}" CommandParameter="{Binding}"/>
|
|
<Separator/>
|
|
<MenuItem Header="{DynamicResource PlayerList_Menu_CopyId}" Command="{Binding Source={StaticResource proxy}, Path=Data.CopyIDCommand}" CommandParameter="{Binding}"/>
|
|
<MenuItem Header="{DynamicResource PlayerList_Menu_CopyPlayerId}" Command="{Binding Source={StaticResource proxy}, Path=Data.CopyPlayerIDCommand}" CommandParameter="{Binding}"/>
|
|
</ContextMenu>
|
|
</Setter.Value>
|
|
</Setter>
|
|
</Style>
|
|
</ListBox.ItemContainerStyle>
|
|
|
|
<ListBox.ItemTemplate>
|
|
<DataTemplate DataType="{x:Type rcon:PlayerInfo}">
|
|
<Border BorderThickness="2" Padding="1" Style="{DynamicResource PlayerStatus}">
|
|
<Grid>
|
|
<Grid.ColumnDefinitions>
|
|
<ColumnDefinition Width="*"/>
|
|
</Grid.ColumnDefinitions>
|
|
|
|
<StackPanel Grid.Column="0" Margin="5,0,5,0" HorizontalAlignment="Stretch">
|
|
<Label Padding="0,-1,0,-1" Style="{DynamicResource PlayerName}"/>
|
|
<StackPanel Orientation="Horizontal" >
|
|
<Label Content="{Binding CharacterName}" Padding="0,-1,0,-1"/>
|
|
<TextBlock Text="{Binding PlayerData.Level, StringFormat=({0})}" Margin="5,0,0,0" />
|
|
</StackPanel>
|
|
<Label Padding="0,-1,0,-1" Style="{DynamicResource TribeName}"/>
|
|
</StackPanel>
|
|
</Grid>
|
|
</Border>
|
|
</DataTemplate>
|
|
</ListBox.ItemTemplate>
|
|
</ListBox>
|
|
</DockPanel>
|
|
</DockPanel>
|
|
</Grid>
|
|
</Window>
|