feat: add hero stats panel
This commit is contained in:
@@ -5,6 +5,7 @@
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:local="clr-namespace:Client"
|
||||
xmlns:scm="clr-namespace:System.ComponentModel;assembly=WindowsBase"
|
||||
xmlns:converters="clr-namespace:Client.Application.Converters"
|
||||
mc:Ignorable="d"
|
||||
Title="MainWindow" Height="600" Width="1024">
|
||||
<Window.Resources>
|
||||
@@ -18,6 +19,7 @@
|
||||
<scm:SortDescription PropertyName="Distance" Direction="Ascending" />
|
||||
</CollectionViewSource.SortDescriptions>
|
||||
</CollectionViewSource>
|
||||
<converters:PercentWidthConverter x:Key="PercentWidthConverter"/>
|
||||
</Window.Resources>
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
@@ -28,7 +30,7 @@
|
||||
<RowDefinition></RowDefinition>
|
||||
<RowDefinition Height="240"></RowDefinition>
|
||||
</Grid.RowDefinitions>
|
||||
<ListBox Grid.Row="1" Grid.Column="0" ItemsSource="{Binding ChatMessages, Mode=OneWay}">
|
||||
<ListBox x:Name="listBox" Grid.Row="1" Grid.Column="0" ItemsSource="{Binding ChatMessages, Mode=OneWay}">
|
||||
<ListBox.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<TextBlock Text="{Binding Path=Text, Mode=OneWay}" Foreground="{Binding Path=Color, Mode=OneWay}" />
|
||||
@@ -107,6 +109,84 @@
|
||||
</TextBlock.Text>
|
||||
</TextBlock>
|
||||
</StackPanel>
|
||||
<StackPanel x:Name="statsPanel">
|
||||
<Grid Height="15" Margin="0 0 0 2">
|
||||
<Image Stretch="Fill" Source="/Assets/icons/ps_cpbar_back.png"></Image>
|
||||
<Image Stretch="Fill" Source="/Assets/icons/ps_cpbar.png" HorizontalAlignment="Left">
|
||||
<Image.Width>
|
||||
<MultiBinding Converter="{StaticResource PercentWidthConverter}">
|
||||
<Binding Path="VitalStats.CpPercent"/>
|
||||
<Binding Path="ActualWidth" ElementName="statsPanel"/>
|
||||
</MultiBinding>
|
||||
</Image.Width>
|
||||
</Image>
|
||||
<TextBlock Foreground="White" HorizontalAlignment="Center" VerticalAlignment="Center">
|
||||
<TextBlock.Text>
|
||||
<MultiBinding StringFormat="{}{0}/{1}">
|
||||
<Binding Path="VitalStats.Cp"/>
|
||||
<Binding Path="VitalStats.MaxCp"/>
|
||||
</MultiBinding>
|
||||
</TextBlock.Text>
|
||||
</TextBlock>
|
||||
</Grid>
|
||||
<Grid Height="15" Margin="0 0 0 2">
|
||||
<Image Stretch="Fill" Source="/Assets/icons/ps_hpbar_back.png"></Image>
|
||||
<Image Stretch="Fill" Source="/Assets/icons/ps_hpbar.png" HorizontalAlignment="Left">
|
||||
<Image.Width>
|
||||
<MultiBinding Converter="{StaticResource PercentWidthConverter}">
|
||||
<Binding Path="VitalStats.HpPercent"/>
|
||||
<Binding Path="ActualWidth" ElementName="statsPanel"/>
|
||||
</MultiBinding>
|
||||
</Image.Width>
|
||||
</Image>
|
||||
<TextBlock Foreground="White" HorizontalAlignment="Center" VerticalAlignment="Center">
|
||||
<TextBlock.Text>
|
||||
<MultiBinding StringFormat="{}{0}/{1}">
|
||||
<Binding Path="VitalStats.Hp"/>
|
||||
<Binding Path="VitalStats.MaxHp"/>
|
||||
</MultiBinding>
|
||||
</TextBlock.Text>
|
||||
</TextBlock>
|
||||
</Grid>
|
||||
<Grid Height="15" Margin="0 0 0 2">
|
||||
<Image Stretch="Fill" Source="/Assets/icons/ps_mpbar_back.png"></Image>
|
||||
<Image Stretch="Fill" Source="/Assets/icons/ps_mpbar.png" HorizontalAlignment="Left">
|
||||
<Image.Width>
|
||||
<MultiBinding Converter="{StaticResource PercentWidthConverter}">
|
||||
<Binding Path="VitalStats.MpPercent"/>
|
||||
<Binding Path="ActualWidth" ElementName="statsPanel"/>
|
||||
</MultiBinding>
|
||||
</Image.Width>
|
||||
</Image>
|
||||
<TextBlock Foreground="White" HorizontalAlignment="Center" VerticalAlignment="Center">
|
||||
<TextBlock.Text>
|
||||
<MultiBinding StringFormat="{}{0}/{1}">
|
||||
<Binding Path="VitalStats.Mp"/>
|
||||
<Binding Path="VitalStats.MaxMp"/>
|
||||
</MultiBinding>
|
||||
</TextBlock.Text>
|
||||
</TextBlock>
|
||||
</Grid>
|
||||
<Grid Height="15">
|
||||
<Grid.ColumnDefinitions></Grid.ColumnDefinitions>
|
||||
<Image Stretch="Fill" Source="/Assets/icons/ps_expbar_back.png"></Image>
|
||||
<Image Stretch="Fill" Source="/Assets/icons/ps_expbar.png" HorizontalAlignment="Left">
|
||||
<Image.Width>
|
||||
<MultiBinding Converter="{StaticResource PercentWidthConverter}">
|
||||
<Binding Path="Experience.ExpPercent"/>
|
||||
<Binding Path="ActualWidth" ElementName="statsPanel"/>
|
||||
</MultiBinding>
|
||||
</Image.Width>
|
||||
</Image>
|
||||
<TextBlock Foreground="White" HorizontalAlignment="Center" VerticalAlignment="Center">
|
||||
<TextBlock.Text>
|
||||
<MultiBinding StringFormat="{}{0:F2}%">
|
||||
<Binding Path="Experience.ExpPercent"/>
|
||||
</MultiBinding>
|
||||
</TextBlock.Text>
|
||||
</TextBlock>
|
||||
</Grid>
|
||||
</StackPanel>
|
||||
<DockPanel>
|
||||
<StackPanel DockPanel.Dock="Left" Margin="0 0 5 0">
|
||||
<TextBlock Padding="0 0 0 3">Position:</TextBlock>
|
||||
|
Reference in New Issue
Block a user