feat: add highlighting for target in creature list
This commit is contained in:
@ -24,6 +24,8 @@ namespace Client.Application.ViewModels
|
||||
|
||||
public float DeltaZ => creature.DeltaZ(hero);
|
||||
|
||||
public bool IsTarget => Id == hero.TargetId;
|
||||
|
||||
public ICommand MouseLeftClickCommand { get; }
|
||||
public ICommand MouseLeftDoubleClickCommand { get; }
|
||||
public ICommand MouseRightClickCommand { get; }
|
||||
@ -47,6 +49,7 @@ namespace Client.Application.ViewModels
|
||||
creature.PropertyChanged += Creature_PropertyChanged;
|
||||
creature.Transform.Position.PropertyChanged += Position_PropertyChanged;
|
||||
hero.Transform.Position.PropertyChanged += HeroPosition_PropertyChanged;
|
||||
hero.PropertyChanged += Hero_PropertyChanged;
|
||||
MouseLeftClickCommand = new RelayCommand(OnMouseLeftClick);
|
||||
MouseLeftDoubleClickCommand = new RelayCommand(OnMouseLeftDoubleClick);
|
||||
MouseRightClickCommand = new RelayCommand(OnMouseRightClick);
|
||||
@ -80,6 +83,14 @@ namespace Client.Application.ViewModels
|
||||
}
|
||||
}
|
||||
|
||||
private void Hero_PropertyChanged(object? sender, System.ComponentModel.PropertyChangedEventArgs e)
|
||||
{
|
||||
if (e.PropertyName == "TargetId")
|
||||
{
|
||||
OnPropertyChanged("IsTarget");
|
||||
}
|
||||
}
|
||||
|
||||
private readonly CreatureInterface creature;
|
||||
private readonly Hero hero;
|
||||
private readonly WorldHandler worldHandler;
|
||||
|
Reference in New Issue
Block a user