From 433c99574d5ac8779414596746f8d3aad933e4e1 Mon Sep 17 00:00:00 2001 From: moarSmokes Date: Fri, 23 Aug 2019 03:01:40 +0200 Subject: [PATCH] -Changing the tax formular to adress the last changes made by ccp -Clearing the Clipboard before setting new value helps without throwing CLIPBRD_E_CANT_OPEN everytime you export a new log with -Replacing obselete api call call with a new one from the Threading api -Added vs folder to gitignore --- .gitignore | 1 + Elinor/CalculateDataThread.cs | 4 ++-- Elinor/ClipboardTools.cs | 1 + Elinor/MessageBoxEx.cs | 3 ++- 4 files changed, 6 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index f08f75a..20238b5 100644 --- a/.gitignore +++ b/.gitignore @@ -44,3 +44,4 @@ Elinor/bin/ Elinor/obj/ *.suo *.msi +.vs/ diff --git a/Elinor/CalculateDataThread.cs b/Elinor/CalculateDataThread.cs index 91a7429..5c28a83 100644 --- a/Elinor/CalculateDataThread.cs +++ b/Elinor/CalculateDataThread.cs @@ -43,12 +43,12 @@ internal static double SellBrokerFee(Profile profile) internal static double NpcBroker(Profile profile) { - return (3 - (profile.brokerRelations * 0.1 + profile.factionStanding * 0.03 + profile.corpStanding * 0.02)) / 100; + return (5 - (profile.brokerRelations * 0.3 + profile.factionStanding * 0.03 + profile.corpStanding * 0.02)) / 100; } internal static double SalesTax(int accounting) { - return .020*(1 - (accounting*.1)); + return .050*(1 - (accounting*.11)); } internal void Run() diff --git a/Elinor/ClipboardTools.cs b/Elinor/ClipboardTools.cs index 08971a8..5874c8b 100644 --- a/Elinor/ClipboardTools.cs +++ b/Elinor/ClipboardTools.cs @@ -19,6 +19,7 @@ internal static void SetClipboardWrapper(double d) while (copied == false && Attempts < 3) { + Clipboard.Clear(); try { Clipboard.SetText(d > .01 ? Math.Round(d, 2).ToString(CultureInfo.InvariantCulture) : string.Empty); diff --git a/Elinor/MessageBoxEx.cs b/Elinor/MessageBoxEx.cs index dbed7fd..1f83a7e 100644 --- a/Elinor/MessageBoxEx.cs +++ b/Elinor/MessageBoxEx.cs @@ -3,6 +3,7 @@ using System.Windows.Forms; using System.Drawing; using System.Runtime.InteropServices; +using System.Threading; namespace Elinor { @@ -166,7 +167,7 @@ private static void Initialize() if (_owner != null) { - _hHook = SetWindowsHookEx(WH_CALLWNDPROCRET, _hookProc, IntPtr.Zero, AppDomain.GetCurrentThreadId()); + _hHook = SetWindowsHookEx(WH_CALLWNDPROCRET, _hookProc, IntPtr.Zero, Thread.CurrentThread.ManagedThreadId); } }