Skip to content

Commit

Permalink
Merged changes from branch
Browse files Browse the repository at this point in the history
  • Loading branch information
kiyazasu committed Sep 9, 2018
2 parents 708de5f + d008689 commit e699aa8
Show file tree
Hide file tree
Showing 15 changed files with 103 additions and 74 deletions.
4 changes: 4 additions & 0 deletions FodyWeavers.xml
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8" ?>
<Weavers>
<Costura/>
</Weavers>
3 changes: 0 additions & 3 deletions OverParse/App.config
Expand Up @@ -184,9 +184,6 @@
<setting name="Updateinv" serializeAs="String">
<value>1000</value>
</setting>
<setting name="QuestTime" serializeAs="String">
<value>False</value>
</setting>
</OverParse.Properties.Settings>
</userSettings>
</configuration>
20 changes: 3 additions & 17 deletions OverParse/Click.cs
Expand Up @@ -96,7 +96,7 @@ private void AutoEndEncounters_Click(object sender, RoutedEventArgs e)
private void SetEncounterTimeout_Click(object sender, RoutedEventArgs e)
{
AlwaysOnTop.IsChecked = false;
Inputbox input = new Inputbox("Encounter Timeout", "Encounter Duration?", Properties.Settings.Default.EncounterTimeout.ToString()) { Owner = this };
InputWindow input = new InputWindow("Encounter Timeout", "Encounter Duration?", Properties.Settings.Default.EncounterTimeout.ToString()) { Owner = this };
input.ShowDialog();
if (Int32.TryParse(input.ResultText, out int x))
{
Expand Down Expand Up @@ -252,7 +252,7 @@ private void Nodecimal_Click(object sender, RoutedEventArgs e)
private void ChangeInterval_Click(object sender, RoutedEventArgs e)
{
AlwaysOnTop.IsChecked = false;
Inputbox input = new Inputbox("OverParse", "Change damage reading interval... (ms)", Properties.Settings.Default.Updateinv.ToString()) { Owner = this };
InputWindow input = new InputWindow("OverParse", "Changes the damage reading interval (ms) ...\nRecommended to leave this at default 1000!", Properties.Settings.Default.Updateinv.ToString()) { Owner = this };
input.ShowDialog();

if (Int32.TryParse(input.ResultText, out int x))
Expand All @@ -272,20 +272,6 @@ private void ChangeInterval_Click(object sender, RoutedEventArgs e)
AlwaysOnTop.IsChecked = Properties.Settings.Default.AlwaysOnTop;
}

private void QuestTime_Click(object sender, RoutedEventArgs e)
{
Properties.Settings.Default.QuestTime = QuestTime.IsChecked;

if (Properties.Settings.Default.QuestTime)
{
Log.ActiveTime = Log.diffTime;
}
else
{
Log.ActiveTime = Log.backupTime;
}
}

private void DefaultWindowSize_Click(object sender, RoutedEventArgs e)
{
Height = 275;
Expand Down Expand Up @@ -450,7 +436,7 @@ private void ClickthroughToggle(object sender, RoutedEventArgs e)
private void About_Click(object sender, RoutedEventArgs e)
{
var version = System.Reflection.Assembly.GetExecutingAssembly().GetName().Version;
MessageBox.Show($"OverParse v{version} EN\n簡易的な自己監視ツール。\n\nShoutouts to WaifuDfnseForce.\nAdditional shoutouts to Variant, AIDA, and everyone else who makes the Tweaker plugin possible.\n\nOptimized and Recoded by Mysty, Rushia, and Kiyazasu. \n\nRetranslated by Mysty, Rushia, and Frostless.\nPlease use damage information responsibly.", "OverParse");
MessageBox.Show($"OverParse v{version} EN\n簡易的な自己監視ツール。\n\nShoutouts to WaifuDfnseForce.\nAdditional shoutouts to Variant, AIDA and everyone else who makes the Tweaker plugin possible.\n\nOptimized and Recoded by Mysty, Rushia and Kiyazasu. \n\nRetranslated by Mysty, Rushia and Frostless.\nPlease use damage information responsibly.", "OverParse");
}

private void LowResources_Click(object sender, RoutedEventArgs e)
Expand Down
61 changes: 54 additions & 7 deletions OverParse/Combatant.cs
Expand Up @@ -87,7 +87,30 @@ public class Combatant
"2191939386" , // Counter Step
"2091027507" , // Special,Diffusion Ray
"4078260742" , // Sharp Glide
"2743062721" }; // Attack Advance (Loser)
"2743062721" , // Attack Advance (Loser)
"3379639420" , // Dark Blast (Apprentice) first hit
"3380458763" , // Dark Blast (Apprentice) second hit
"3380192966" , // Dark Blast (Apprentice) third hit
"3380628902" , // Dark Blast (Apprentice) fourth hit
"3377229307" , // Dark Blast (Apprentice) fifth hit
"3376960044" , // Dark Blast (Apprentice) sixth hit
"3377051585" , // Dark Blast (Apprentice) seventh hit
"3377849861" , // Dark Blast (Apprentice) eighth hit
"855002982" , // Dark Blast (Apprentice) lots'o'slashes - ninth attack
"2326333456" , // Dark Blast (Apprentice) ninth hit final
"3725887474" , // Dark Blast (Apprentice) Step Attack
"361825851" , // Graceful Dance projectile
"3535795759" , // Graceful Dance spin
"781100939" , // Graceful Dance (Royal Scorpion) projectile
"793625150" , // Royal Scorpion
"1764406382" , // Servant Hornet
"3891439877" , // Servant Hornet
"2295506478" , // Fortissimo Kick
"1738105582" , // Fortissimo Kick (AoE?)
"37504833" , // Fortissimo Kick (Royal Scorpion)
"1891210633" , // Black Queen Arrival
"3617357696" , // Sensational Speed Attack
"452272060" }; // Ravishing Step
// Laconium Sword Attack IDs
public static string[] LaconiumAttackIDs = new string[] { "2235773608" , // Laconium Sword air second normal attack
"2235773610" , // Laconium Sword air first normal attack
Expand Down Expand Up @@ -372,24 +395,48 @@ private string GetGeneralMaxHit()
// Returns the Just Attack Percentage
private string GetJAPercent()
{
try
IEnumerable<Attack> totalJA = Attacks.Where(a => !MainWindow.ignoreskill.Contains(a.ID));

if (totalJA.Any())
{
Double averageJA = totalJA.Average(x => x.JA) * 100;

if (Properties.Settings.Default.Nodecimal)
{
return ((Attacks.Where(a => !MainWindow.ignoreskill.Contains(a.ID)).Average(x => x.JA)) * 100).ToString("N0");
return averageJA.ToString("N0");
}
else
{
return ((Attacks.Where(a => !MainWindow.ignoreskill.Contains(a.ID)).Average(x => x.JA)) * 100).ToString("N2");
return averageJA.ToString("N2");
}
}
else
{
if (Properties.Settings.Default.Nodecimal)
{
return "0";
}
else
{
return "0.00";
}
}
catch { return "Error"; }
}

// Returns the Just Attack Percentage in "00.00"
private string GetWJAPercent()
{
return ((Attacks.Where(a => !MainWindow.ignoreskill.Contains(a.ID)).Average(x => x.JA)) * 100).ToString("00.00");
{
IEnumerable<Attack> totalJA = Attacks.Where(a => !MainWindow.ignoreskill.Contains(a.ID));

if (totalJA.Any())
{
Double averageJA = totalJA.Average(x => x.JA) * 100;
return averageJA.ToString("00.00");
}
else
{
return "00.00";
}
}

// Returns the Critical Rate Percentange
Expand Down
7 changes: 3 additions & 4 deletions OverParse/inputbox.xaml → OverParse/InputWindow.xaml
@@ -1,17 +1,16 @@
<Window x:Class="OverParse.Inputbox"
<Window x:Class="OverParse.InputWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:OverParse"
mc:Ignorable="d"
WindowStyle="ToolWindow"
WindowStartupLocation="CenterOwner"
ResizeMode="NoResize"
Title="InputBox" Height="120" Width="400">
Title="InputWindow" Height="120" Width="400">
<Grid>
<Label x:Name="Description" HorizontalAlignment="Left" Height="Auto" Padding="0" Margin="10,10,0,0" VerticalAlignment="Top" Width="250" />
<TextBox x:Name="InputBox" HorizontalAlignment="Left" Height="Auto" Padding="0" Margin="10,0,0,10" TextWrapping="Wrap" VerticalAlignment="Bottom" Width="250" KeyDown="InputBox_KeyDown" />
<TextBox x:Name="InputBox" HorizontalAlignment="Left" Height="Auto" Padding="0" Margin="10,0,0,10" TextWrapping="Wrap" VerticalAlignment="Bottom" Width="250" KeyDown="InputWindow_KeyDown" />
<Button x:Name="OK_button" Content="OK" HorizontalAlignment="Right" Margin="0,10,10,0" VerticalAlignment="Top" Width="75" Click="OK_button_Click"/>
<Button x:Name="Cancel_button" Content="Cancel" HorizontalAlignment="Right" Margin="0,35,10,0" VerticalAlignment="Top" Width="75" IsCancel="True"/>
</Grid>
Expand Down
6 changes: 3 additions & 3 deletions OverParse/inputbox.xaml.cs → OverParse/InputWindow.xaml.cs
Expand Up @@ -2,11 +2,11 @@

namespace OverParse
{
public partial class Inputbox : Window
public partial class InputWindow : Window
{
public string ResultText = "";

public Inputbox(string title ="", string text="", string defalutvalue = "")
public InputWindow(string title ="", string text="", string defalutvalue = "")
{
InitializeComponent();

Expand All @@ -22,7 +22,7 @@ private void OK_button_Click(object sender, RoutedEventArgs e)
Close();
}

private void InputBox_KeyDown(object sender, System.Windows.Input.KeyEventArgs e)
private void InputWindow_KeyDown(object sender, System.Windows.Input.KeyEventArgs e)
{
if(e.Key == System.Windows.Input.Key.Enter)
{
Expand Down
12 changes: 1 addition & 11 deletions OverParse/Log.cs
Expand Up @@ -22,7 +22,6 @@ public class Log
public static int startTimestamp = 0;
public static int newTimestamp = 0;
public static int nowTimestamp = 0;
public static int diffTime = 0;
public static int ActiveTime = 0;
public static int backupTime = 0;
public List<Combatant> combatants = new List<Combatant>();
Expand Down Expand Up @@ -487,20 +486,11 @@ public void UpdateLog(object sender, EventArgs e)

if (newTimestamp - nowTimestamp >= 1)
{
diffTime = diffTime + 1;
nowTimestamp = newTimestamp;
}

backupTime = newTimestamp - startTimestamp;

if (Properties.Settings.Default.QuestTime)
{
ActiveTime = diffTime;
}
else
{
ActiveTime = newTimestamp - startTimestamp;
}
ActiveTime = newTimestamp - startTimestamp;

foreach (Combatant x in combatants)
{
Expand Down
5 changes: 2 additions & 3 deletions OverParse/MainWindow.xaml
Expand Up @@ -138,7 +138,6 @@
<MenuItem Style="{StaticResource submenu}" Header="Hide All Other Players" IsCheckable="True" IsChecked="False" x:Name="Onlyme" Click="Onlyme_Click" />
<MenuItem Style="{StaticResource submenu}" Header="Change DPS Format" IsCheckable="True" IsChecked="False" x:Name="DPSFormat" Click="DPSFormat_Click" />
<MenuItem Style="{StaticResource submenu}" Header="Round JA/Crit Percents" IsCheckable="True" IsChecked="False" x:Name="Nodecimal" Click="Nodecimal_Click" />
<MenuItem Style="{StaticResource submenu}" Header="Remove Combat Downtime" IsCheckable="True" IsChecked="False" x:Name="QuestTime" Click="QuestTime_Click"/>
<MenuItem Style="{StaticResource submenu}" Header="Change Data Update interval" Click="ChangeInterval_Click" />
</MenuItem>
<MenuItem Style="{StaticResource topmenu}" Header="Window">
Expand Down Expand Up @@ -178,7 +177,7 @@
<MenuItem Header="Open github" Click="Github_Click" Style="{StaticResource submenu}" />
<Separator />
<MenuItem Style="{StaticResource submenu}" Header="Skip DLL Update" x:Name="Skipdll" Click="SkipPlugin_Click" />
<MenuItem Style="{StaticResource submenu}" Header="Reselect pso2bin..." x:Name="ResetLogFolder" Click="ResetLogFolder_Click"/>
<MenuItem Style="{StaticResource submenu}" Header="Reselect PSO2bin..." x:Name="ResetLogFolder" Click="ResetLogFolder_Click"/>
<MenuItem Style="{StaticResource submenu}" Header="Force Plugin Update..." x:Name="PluginUpdate" Click="UpdatePlugin_Click"/>
<MenuItem Style="{StaticResource submenu}" Header="Reset OverParse..." x:Name="Reset" Click="ResetOverParse"/>
</MenuItem>
Expand Down Expand Up @@ -306,7 +305,7 @@
</Grid>

<Rectangle x:Name="EncounterIndicator" Grid.Row="2" Height="2" VerticalAlignment="Top" Fill="White" IsHitTestVisible="False" />
<Label x:Name="EncounterStatus" Grid.Row="2" Foreground="White" Padding="5,5,5,2" FontSize="12" IsHitTestVisible="False" />
<Label x:Name="EncounterStatus" Grid.Row="2" Foreground="White" Padding="5,3,5,2" FontSize="12" IsHitTestVisible="False" />
</Grid>
</Border>
</Window>
Expand Down
1 change: 0 additions & 1 deletion OverParse/MainWindow.xaml.cs
Expand Up @@ -131,7 +131,6 @@ public MainWindow()
LogToClipboard.IsChecked = Properties.Settings.Default.LogToClipboard;
AlwaysOnTop.IsChecked = Properties.Settings.Default.AlwaysOnTop;
AutoHideWindow.IsChecked = Properties.Settings.Default.AutoHideWindow;
QuestTime.IsChecked = Properties.Settings.Default.QuestTime;

ShowDamageGraph.IsChecked = Properties.Settings.Default.ShowDamageGraph; ShowDamageGraph_Click(null, null);
AnonymizeNames.IsChecked = Properties.Settings.Default.AnonymizeNames; AnonymizeNames_Click(null, null);
Expand Down
23 changes: 20 additions & 3 deletions OverParse/OverParse.csproj
Expand Up @@ -15,6 +15,8 @@
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<IsWebBootstrapper>false</IsWebBootstrapper>
<TargetFrameworkProfile />
<NuGetPackageImportStamp>
</NuGetPackageImportStamp>
<PublishUrl>publish\</PublishUrl>
<Install>true</Install>
<InstallFrom>Disk</InstallFrom>
Expand Down Expand Up @@ -79,6 +81,12 @@
<NoWin32Manifest>true</NoWin32Manifest>
</PropertyGroup>
<ItemGroup>
<Reference Include="Costura, Version=3.1.0.0, Culture=neutral, PublicKeyToken=9919ef960d84173d, processorArchitecture=MSIL">
<HintPath>..\packages\Costura.Fody.3.1.0\lib\net46\Costura.dll</HintPath>
</Reference>
<Reference Include="FontAwesome.Sharp, Version=5.2.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\FontAwesome.Sharp.5.2.0\lib\net40\FontAwesome.Sharp.dll</HintPath>
</Reference>
<Reference Include="NHotkey, Version=1.2.1.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\NHotkey.1.2.1\lib\net20\NHotkey.dll</HintPath>
</Reference>
Expand Down Expand Up @@ -111,8 +119,8 @@
<Compile Include="Detalis.xaml.cs">
<DependentUpon>Detalis.xaml</DependentUpon>
</Compile>
<Compile Include="inputbox.xaml.cs">
<DependentUpon>inputbox.xaml</DependentUpon>
<Compile Include="InputWindow.xaml.cs">
<DependentUpon>InputWindow.xaml</DependentUpon>
</Compile>
<Compile Include="SelectColumn.xaml.cs">
<DependentUpon>SelectColumn.xaml</DependentUpon>
Expand All @@ -122,7 +130,7 @@
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="inputbox.xaml">
<Page Include="InputWindow.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
Expand Down Expand Up @@ -183,4 +191,13 @@
<Resource Include="Hero.ico" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('..\packages\Costura.Fody.3.1.0\build\Costura.Fody.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Costura.Fody.3.1.0\build\Costura.Fody.targets'))" />
<Error Condition="!Exists('..\packages\Fody.3.2.1\build\Fody.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Fody.3.2.1\build\Fody.targets'))" />
</Target>
<Import Project="..\packages\Costura.Fody.3.1.0\build\Costura.Fody.targets" Condition="Exists('..\packages\Costura.Fody.3.1.0\build\Costura.Fody.targets')" />
<Import Project="..\packages\Fody.3.2.1\build\Fody.targets" Condition="Exists('..\packages\Fody.3.2.1\build\Fody.targets')" />
</Project>
4 changes: 2 additions & 2 deletions OverParse/Properties/AssemblyInfo.cs
Expand Up @@ -51,5 +51,5 @@
// すべての値を指定するか、次を使用してビルド番号とリビジョン番号を既定に設定できます
// 既定値にすることができます:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("3.0.8.0")]
[assembly: AssemblyFileVersion("3.0.8.0")]
[assembly: AssemblyVersion("3.0.9.0")]
[assembly: AssemblyFileVersion("3.0.9.0")]

0 comments on commit e699aa8

Please sign in to comment.