damage plot feature implementation
MODIFY
HunterPie/Core/Client/UserSettings.cs
HunterPie/Core/Client/UserSettings.cs
@@ -135,6 +135,7 @@ namespace HunterPie.Core
public bool ShowOnlyTimer { get; set; } = false;
public bool ShowTimer { get; set; } = true;
public double Width { get; set; } = 1;
+ public bool EnableDamagePlot { get; set; } = true;
}
public class Players

MODIFY
HunterPie/GUI/Widgets/DPSMeter/Meter.xaml
HunterPie/GUI/Widgets/DPSMeter/Meter.xaml
<Image Source="{StaticResource ICON_STOPWATCH}" Width="20" Height="20" Margin="5,0,0,0"/>
<TextBlock x:Name="Timer" Width="295" Foreground="#FFEAEAEA" FontWeight="Normal" FontSize="16" Padding="3,4,0,4" />
</StackPanel>
+ <p:DamagePlot x:Name="DamagePlot" MaxHeight="100" />
<WrapPanel x:Name="Party" Visibility="Visible" Orientation="Horizontal" Canvas.Top="29">
</WrapPanel>
</StackPanel>

MODIFY
HunterPie/GUI/Widgets/DPSMeter/Meter.xaml.cs
HunterPie/GUI/Widgets/DPSMeter/Meter.xaml.cs
@@ -46,6 +46,7 @@ namespace HunterPie.GUI.Widgets.DPSMeter
{
Context = ctx.Player.PlayerParty;
GameContext = ctx;
+ DamagePlot.SetContext(ctx);
HookEvents();
}
@@ -115,6 +116,7 @@ namespace HunterPie.GUI.Widgets.DPSMeter
player.UnhookEvents();
}
Players.Clear();
+ DamagePlot.Dispose();
Players = null;
GameContext = null;
Context = null;
@@ -212,6 +214,7 @@ namespace HunterPie.GUI.Widgets.DPSMeter
TimerVisibility = UserSettings.PlayerConfig.Overlay.DPSMeter.ShowTimer ? Visibility.Visible : Visibility.Collapsed;
+ DamagePlot.ApplySettings();
UpdatePlayersColor();
ScaleWidget(UserSettings.PlayerConfig.Overlay.DPSMeter.Scale, UserSettings.PlayerConfig.Overlay.DPSMeter.Scale);
@@ -279,20 +282,29 @@ namespace HunterPie.GUI.Widgets.DPSMeter
private void SnapWidget(double newWidth)
{
double temp;
- if (newWidth / (322 * DefaultScaleX) % 1 >= 0.5)
+ const int defaultWidth = 322;
+ const int memberItemHeight = 46;
+ const int plotHeight = 100;
+
+ if (newWidth / (defaultWidth * DefaultScaleX) % 1 >= 0.5)
{
- temp = (322 * DefaultScaleX) * Math.Ceiling(newWidth / (322 * DefaultScaleX));
+ temp = (defaultWidth * DefaultScaleX) * Math.Ceiling(newWidth / (defaultWidth * DefaultScaleX));
} else
{
- temp = (322 * DefaultScaleX) * Math.Floor(newWidth / (322 * DefaultScaleX));
+ temp = (defaultWidth * DefaultScaleX) * Math.Floor(newWidth / (defaultWidth * DefaultScaleX));
}
- if (newWidth < (322 * DefaultScaleX))
+ if (newWidth < (defaultWidth * DefaultScaleX))
{
- temp = (322 * DefaultScaleX);
+ temp = (defaultWidth * DefaultScaleX);
}
- else if (newWidth > (322 * DefaultScaleX) * 4) temp = (322 * DefaultScaleX) * 4;
+ else if (newWidth > (defaultWidth * DefaultScaleX) * 4) temp = (defaultWidth * DefaultScaleX) * 4;
Width = temp;
- MaxHeight = MinHeight = (TimerContainer.ActualHeight + (Party.ActualHeight == 0 ? 46 * 4 : Party.ActualHeight) + 2) * DefaultScaleY;
+ MaxHeight = MinHeight = (
+ TimerContainer.ActualHeight
+ + (Party.ActualHeight == 0 ? memberItemHeight * 4 : Party.ActualHeight)
+ + 2
+ + (UserSettings.PlayerConfig.Overlay.DPSMeter.EnableDamagePlot ? plotHeight : 0)
+ ) * DefaultScaleY;
}
}
}

