void Grab_MouseDown(GrabType t, object sender, MouseEventArgs e) { HookManager.MouseUp += HookManager_MouseUp; HookManager.MouseMove += HookManager_MouseMove; this.grabbing = t; Cursor.Current = Cursors.NoMove2D; GrabMinion1.Refresh(); GrabMinion2.Refresh(); GrabMinion3.Refresh(); GrabMinion4.Refresh(); GrabMinion5.Refresh(); GrabMinion6.Refresh(); GrabMinion7.Refresh(); GrabMinion8.Refresh(); GrabSend.Refresh(); GrabAdventure.Refresh(); GrabClaim.Refresh(); }
void HookManager_MouseUp(object sender, MouseEventArgs e) { HookManager.MouseUp -= HookManager_MouseUp; HookManager.MouseMove -= HookManager_MouseMove; Cursor.Current = Cursors.Default; if (grabLocations.ContainsKey(grabbing) == false) { grabLocations.Add(grabbing, new Point()); } grabLocations[grabbing] = new Point(e.X, e.Y); this.grabbing = GrabType.none; GrabMinion1.Refresh(); GrabMinion2.Refresh(); GrabMinion3.Refresh(); GrabMinion4.Refresh(); GrabMinion5.Refresh(); GrabMinion6.Refresh(); GrabMinion7.Refresh(); GrabMinion8.Refresh(); GrabSend.Refresh(); GrabAdventure.Refresh(); GrabClaim.Refresh(); }