From 4701f9124cc952d61727df6e65dfd85c56c38336 Mon Sep 17 00:00:00 2001 From: Aluerie Date: Sun, 2 Aug 2026 20:28:38 +0300 Subject: [PATCH] (feat): add target health and posture percentages --- SekiroTool/ViewModels/TargetViewModel.cs | 32 +++++++++++++++++++++--- SekiroTool/Views/Tabs/TargetTab.xaml | 4 ++- 2 files changed, 31 insertions(+), 5 deletions(-) diff --git a/SekiroTool/ViewModels/TargetViewModel.cs b/SekiroTool/ViewModels/TargetViewModel.cs index e5ca1cb..a31780c 100644 --- a/SekiroTool/ViewModels/TargetViewModel.cs +++ b/SekiroTool/ViewModels/TargetViewModel.cs @@ -170,14 +170,26 @@ public int CustomHp public int TargetCurrentHealth { get => _targetCurrentHealth; - set => SetProperty(ref _targetCurrentHealth, value); + set + { + SetProperty(ref _targetCurrentHealth, value); + OnPropertyChanged(nameof(TargetHealthPercentage)); + } } public int TargetMaxHealth { get => _targetMaxHealth; - set => SetProperty(ref _targetMaxHealth, value); + set + { + SetProperty(ref _targetMaxHealth, value); + OnPropertyChanged(nameof(TargetHealthPercentage)); + } } + + public string TargetHealthPercentage => TargetMaxHealth > 0 + ? (TargetCurrentHealth / (double)TargetMaxHealth * 100).ToString("F1") + : "0.0"; public bool IsFreezeHealthEnabled { @@ -204,14 +216,26 @@ public int CustomPosture public int TargetCurrentPosture { get => _targetCurrentPosture; - set => SetProperty(ref _targetCurrentPosture, value); + set + { + SetProperty(ref _targetCurrentPosture, value); + OnPropertyChanged(nameof(TargetPosturePercentage)); + } } public int TargetMaxPosture { get => _targetMaxPosture; - set => SetProperty(ref _targetMaxPosture, value); + set + { + SetProperty(ref _targetMaxPosture, value); + OnPropertyChanged(nameof(TargetPosturePercentage)); + } } + + public string TargetPosturePercentage => TargetMaxPosture > 0 + ? (TargetCurrentPosture / (double)TargetMaxPosture * 100).ToString("F1") + : "0.0"; public bool IsFreezePostureEnabled { diff --git a/SekiroTool/Views/Tabs/TargetTab.xaml b/SekiroTool/Views/Tabs/TargetTab.xaml index 969e49e..602db1c 100644 --- a/SekiroTool/Views/Tabs/TargetTab.xaml +++ b/SekiroTool/Views/Tabs/TargetTab.xaml @@ -40,8 +40,9 @@ + - + +