MODIFY
HunterPie/GUIControls/NewSettingsWindow.xaml
HunterPie/GUIControls/NewSettingsWindow.xaml
<custom:Switcher x:Name="switchEnableTimer" Text="{Binding Mode=OneTime, XPath=/Strings/Client/Settings/String[@ID\=\'ENABLE_TIMER\']/@Name}" Margin="10,0,10,5" ToolTip="{Binding Mode=OneTime, XPath=/Strings/Client/Settings/String[@ID\=\'ENABLE_TIMER_DESC\']/@Name}" RestartVisibility="Collapsed"/>
<custom:Switcher x:Name="switchEnableTimerInExpeditions" Text="{Binding Mode=OneTime, XPath=/Strings/Client/Settings/String[@ID\=\'ENABLE_TIMER_IN_GL\']/@Name}" Margin="10,0,10,5" ToolTip="{Binding Mode=OneTime, XPath=/Strings/Client/Settings/String[@ID\=\'ENABLE_TIMER_IN_GL_DESC\']/@Name}" RestartVisibility="Collapsed"/>
<custom:Switcher x:Name="switchEnableOnlyTimer" Text="{Binding Mode=OneTime, XPath=/Strings/Client/Settings/String[@ID\=\'ENABLE_ONLY_TIMER\']/@Name}" Margin="10,0,10,5" ToolTip="{Binding Mode=OneTime, XPath=/Strings/Client/Settings/String[@ID\=\'ENABLE_ONLY_TIMER_DESC\']/@Name}" RestartVisibility="Collapsed"/>
+ <custom:Switcher x:Name="switchEnableDamagePlot" Text="{Binding Mode=OneTime, XPath=/Strings/Client/Settings/String[@ID\=\'ENABLE_DAMAGE_PLOT\']/@Name}" Margin="10,0,10,5" ToolTip="{Binding Mode=OneTime, XPath=/Strings/Client/Settings/String[@ID\=\'ENABLE_DAMAGE_PLOT_DESC\']/@Name}" RestartVisibility="Collapsed"/>
<custom:MinimalSlider x:Name="DamageBackgroundOpacity" Text="{Binding XPath=/Strings/Client/Settings/String[@ID\=\'STATIC_BACKGROUND_OPACITY\']/@Name}" MinChange="0.1" MinValue="0" MaxValue="1" ValueText="{Binding Value, ElementName=DamageBackgroundOpacity, StringFormat=\{0:P\}}" Foreground="WhiteSmoke" FontFamily="Segoe UI Light" Margin="10,0,10,5"/>
<custom:MinimalSlider x:Name="DamageComponentOpacity" Text="{Binding XPath=/Strings/Client/Settings/String[@ID\=\'STATIC_OPACITY\']/@Name}" MinChange="0.1" MinValue="0" MaxValue="1" ValueText="{Binding Value, ElementName=DamageComponentOpacity, StringFormat=\{0:P\}}" Foreground="WhiteSmoke" FontFamily="Segoe UI Light" Margin="10,0,10,5"/>
<custom:ColorPicker NameText="{Binding Mode=OneTime, XPath=/Strings/Client/Settings/String[@ID\=\'STATIC_METER_PLAYER_1\']/@Name}" x:Name="FirstPlayerColor" Margin="10,0,10,5"/>

