Skip to content

Commit 11c1fe0

Browse files
authored
Merge pull request #1525 from whoswhip/aimmy-prs
General Bug Fixes
2 parents 3ef545b + 96eb823 commit 11c1fe0

File tree

5 files changed

+20
-34
lines changed

5 files changed

+20
-34
lines changed

Aimmy2/App.xaml.cs

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,10 @@
1-
using Aimmy2.Class;
2-
using Aimmy2.Theme;
1+
using Aimmy2.Theme;
32
using Class;
4-
using System;
5-
using System.Collections.Generic;
63
using System.Windows;
74

85
namespace Aimmy2
96
{
10-
public partial class App : System.Windows.Application
7+
public partial class App : Application
118
{
129
protected override void OnStartup(StartupEventArgs e)
1310
{
@@ -17,6 +14,13 @@ protected override void OnStartup(StartupEventArgs e)
1714
// Set shutdown mode to prevent app from closing when startup window closes
1815
ShutdownMode = ShutdownMode.OnExplicitShutdown;
1916

17+
#if DEBUG
18+
var _mainWindow = new MainWindow();
19+
MainWindow = _mainWindow;
20+
_mainWindow.Show();
21+
return;
22+
#endif
23+
// code IS reachable, only in release though
2024
try
2125
{
2226
// Create and show startup window

Aimmy2/UILibrary/AColorWheel.xaml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -191,12 +191,6 @@
191191
Height="50"
192192
VerticalAlignment="Bottom"
193193
CornerRadius="0">
194-
<Border.Background>
195-
<LinearGradientBrush StartPoint="0,0" EndPoint="0,1">
196-
<GradientStop Color="#FF1A1A1A" Offset="0"/>
197-
<GradientStop Color="#FF0F0F0F" Offset="1"/>
198-
</LinearGradientBrush>
199-
</Border.Background>
200194

201195
<Grid>
202196
<Grid.ColumnDefinitions>

Aimmy2/UILibrary/ADisplaySelector.xaml

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -43,18 +43,12 @@
4343
<Border Height="50"
4444
VerticalAlignment="Bottom"
4545
CornerRadius="0">
46-
<Border.Background>
47-
<LinearGradientBrush StartPoint="0,0" EndPoint="0,1">
48-
<GradientStop Color="#FF1A1A1A" Offset="0"/>
49-
<GradientStop Color="#FF0F0F0F" Offset="1"/>
50-
</LinearGradientBrush>
51-
</Border.Background>
5246

5347
<Label x:Name="CurrentDisplayInfo"
5448
FontFamily="{StaticResource Atkinson Hyperlegible}"
5549
Content="Primary Display Selected"
5650
Foreground="#BBFFFFFF"
57-
FontSize="11"
51+
FontSize="14"
5852
HorizontalContentAlignment="Center"
5953
VerticalContentAlignment="Center"/>
6054
</Border>

Aimmy2/UISections/AimMenuControl.xaml.cs

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -253,9 +253,9 @@ private void AddConfigSliders(SectionBuilder builder, UI uiManager)
253253
{
254254
var value = s.Slider.Value;
255255
if (value >= 0.98)
256-
ShowNotice("The Mouse Sensitivity you have set can cause Aimmy to be unable to aim, please decrease if you suffer from this problem");
256+
new NoticeBar("The Mouse Sensitivity you have set can cause Aimmy to be unable to aim, please decrease if you suffer from this problem").Show();
257257
else if (value <= 0.1)
258-
ShowNotice("The Mouse Sensitivity you have set can cause Aimmy to be unstable to aim, please increase if you suffer from this problem");
258+
new NoticeBar("The Mouse Sensitivity you have set can cause Aimmy to be unstable to aim, please increase if you suffer from this problem").Show();
259259
};
260260
})
261261
.AddSlider("Mouse Jitter", "Jitter", 1, 1, 0, 15, s => uiManager.S_MouseJitter = s)
@@ -344,7 +344,7 @@ private void LoadAntiRecoilConfig()
344344
if (saveFileDialog.ShowDialog() == true)
345345
{
346346
SaveDictionary.WriteJSON(Dictionary.AntiRecoilSettings, saveFileDialog.FileName);
347-
ShowNotice($"[Anti Recoil] Config has been saved to \"{saveFileDialog.FileName}\"", 2000);
347+
new NoticeBar($"[Anti Recoil] Config has been saved to \"{saveFileDialog.FileName}\"", 2000).Show();
348348
}
349349
};
350350
})
@@ -422,7 +422,7 @@ private void LoadESPConfig()
422422

