예제 #1
0
    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;
        }
    }