MODIFY
HunterPie/GUIControls/Settings.xaml.cs
HunterPie/GUIControls/Settings.xaml.cs
@@ -171,6 +171,7 @@ namespace HunterPie.GUIControls
settingsUI.switchEnableTimerInExpeditions.IsEnabled = settings.Overlay.DPSMeter.ShowTimerInExpeditions;
settingsUI.switchEnableOnlyTimer.IsEnabled = settings.Overlay.DPSMeter.ShowOnlyTimer;
settingsUI.switchEnableOnlyMyself.IsEnabled = settings.Overlay.DPSMeter.ShowOnlyMyself;
+ settingsUI.switchEnableDamagePlot.IsEnabled = settings.Overlay.DPSMeter.EnableDamagePlot;
settingsUI.DamageMeterPosition.X = settings.Overlay.DPSMeter.Position[0];
settingsUI.DamageMeterPosition.Y = settings.Overlay.DPSMeter.Position[1];
settingsUI.FirstPlayerColor.Color = settings.Overlay.DPSMeter.PartyMembers[0].Color;
@@ -314,6 +315,7 @@ namespace HunterPie.GUIControls
settings.Overlay.DPSMeter.ShowDPSWheneverPossible = settingsUI.switchEnableDPSWheneverPossible.IsEnabled;
settings.Overlay.DPSMeter.ShowTimer = settingsUI.switchEnableTimer.IsEnabled;
settings.Overlay.DPSMeter.ShowTimerInExpeditions = settingsUI.switchEnableTimerInExpeditions.IsEnabled;
+ settings.Overlay.DPSMeter.EnableDamagePlot = settingsUI.switchEnableDamagePlot.IsEnabled;
settings.Overlay.DPSMeter.ShowOnlyTimer = settingsUI.switchEnableOnlyTimer.IsEnabled;
settings.Overlay.DPSMeter.ShowOnlyMyself = settingsUI.switchEnableOnlyMyself.IsEnabled;
settings.Overlay.DPSMeter.Position[0] = settingsUI.DamageMeterPosition.X;

MODIFY
HunterPie/HunterPie.csproj
HunterPie/HunterPie.csproj
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
+ <Page Include="GUI\Widgets\DPSMeter\Parts\DamagePlot.xaml" >
+ <SubType>Designer</SubType>
+ <Generator>MSBuild:Compile</Generator>
+ </Page>
<Page Include="GUI\Widgets\DPSMeter\Parts\PartyMember.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
<Compile Include="GUI\Widgets\DPSMeter\Meter.xaml.cs">
<DependentUpon>Meter.xaml</DependentUpon>
</Compile>
+ <Compile Include="GUI\Widgets\DPSMeter\Parts\DamagePlot.xaml.cs" >
+ <DependentUpon>DamagePlot.xaml</DependentUpon>
+ </Compile>
+ <Compile Include="GUI\Widgets\DPSMeter\Parts\MemberPlotModel.cs" />
<Compile Include="GUI\Widgets\DPSMeter\Parts\PartyMember.xaml.cs">
<DependentUpon>PartyMember.xaml</DependentUpon>
</Compile>
<PackageReference Include="Newtonsoft.Json">
<Version>12.0.3</Version>
</PackageReference>
+ <PackageReference Include="OxyPlot.Wpf">
+ <Version>2.0.0</Version>
+ </PackageReference>
</ItemGroup>
<ItemGroup>
<None Include="clean.py">

MODIFY
HunterPie/Languages/en-us.xml
HunterPie/Languages/en-us.xml
<String ID="STATIC_METER_PLAYER_3" Name="Third Player"/>
<String ID="STATIC_METER_PLAYER_4" Name="Fourth Player"/>
<String ID="STATIC_METER_POSITION_DESC" Name="Changes the Damage Meter widget position."/>
+ <String ID="ENABLE_DAMAGE_PLOT" Name="Show damage plot"/>
+ <String ID="ENABLE_DAMAGE_PLOT_DESC" Name="If enabled, damage plot will be visible."/>
<!-- Abnormalities Widget -->
<String ID="STATIC_CREATE_ABNORM_BAR_DESC" Name="Create a new abnormality bar."/>
<String ID="STATIC_REMOVE_ABNORM_BAR_DESC" Name="Remove last crated abnormality bar."/>

damage plot feature implementation