Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 28 additions & 4 deletions SekiroTool/ViewModels/TargetViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand All @@ -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
{
Expand Down
4 changes: 3 additions & 1 deletion SekiroTool/Views/Tabs/TargetTab.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,9 @@
<Run Text="{Binding TargetCurrentHealth, Mode=OneWay}" />
<Run Text="/" />
<Run Text="{Binding TargetMaxHealth, Mode=OneWay}" />
<Run Text="{Binding TargetHealthPercentage, Mode=OneWay, StringFormat={}({0}%)}" />
</TextBlock>

<xctk:IntegerUpDown Width="80" Margin="5,2"
HorizontalAlignment="Right"
Value="{Binding CustomHp}"
Expand Down Expand Up @@ -158,6 +159,7 @@
<Run Text="{Binding TargetCurrentPosture, Mode=OneWay}" />
<Run Text="/" />
<Run Text="{Binding TargetMaxPosture, Mode=OneWay}" />
<Run Text="{Binding TargetPosturePercentage, Mode=OneWay, StringFormat={}({0}%)}" />
</TextBlock>
<xctk:IntegerUpDown Width="80" Margin="5,2"
HorizontalAlignment="Right"
Expand Down