-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMainForm.cs
More file actions
68 lines (64 loc) · 2.39 KB
/
MainForm.cs
File metadata and controls
68 lines (64 loc) · 2.39 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
using System;
using System.Diagnostics;
using System.IO;
using System.Windows.Forms;
using Styx.CommonBot;
using Styx.CommonBot.POI;
using Styx.CommonBot.Profiles;
using Styx.Helpers;
namespace HighVoltz.AutoAngler
{
public partial class MainForm : Form
{
public MainForm()
{
InitializeComponent();
propertyGrid.SelectedObject = AutoAnglerSettings.Instance;
}
private void PropertyGridPropertyValueChanged(object s, PropertyValueChangedEventArgs e)
{
if (e.ChangedItem.Label == "Poolfishing")
{
if (!(bool) e.ChangedItem.Value)
{
if (!string.IsNullOrEmpty(ProfileManager.XmlLocation))
{
AutoAnglerSettings.Instance.LastLoadedProfile = ProfileManager.XmlLocation;
AutoAnglerSettings.Instance.Save();
}
ProfileManager.LoadEmpty();
}
else if ((ProfileManager.CurrentProfile == null || ProfileManager.CurrentProfile.Name == "Empty Profile") &&
!string.IsNullOrEmpty(AutoAnglerSettings.Instance.LastLoadedProfile) &&
File.Exists(AutoAnglerSettings.Instance.LastLoadedProfile))
{
ProfileManager.LoadNew(AutoAnglerSettings.Instance.LastLoadedProfile);
}
}
AutoAnglerSettings.Instance.Save();
}
private void MailButtonClick(object sender, EventArgs e)
{
Profile profile = ProfileManager.CurrentProfile;
if (profile != null && profile.MailboxManager != null)
{
Mailbox mailbox = profile.MailboxManager.GetClosestMailbox();
if (mailbox != null)
{
if (!string.IsNullOrEmpty(CharacterSettings.Instance.MailRecipient))
{
BotPoi.Current = new BotPoi(mailbox);
AutoAnglerBot.Log("Forced Mail run");
TreeRoot.StatusText = "Doing Mail Run";
}
else
AutoAnglerBot.Log("No mail recipient set");
}
else
{
AutoAnglerBot.Log("Profile has no Mailbox");
}
}
}
}
}