feat: show attackes in list and map
This commit is contained in:
parent
e3e0db29ad
commit
7f81380c89
@ -152,6 +152,10 @@
|
||||
<Setter TargetName="CreatureBody" Property="Stroke" Value="Black" />
|
||||
<Setter TargetName="CreatureDirection" Property="Stroke" Value="Black" />
|
||||
</DataTrigger>
|
||||
<DataTrigger Binding="{Binding IsAttacker,Mode=OneWay}" Value="True">
|
||||
<Setter TargetName="CreatureBody" Property="Stroke" Value="Red" />
|
||||
<Setter TargetName="CreatureDirection" Property="Stroke" Value="Red" />
|
||||
</DataTrigger>
|
||||
<DataTrigger Binding="{Binding IsTarget,Mode=OneWay}" Value="True">
|
||||
<Setter TargetName="CreatureName" Property="Visibility" Value="Visible" />
|
||||
</DataTrigger>
|
||||
|
@ -26,6 +26,8 @@ namespace Client.Application.ViewModels
|
||||
|
||||
public bool IsTarget => Id == hero.TargetId;
|
||||
|
||||
public bool IsAttacker => hero.AttackerIds.Contains(creature.Id);
|
||||
|
||||
public ICommand MouseLeftClickCommand { get; }
|
||||
public ICommand MouseLeftDoubleClickCommand { get; }
|
||||
public ICommand MouseRightClickCommand { get; }
|
||||
@ -90,6 +92,10 @@ namespace Client.Application.ViewModels
|
||||
{
|
||||
OnPropertyChanged("IsTarget");
|
||||
}
|
||||
if (e.PropertyName == "AttackerIds")
|
||||
{
|
||||
OnPropertyChanged("IsAttacker");
|
||||
}
|
||||
}
|
||||
|
||||
private readonly CreatureInterface creature;
|
||||
|
@ -63,6 +63,7 @@ namespace Client.Application.ViewModels
|
||||
public bool IsTarget => Id == hero.TargetId;
|
||||
public bool IsAggressive => creature.AggroRadius > 0 && !creature.VitalStats.IsDead && creature.IsHostile;
|
||||
public float AggroRadius => creature.AggroRadius / scale;
|
||||
public bool IsAttacker => hero.AttackerIds.Contains(creature.Id);
|
||||
|
||||
public ICommand MouseLeftClickCommand { get; }
|
||||
public ICommand MouseLeftDoubleClickCommand { get; }
|
||||
@ -117,6 +118,10 @@ namespace Client.Application.ViewModels
|
||||
{
|
||||
OnPropertyChanged("IsTarget");
|
||||
}
|
||||
if (e.PropertyName == "AttackerIds")
|
||||
{
|
||||
OnPropertyChanged("IsAttacker");
|
||||
}
|
||||
}
|
||||
|
||||
private void HeroPosition_PropertyChanged(object? sender, System.ComponentModel.PropertyChangedEventArgs e)
|
||||
|
@ -73,7 +73,10 @@
|
||||
</Grid>
|
||||
<DataTemplate.Triggers>
|
||||
<DataTrigger Binding="{Binding IsTarget,Mode=OneWay}" Value="True">
|
||||
<Setter TargetName="Item" Property="Background" Value="#110000ff" />
|
||||
<Setter TargetName="Item" Property="Background" Value="#330000ff" />
|
||||
</DataTrigger>
|
||||
<DataTrigger Binding="{Binding IsAttacker,Mode=OneWay}" Value="True">
|
||||
<Setter TargetName="Item" Property="Background" Value="#33ff0000" />
|
||||
</DataTrigger>
|
||||
</DataTemplate.Triggers>
|
||||
</DataTemplate>
|
||||
|
Loading…
Reference in New Issue
Block a user