public static void Hotbar_MouseDown(MouseEventArgs e) { byte Slot = Hotbar_Overlapping(); // Somente se necessário if (Slot == 0) { return; } if (Player.Hotbar[Slot].Slot == 0) { return; } // Solta item if (e.Button == MouseButtons.Right) { Sending.Hotbar_Add(Slot, 0, 0); return; } // Seleciona o item else if (e.Button == MouseButtons.Left) { Player.Hotbar_Moving = Slot; return; } }
private void Window_MouseUp(object sender, MouseEventArgs e) { // Executa o evento de acordo a sobrePosition do ponteiro for (byte i = 0; i <= Tools.Ordem.GetUpperBound(0); i++) { switch (Tools.Ordem[i].Type) { case Tools.Types.Button: Buttons.Events.MouseUp(e, Tools.Ordem[i].Index); break; case Tools.Types.Marker: Markers.Events.MouseUp(e, Tools.Ordem[i].Index); break; case Tools.Types.Scanner: Scanners.Events.MouseUp(e, Tools.Ordem[i].Index); break; } } // Events em Jogo if (Tools.CurrentWindow == Tools.Windows.Jogo) { // Muda o slot do item if (Player.Inventory_Moving > 0) { if (Tools.Inventory_Overlapping() > 0) { Sending.Inventory_Change(Player.Inventory_Moving, Tools.Inventory_Overlapping()); } } // Muda o slot da hotbar if (Tools.Hotbar_Overlapping() > 0) { if (Player.Hotbar_Moving > 0) { Sending.Hotbar_Change(Player.Hotbar_Moving, Tools.Hotbar_Overlapping()); } if (Player.Inventory_Moving > 0) { Sending.Hotbar_Add(Tools.Hotbar_Overlapping(), (byte)Jogo.Hotbar.Item, Player.Inventory_Moving); } } // Reseta a Movement Player.Inventory_Moving = 0; Player.Hotbar_Moving = 0; } }