public UserControl UcSetting = new UserControl(); // holds current settings user control private void treeView1_NodeMouseClick(object sender, TreeNodeMouseClickEventArgs e) { if (e.Button != MouseButtons.Left) { return; } var tmp = new UserControl(); switch (e.Node.Name) { case "General": // General tmp = new General(); break; case "AutoPos": // Auto postion tmp = new AutoPosition(); break; case "PingCheck": case "ConnectionCheck": tmp = new SettingsTree.ConnectionCheck(); break; case "IpHostCheck": tmp = new IpHostCheck(); break; case "AntiIdle": tmp = new AntiIdle(); break; case "ProfileKickstart": tmp = new ProfileKickstart(); break; case "HotKeys": tmp = new HotKeys(); break; case "Stats": tmp = new Stats(); break; } // Check if new user control should be displayed if (!tmp.Name.Equals(UcSetting.Name)) { //var c = tabControl1.TabPages[1].Controls; var c = SettingsPanel.Controls; if (c.Contains(UcSetting)) { c.Remove(UcSetting); } UcSetting = tmp; //_ucSetting.Left = 180; c.Add(UcSetting); } }
public object Clone() { var clone = new BotClass { AntiIdle = AntiIdle.Copy(), ChartStats = ChartStats.Copy(), CreateWindowsUser = CreateWindowsUser.Copy(), D3PrefsLocation = D3PrefsLocation.Copy(), Demonbuddy = Demonbuddy.Copy(), Description = Description.Copy(), Diablo = Diablo.Copy(), DiabloCloneLocation = DiabloCloneLocation.Copy(), Name = Name.Copy(), ProfileSchedule = new ProfileScheduleClass(), UseDiabloClone = UseDiabloClone.Copy(), UseWindowsUser = UseWindowsUser.Copy(), Week = Week.Copy(), WindowsUserName = WindowsUserName.Copy(), WindowsUserPassword = WindowsUserPassword.Copy() }; foreach (var profile in ProfileSchedule.Profiles) { clone.ProfileSchedule.Profiles.Add(profile); } return(clone); }
public void Start(bool force = false) { AntiIdle.Reset(freshstart: true); IsStarted = true; IsStandby = false; Week.ForceStart = force; Status = (force ? "Forced start" : "Started"); if (force) { Logger.Instance.Write(this, "Forced to start! "); } }
private void Window_Main_Load(object sender, EventArgs e) { typeof(Button).InvokeMember("DoubleBuffered", BindingFlags.SetProperty | BindingFlags.Instance | BindingFlags.NonPublic, null, bt_Skill1, new object[] { true }); typeof(Button).InvokeMember("DoubleBuffered", BindingFlags.SetProperty | BindingFlags.Instance | BindingFlags.NonPublic, null, bt_Skill2, new object[] { true }); typeof(Button).InvokeMember("DoubleBuffered", BindingFlags.SetProperty | BindingFlags.Instance | BindingFlags.NonPublic, null, bt_Skill3, new object[] { true }); typeof(Button).InvokeMember("DoubleBuffered", BindingFlags.SetProperty | BindingFlags.Instance | BindingFlags.NonPublic, null, bt_Skill4, new object[] { true }); typeof(Button).InvokeMember("DoubleBuffered", BindingFlags.SetProperty | BindingFlags.Instance | BindingFlags.NonPublic, null, bt_SkillLmb, new object[] { true }); typeof(Button).InvokeMember("DoubleBuffered", BindingFlags.SetProperty | BindingFlags.Instance | BindingFlags.NonPublic, null, bt_SkillRmb, new object[] { true }); directInput = new DirectInput(); keyboard = new SlimDX.DirectInput.Keyboard(directInput); keyboard.Acquire(); mouse = new SlimDX.DirectInput.Mouse(directInput); mouse.Acquire(); Point d3helpermainwindowpos = Properties.Settings.Default.D3Helper_MainForm_StartPosition; var screens = Screen.AllScreens.OrderByDescending(x => x.Bounds.X); if (d3helpermainwindowpos.X >= screens.Last().Bounds.Left&& d3helpermainwindowpos.X <= screens.First().Bounds.Right&& d3helpermainwindowpos.Y <= screens.First().Bounds.Bottom&& d3helpermainwindowpos.Y >= screens.First().Bounds.Top) { this.Top = Properties.Settings.Default.D3Helper_MainForm_StartPosition.Y; this.Left = Properties.Settings.Default.D3Helper_MainForm_StartPosition.X; } else { this.Top = 0; this.Left = 0; } //this.btn_donate.Image = new Bitmap(Properties.Resources.paypal_donate_button11, new Size(this.btn_donate.Width, this.btn_donate.Height)); this.btn_info.Image = new Bitmap(Properties.Resources._480px_Info_icon_002_svg, new Size(this.btn_info.Width, this.btn_info.Height)); this.btn_settings.Image = new Bitmap(Properties.Resources.pignon, new Size(this.btn_settings.Width, this.btn_settings.Height)); DateTime latestOnlineVersion = A_Tools.Version.AppVersion.LatestOnlineVersion; DateTime currentVersion = A_Tools.Version.AppVersion.get_CurrentVersionDate(); if (latestOnlineVersion > currentVersion) { this.lb_versionlb.Text = "New Version Available!" + System.Environment.NewLine + latestOnlineVersion.ToString("yy.MM.d.H"); //this.lb_versionlb.Invoke((MethodInvoker)(() => this.lb_versionlb.Text = "New Version Available!")); this.bt_update.Visible = true; } else { this.lb_versionlb.Text = ""; //this.lb_versionlb.Invoke((MethodInvoker)(() => this.lb_versionlb.Text = "")); } this.Text = "D3Helper - V" + A_Tools.Version.AppVersion.version; //Use SimpleCast! T_SimpleCast.StartSimpleCastThread(); //fill combobox for simple cast loadSimeCastListToCombobox(); //create thread waiting for d3 start! Thread t = new Thread(delegate() { //wait till d3 is running while (!isDiabloRunning()) { try { Thread.Sleep(1000); } catch { } } if (SupportedProcessVersion()) { //-- Initialize Collector and Handler Thread //if (!Program.SingleThreaded) A_Initialize.Th_ICollector.New_ICollector(); A_Initialize.Th_Handler.New_Handler(); System.Timers.Timer UpdateUI = new System.Timers.Timer(1000); UpdateUI.Elapsed += RefreshUI; UpdateUI.Start(); Load_CustomFonts(); } else { this.Text = "You are running a not supported D3Client(" + GetFileVersion() + ") Supported Version is " + SupportedVersion; } }); t.SetApartmentState(ApartmentState.STA); //must be STA Thread to access GUI t.Start(); //overlay if (SupportedProcessVersion()) { A_WPFOverlay.Overlay o = new A_WPFOverlay.Overlay(); o.Show(); } Me.Threads.AntiIdleThread = new Thread(() => { AntiIdle antiIdle = new AntiIdle(); }); if (Properties.Settings.Default.AntiIdleBool) { Me.Threads.AntiIdleThread.Start(); } try { if (Me.Threads.RosBotUpgradeKadalaThread.ThreadState == System.Threading.ThreadState.Unstarted) { Me.Threads.RosBotUpgradeKadalaThread = new Thread(() => { RosBotUpgradeKadala rosBotUpgradeKadala = new RosBotUpgradeKadala(); }); if (Properties.Settings.Default.RosBotUpgradeKadalaBool) { Me.Threads.RosBotUpgradeKadalaThread.Start(); } } } catch { Me.Threads.RosBotUpgradeKadalaThread = new Thread(() => { RosBotUpgradeKadala rosBotUpgradeKadala = new RosBotUpgradeKadala(); }); if (Properties.Settings.Default.RosBotUpgradeKadalaBool) { Me.Threads.RosBotUpgradeKadalaThread.Start(); } } Me.Threads.HomingPadsThread = new Thread(() => { HomingPadsHandler homingPadsHandler = new HomingPadsHandler(); }); // Probably best to not start this thread unless user has it turned on in settings // Will require a restart of D3helper any time it's turned on/off though if (Properties.Settings.Default.HomingPadsBool) { Me.Threads.HomingPadsThread.Start(); } }