public ShowInfoForm(ClientForm parent, BLL.PWClient client) : base(parent, new PopUpCoords(client.dbConfig.ShowInfo.WinPinned, client.dbConfig.ShowInfo.WinShowAttachParent, client.dbConfig.ShowInfo.ScreenX, client.dbConfig.ShowInfo.ScreenY)) { InitializeComponent(); this.timer1.Enabled = false; this.Client = client; this.VisibleChanged += (sender, e) => { timer1.Enabled = this.Visible; }; }
public AutoKeyForm(ClientForm parent, BLL.PWClient client) : base(parent, new PopUpCoords(client.dbConfig.AutoKey.WinPinned, client.dbConfig.AutoKey.WinShowAttachParent, client.dbConfig.AutoKey.ScreenX, client.dbConfig.AutoKey.ScreenY)) { InitializeComponent(); this.Client = client; this.Client.Auto.OnAutoKeyStatusChange += (sender, e) => DoDrawStatus(); DoDrawControls(); }
public AutoSpotForm(ClientForm parent, BLL.PWClient client) : base(parent, new PopUpCoords(client.dbConfig.AutoSpot.WinPinned, client.dbConfig.AutoSpot.WinShowAttachParent, client.dbConfig.AutoSpot.ScreenX, client.dbConfig.AutoSpot.ScreenY)) { InitializeComponent(); this.Client = client; this.Activated += (sender, e) => { PAssistMobRefresh_Click(this.pAssistMobRefresh, null); }; this.lBuffKey.MouseWheel += (sender, e) => { this.Client.dbConfig.AutoSpot.BuffKey = e.Delta > 0 ? Values.GetAllKeyPost(this.Client.dbConfig.AutoSpot.BuffKey, true) : Values.GetAllKeyPrev(this.Client.dbConfig.AutoSpot.BuffKey, true); this.Client.dbConfig.PendingChanges = true; DoDrawControls(); }; this.lBuffExpire.MouseWheel += (sender, e) => { this.Client.dbConfig.AutoSpot.BuffExpireTime = e.Delta > 0 ? Values.GetTimesPost(this.Client.dbConfig.AutoSpot.BuffExpireTime) : Values.GetTimesPrev(this.Client.dbConfig.AutoSpot.BuffExpireTime); this.Client.dbConfig.PendingChanges = true; DoDrawControls(); }; this.lBuffCast.MouseWheel += (sender, e) => { this.Client.dbConfig.AutoSpot.BuffCastTime = e.Delta > 0 ? Values.GetTimesPost(this.Client.dbConfig.AutoSpot.BuffCastTime) : Values.GetTimesPrev(this.Client.dbConfig.AutoSpot.BuffCastTime); this.Client.dbConfig.PendingChanges = true; DoDrawControls(); }; this.lAssist.MouseWheel += (sender, e) => { this.Client.dbConfig.AutoSpot.AssistKey = e.Delta > 0 ? Values.GetAllKeyPost(this.Client.dbConfig.AutoSpot.AssistKey, true) : Values.GetAllKeyPrev(this.Client.dbConfig.AutoSpot.AssistKey, true); this.Client.dbConfig.PendingChanges = true; DoDrawControls(); }; this.lPickKey.MouseWheel += (sender, e) => { this.Client.dbConfig.AutoSpot.PickKey = e.Delta > 0 ? Values.GetAllKeyPost(this.Client.dbConfig.AutoSpot.PickKey, true) : Values.GetAllKeyPrev(this.Client.dbConfig.AutoSpot.PickKey, true); this.Client.dbConfig.PendingChanges = true; DoDrawControls(); }; this.lPickTime.MouseWheel += (sender, e) => { this.Client.dbConfig.AutoSpot.PickTime = e.Delta > 0 ? Values.GetTimesPost(this.Client.dbConfig.AutoSpot.PickTime) : Values.GetTimesPrev(this.Client.dbConfig.AutoSpot.PickTime); this.Client.dbConfig.PendingChanges = true; DoDrawControls(); }; this.lAssitMob.MouseWheel += (sender, e) => { var values = this.NPCs.Select(p => Convert.ToInt32(p.Key)).ToList(); this.Client.dbConfig.AutoSpot.AssistMob = (e.Delta > 0) ? Values.GetPost(this.Client.dbConfig.AutoSpot.AssistMob, values) : Values.GetPrev(this.Client.dbConfig.AutoSpot.AssistMob, values); //this.Client.dbConfig.PendingChanges = true; DoDrawControls(); }; DoDrawControls(); }
private void OnAttach(object sender, EventArgs e) { var cCuenta = (DTO.Configuration.Cuenta)((ToolStripMenuItem)sender).Tag; var cuenta = BLL.ClientManager.AttachPW(cCuenta); if (cuenta != null) { WinManager.AddClient(cuenta); } LastCuentaCreated = cuenta; }
private void OnAbrirNuevo(object sender, EventArgs e) { var cCuenta = (DTO.Configuration.Cuenta)((ToolStripMenuItem)sender).Tag; var cuenta = BLL.ClientManager.OpenPW(cCuenta); cuenta.Action.Global.DoLogin(true); if (cuenta != null) { WinManager.AddClient(cuenta); } LastCuentaCreated = cuenta; }
public FormTools(ClientForm form, BLL.PWClient client) { this.Form = form; this.Client = client; this.Client.Mem.Link.OnConnect += (sender, e) => CalculateStatus(); this.Client.Mem.Link.OnPlayerConnect += (sender, e) => CalculateStatus(); this.Client.Mem.Link.OnCurrentHPChange += (sender, e) => CalculateStatus(); this.Client.Auto.OnAutoKeyStatusChange += (sender, e) => { CalculateStatus(); }; this.Client.Auto.OnAutoSpotStatusChange += (sender, e) => { CalculateStatus(); }; this.Client.Auto.OnAutoFollowStatusChange += (sender, e) => { CalculateStatus(); }; this.Client.Auto.OnAutoAssistStatusChange += (sender, e) => { CalculateStatus(); }; this.Client.Auto.OnVillaStatusChange += (sender, e) => { CalculateStatus(); }; //no anda por thread q no creó el objeto StartDrawStatus(); }
public AutoAssistForm(ClientForm parent, BLL.PWClient client) : base(parent, new PopUpCoords(client.dbConfig.AutoAssist.WinPinned, client.dbConfig.AutoAssist.WinShowAttachParent, client.dbConfig.AutoAssist.ScreenX, client.dbConfig.AutoAssist.ScreenY)) { InitializeComponent(); this.Client = client; this.lFollow.MouseWheel += (sender, e) => { this.Client.dbConfig.AutoAssist.FollowParty = e.Delta > 0 ? Values.GetPartysPost(this.Client.dbConfig.AutoAssist.FollowParty) : Values.GetPartysPrev(this.Client.dbConfig.AutoAssist.FollowParty); this.Client.dbConfig.PendingChanges = true; DoDrawControls(); }; this.lAssistPlayer.MouseWheel += (sender, e) => { this.Client.dbConfig.AutoAssist.AssistPJKey = e.Delta > 0 ? Values.GetPartysPost(this.Client.dbConfig.AutoAssist.AssistPJKey) : Values.GetPartysPrev(this.Client.dbConfig.AutoAssist.AssistPJKey); this.Client.dbConfig.PendingChanges = true; DoDrawControls(); }; this.lAssistKey.MouseWheel += (sender, e) => { this.Client.dbConfig.AutoAssist.AssistKey = e.Delta > 0 ? Values.GetAllKeyPost(this.Client.dbConfig.AutoAssist.AssistKey) : Values.GetAllKeyPrev(this.Client.dbConfig.AutoAssist.AssistKey); this.Client.dbConfig.PendingChanges = true; DoDrawControls(); }; this.lAssistTime.MouseWheel += (sender, e) => { this.Client.dbConfig.AutoAssist.AssistTime = e.Delta > 0 ? Values.GetTimesPost(this.Client.dbConfig.AutoAssist.AssistTime) : Values.GetTimesPrev(this.Client.dbConfig.AutoAssist.AssistTime); this.Client.dbConfig.PendingChanges = true; DoDrawControls(); }; this.lPickKey.MouseWheel += (sender, e) => { this.Client.dbConfig.AutoAssist.PickKey = e.Delta > 0 ? Values.GetAllKeyPost(this.Client.dbConfig.AutoAssist.PickKey, true) : Values.GetAllKeyPrev(this.Client.dbConfig.AutoAssist.PickKey, true); this.Client.dbConfig.PendingChanges = true; DoDrawControls(); }; this.lPickTime.MouseWheel += (sender, e) => { this.Client.dbConfig.AutoAssist.PickTime = e.Delta > 0 ? Values.GetTimesPost(this.Client.dbConfig.AutoAssist.PickTime) : Values.GetTimesPrev(this.Client.dbConfig.AutoAssist.PickTime); this.Client.dbConfig.PendingChanges = true; DoDrawControls(); }; DoDrawControls(); }
public ClientForm(BLL.PWClient client) { InitializeComponent(); // EVENTS this.Paint += (sender, e) => DoDraw(e.Graphics); this.Load += (sender, e) => { if (this.WinMovePosition != Point.Empty) { this.Location = this.WinMovePosition; } }; this.MouseWheel += ClientForm_MouseWheel; this.Click += ClientForm_Click; this.Activated += (sender, e) => { this.Location = new Point(this.Client.dbConfig.ScreenX, this.Client.dbConfig.ScreenY); }; this.Deactivate += (sender, e) => { HideAll(); }; this.tmrSave.Tick += (sender, e) => { this.Client.dbConfig.Save(this.Client.Manager.GetWindowRect()); }; this.DoubleClick += (sender, e) => { this.Client.Action.Global.Test(); }; // Windows Move this.MouseDown += (sender, e) => { WinMovePosition = new Point(Cursor.Position.X - Location.X, Cursor.Position.Y - Location.Y); WinMoveMover = true; }; this.MouseMove += (sender, e) => { if (WinMoveMover) { var x = Convert.ToInt32(Math.Round((Cursor.Position.X - WinMovePosition.X) / 20.0) * 20); var y = Convert.ToInt32(Math.Round((Cursor.Position.Y - WinMovePosition.Y) / 20.0) * 20); this.Location = new Point(x, y); OnCustomMove?.Invoke(this, this.Location); } }; this.MouseUp += (sender, e) => { WinMoveMover = false; this.Client.dbConfig.ScreenX = this.Location.X; this.Client.dbConfig.ScreenY = this.Location.Y; this.Client.dbConfig.PendingChanges = true; }; // Menu bLogin.Click += (sender, e) => { this.Client.Action.Global.DoLogin(); }; bClose.Click += (sender, e) => { this.Client.dbConfig.Save(this.Client.Manager.GetWindowRect()); this.Client.Dispose(); this.Close(); }; bCloseClient.Click += (sender, e) => { this.Client.dbConfig.Save(this.Client.Manager.GetWindowRect()); var mgr = this.Client.Manager; WinManager.RemoveClient(this.Client); this.Client.Dispose(); mgr.CloseApp(); this.Close(); }; bAntiFreeze.Click += (sender, e) => { this.Client.Config.AntiFreeze = !(this.Client.Config.AntiFreeze ?? true); }; bAutoKey.Click += (sender, e) => { this.Client.Auto.SetAutoKeyAll(!this.Client.Auto.IsAnyAutoKeyRunning); }; bAutoFollow.Click += (sender, e) => { this.Client.Auto.SetAutoFollow(!this.Client.Auto.IsAutoFollowRunning); }; bAutoSpot.Click += (sender, e) => { this.Client.Auto.SetAutoSpot(!this.Client.Auto.IsAutoSpotRunning); }; bAutoAssist.Click += (sender, e) => { this.Client.Auto.SetAutoAssist(!this.Client.Auto.IsAutoAssistRunning); }; bAutoVilla.Click += (sender, e) => { this.Client.Auto.SetVilla(!this.Client.Auto.IsVillaRunning); }; bStopAll.Click += (sender, e) => { this.Client.Auto.StopAll(); }; bPartyMenu.DropDownOpening += (sender, e) => RefreshPartyMenu(); bPartyCreateNew.Click += (sender, e) => BLL.ClientManager.CreateParty(this.Client); bShowWinChat.Click += (sender, e) => this.Client.dbConfig.HideWinChat = !this.Client.dbConfig.HideWinChat; bShowWins.DropDownOpening += (sender, e) => { bShowWinChat.Checked = !this.Client.dbConfig.HideWinChat; }; this.Client = client; // Menu - Key Events this.Client.Manager.OnKeyboard(Keys.F12, (sender, e) => { this.Client.Auto.StopAll(); }); this.Client.Manager.OnKeyboard(Keys.F9, (sender, e) => { this.Client.Auto.SetAutoFollow(!this.Client.Auto.IsAutoFollowRunning); }); this.Client.Manager.OnKeyboard(Keys.Control | Keys.S, (sender, e) => { this.Client.Auto.SetAutoSpot(!this.Client.Auto.IsAutoSpotRunning); }); this.Client.Manager.OnKeyboard(Keys.Control | Keys.A, (sender, e) => { this.Client.Auto.SetAutoAssist(!this.Client.Auto.IsAutoAssistRunning); }); this.Client.Manager.OnKeyboard(Keys.Control | Keys.K, (sender, e) => { this.Client.Auto.SetAutoKeyAll(!this.Client.Auto.IsAnyAutoKeyRunning); }); // Client events this.Client.Auto.OnAutoKeyStatusChange += (sender, e) => { bAutoKey.Checked = this.Client.Auto.IsAnyAutoKeyRunning; }; this.Client.Auto.OnAutoFollowStatusChange += (sender, e) => { bAutoFollow.Checked = e; }; this.Client.Auto.OnAutoSpotStatusChange += (sender, e) => { bAutoSpot.Checked = e; }; this.Client.Auto.OnAutoAssistStatusChange += (sender, e) => { bAutoAssist.Checked = e; }; this.Client.Auto.OnVillaStatusChange += (sender, e) => { this.Tools.MultiThreadSafe(this.Menu, () => { bAutoVilla.Checked = this.Client.Auto.IsVillaRunning; }); }; this.Tools = new Helper.FormTools(this, this.Client); this.AutoKeyForm = new AutoKeyForm(this, this.Client); this.AutoSpotForm = new AutoSpotForm(this, this.Client); this.AutoAssistForm = new AutoAssistForm(this, this.Client); this.ShowInfoForm = new ShowInfoForm(this, this.Client); LoadInitialValues(); }