hexadezi / TraderForPoe

Trade helper tool for Path of Exile
GNU General Public License v3.0
66 stars 18 forks source link

[Suggestion] A few improvements #19

Closed Pegoth closed 6 years ago

Pegoth commented 6 years ago

I looked at the code and I recommend a code cleanup with ReSharper. And I noticed that you saved Top as X and Left as Y in the settings. It should be the other way around (At MainWindow.xaml.cs line 488).

Settings.Default.WindowLocation = new System.Drawing.Point((int)this.Top, (int)this.Left);

Overall I like the program, but found a few possible improvements:

Smaller improvements

New features

hexadezi commented 6 years ago

The last one is very tricky, maybe in the near future. Same with hiding.

Pegoth commented 6 years ago

The last one is hard yes, but the hiding is not at all. I threw together some 10sec coding.

[DllImport("user32.dll")]
private static extern IntPtr GetForegroundWindow();

private void tick(object sender, EventArgs e)
{
    if (GetForegroundWindow() != FindWindow("POEWindowClass", "Path of Exile"))
        Hide();
    else
        Show();
}

private void starttimer()
{
    System.Windows.Threading.DispatcherTimer dispatcherTimer = new System.Windows.Threading.DispatcherTimer();
    dispatcherTimer.Tick += tick;
    dispatcherTimer.Interval = new TimeSpan(0, 0, 1);
    dispatcherTimer.Start();
}
hexadezi commented 6 years ago

Is now implemented :)