423423
builder.AddDropdown("Tracer Position", d =>
424424
{
425-
d.DropdownBox.SelectedIndex = -1;
425+
d.DropdownBox.SelectedIndex = 0;
426426
uiManager.D_TracerPosition = d;
427427
_mainWindow.AddDropdownItem(d, "Bottom");
428428
_mainWindow.AddDropdownItem(d, "Middle");
@@ -491,9 +491,6 @@ private void HandleColorChange(AColorChanger colorChanger, string settingKey, Ac
491491
}
492492
}
493493

494-
private void ShowNotice(string message, int duration = 10000) =>
495-
new NoticeBar(message, duration).Show();
496-
497494
public void Dispose()
498495
{
499496
// Save minimize states before disposing

Aimmy2/UISections/SettingsMenuControl.xaml.cs

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -186,9 +186,9 @@ private void LoadSettingsConfig()
186186
{
187187
var value = s.Slider.Value;
188188
if (value >= 95)
189-
ShowNotice("The minimum confidence you have set for Aimmy to be too high and may be unable to detect players.");
189+
new NoticeBar("The minimum confidence you have set for Aimmy to be too high and may be unable to detect players.").Show();
190190
else if (value <= 35)
191-
ShowNotice("The minimum confidence you have set for Aimmy may be too low can cause false positives.");
191+
new NoticeBar("The minimum confidence you have set for Aimmy may be too low can cause false positives.").Show();
192192
};
193193
})
194194
.AddToggle("Mouse Background Effect", t => uiManager.T_MouseBackgroundEffect = t)
@@ -248,11 +248,11 @@ private void LoadDisplaySelectMenu()
248248
{
249249
DisplayManager.RefreshDisplays();
250250
uiManager.DisplaySelector.RefreshDisplays();
251-
ShowNotice("Display list refreshed successfully");
251+
new NoticeBar("Display list refreshed successfully").Show();
252252
}
253253
catch (Exception ex)
254254
{
255-
ShowNotice($"Error refreshing displays: {ex.Message}");
255+
new NoticeBar($"Error refreshing displays: {ex.Message}").Show();
256256
}
257257
};
258258
DisplaySelectMenu.Children.Insert(insertIndex + 1, refreshButton);
@@ -276,7 +276,7 @@ private void LoadThemeMenu()
276276
uiManager.ThemeColorWheel = new AColorWheel();
277277

278278
// Insert before separator
279-
var insertIndex = ThemeMenu.Children.Count - 1;
279+
var insertIndex = ThemeMenu.Children.Count - 2;
280280
ThemeMenu.Children.Insert(insertIndex, uiManager.ThemeColorWheel);
281281
}
282282

@@ -290,7 +290,7 @@ private void OnDisplayChanged(object? sender, DisplayChangedEventArgs e)
290290
{
291291
try
292292
{
293-
ShowNotice($"AI focus switched to Display {e.DisplayIndex + 1} ({e.Bounds.Width}x{e.Bounds.Height})");
293+
new NoticeBar($"AI focus switched to Display {e.DisplayIndex + 1} ({e.Bounds.Width}x{e.Bounds.Height})").Show();
294294
UpdateDisplayRelatedSettings(e);
295295
}
296296
catch (Exception ex)
@@ -310,9 +310,6 @@ private async Task ResetToMouseEvent()
310310
_mainWindow!.uiManager.D_MouseMovementMethod!.DropdownBox.SelectedIndex = 0;
311311
}
312312

313-
private void ShowNotice(string message, int duration = 4000) =>
314-
new NoticeBar(message, duration).Show();
315-
316313
public void Dispose()
317314
{
318315
DisplayManager.DisplayChanged -= OnDisplayChanged;

0 commit comments

Comments
 (0)