Exemplo n.º 1
0
        private static void ShowBuyGump(string[] param)
        {
            if (string.IsNullOrEmpty(param[0]))
            {
                World.Player.SendMessage(MsgLevel.Error, "You must include an id or alias");
                return;
            }

            if (int.TryParse(param[0], out int agentIndex))
            {
                BuyAgent agent = BuyAgent.Agents[agentIndex - 1];

                AgentsGump gump = new AgentsGump(agent);
                gump.SendGump();
            }
            else
            {
                foreach (BuyAgent agent in BuyAgent.Agents)
                {
                    if (agent.Alias.Equals(param[0], StringComparison.OrdinalIgnoreCase))
                    {
                        AgentsGump gump = new AgentsGump(agent);
                        gump.SendGump();

                        break;
                    }
                }
            }
        }
Exemplo n.º 2
0
        private void GridView_DragDrop(object sender, DragEventArgs e)
        {
            DataGridView grid        = (DataGridView)sender;
            Point        clientPoint = grid.PointToClient(new Point(e.X, e.Y));

            rowIndexOfItemUnderMouseToDrop = grid.HitTest(clientPoint.X, clientPoint.Y).RowIndex;

            if (rowIndexOfItemUnderMouseToDrop == -1)
            {
                return;
            }

            if (e.Effect == DragDropEffects.Move)
            {
                DataGridViewRow rowToMove = e.Data.GetData(typeof(DataGridViewRow)) as DataGridViewRow;

                if (rowIndexOfItemUnderMouseToDrop >= (grid.RowCount - 1))                 // Blocca il drag fuori dalle celle salvate
                {
                    return;
                }

                if (rowIndexFromMouseDown >= (grid.RowCount - 1))                 // Blocca il drag di una cella non salvata
                {
                    return;
                }

                grid.Rows.RemoveAt(rowIndexFromMouseDown);
                grid.Rows.Insert(rowIndexOfItemUnderMouseToDrop, rowToMove);
                switch (grid.Name)
                {
                case "autolootdataGridView":
                    AutoLoot.CopyTable();
                    break;

                case "scavengerdataGridView":
                    Scavenger.CopyTable();
                    break;

                case "organizerdataGridView":
                    Organizer.CopyTable();
                    break;

                case "vendorbuydataGridView":
                    BuyAgent.CopyTable();
                    break;

                case "vendorsellGridView":
                    SellAgent.CopyTable();
                    break;

                case "restockdataGridView":
                    Restock.CopyTable();
                    break;

                case "graphfilterdatagrid":
                    RazorEnhanced.Filters.CopyGraphTable();
                    break;
                }
            }
        }
Exemplo n.º 3
0
        private void buyListSelect_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (buyListSelect.Text != String.Empty)
            {
                BuyAgent.BuyListName = buyListSelect.Text;

                if (buyListSelect.Focused)
                {
                    Settings.BuyAgent.ListUpdate(buyListSelect.Text, true);
                    BuyAgent.AddLog("Buy Agent list changed to: " + buyListSelect.Text);
                }
            }

            RazorEnhanced.BuyAgent.InitGrid();
        }
Exemplo n.º 4
0
        private void GridView_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {
            DataGridView grid = (DataGridView)sender;

            if (!grid.Focused)
            {
                return;
            }

            if (e.ColumnIndex == 0)             // Checkbox cambiate di stato genera save
            {
                switch (grid.Name)
                {
                case "autolootdataGridView":
                    AutoLoot.CopyTable();
                    break;

                case "scavengerdataGridView":
                    Scavenger.CopyTable();
                    break;

                case "organizerdataGridView":
                    Organizer.CopyTable();
                    break;

                case "vendorbuydataGridView":
                    BuyAgent.CopyTable();
                    break;

                case "vendorsellGridView":
                    SellAgent.CopyTable();
                    break;

                case "restockdataGridView":
                    Restock.CopyTable();
                    break;

                case "graphfilterdatagrid":
                    RazorEnhanced.Filters.CopyGraphTable();
                    break;

                case "journalfilterdatagrid":
                    RazorEnhanced.Filters.CopyJournalFilterTable();
                    break;
                }
            }
        }
Exemplo n.º 5
0
        private void buyEnableCheckB_CheckedChanged(object sender, EventArgs e)
        {
            if (World.Player == null)              // offline
            {
                buyEnableCheckBox.Checked = false;
                BuyAgent.AddLog("You are not logged in game!");
                return;
            }

            if (buyListSelect.Text == String.Empty)             // Nessuna lista
            {
                buyEnableCheckBox.Checked = false;
                BuyAgent.AddLog("Item list not selected!");
                return;
            }

            if (buyEnableCheckBox.Checked)
            {
                buyListSelect.Enabled       = false;
                buyAddListButton.Enabled    = false;
                buyRemoveListButton.Enabled = false;
                buyImportListButton.Enabled = false;
                buyExportListButton.Enabled = false;
                buyCloneButton.Enabled      = false;
                BuyAgent.AddLog("Apply item list " + buyListSelect.SelectedItem.ToString() + " filter ok!");
                if (showagentmessageCheckBox.Checked)
                {
                    Misc.SendMessage("Apply item list " + buyListSelect.SelectedItem.ToString() + " filter ok!", false);
                }
                BuyAgent.EnableBuyFilter();
            }
            else
            {
                buyListSelect.Enabled       = true;
                buyAddListButton.Enabled    = true;
                buyRemoveListButton.Enabled = true;
                buyImportListButton.Enabled = true;
                buyExportListButton.Enabled = true;
                buyCloneButton.Enabled      = true;
                BuyAgent.AddLog("Remove item list " + buyListSelect.SelectedItem.ToString() + " filter ok!");
                if (showagentmessageCheckBox.Checked)
                {
                    Misc.SendMessage("Remove item list " + buyListSelect.SelectedItem.ToString() + " filter ok!", false);
                }
            }
        }
Exemplo n.º 6
0
 private void BuyAgentItemTarget_Callback(bool loc, Assistant.Serial serial, Assistant.Point3D pt, ushort itemid)
 {
     Assistant.Item buyItem = Assistant.World.FindItem(serial);
     if (buyItem != null && buyItem.Serial.IsItem)
     {
         if (showagentmessageCheckBox.Checked)
         {
             Misc.SendMessage("Buy Agent item added: " + buyItem.ToString(), false);
         }
         BuyAgent.AddLog("Buy Agent item added: " + buyItem.ToString());
         this.Invoke((MethodInvoker) delegate { RazorEnhanced.BuyAgent.AddItemToList(buyItem.Name, buyItem.ItemID, 999, buyItem.Hue); });
     }
     else
     {
         if (showagentmessageCheckBox.Checked)
         {
             Misc.SendMessage("Invalid target", false);
         }
         BuyAgent.AddLog("Invalid target");
     }
 }
Exemplo n.º 7
0
        private void EnhancedAgentAddList_Click(object sender, EventArgs e)
        {
            bool   fail    = false;
            string newList = "";

            if (AgentListToAdd.Text == "")
            {
                fail = true;
            }

            if (!Regex.IsMatch(AgentListToAdd.Text, "^[a-zA-Z0-9_]+$"))
            {
                fail = true;
            }

            newList = AgentListToAdd.Text.ToLower();

            switch (m_agentid)
            {
            case 1:
                if (Settings.AutoLoot.ListExists(newList))
                {
                    fail = true;
                }
                break;

            case 2:
                if (Settings.Scavenger.ListExists(newList))
                {
                    fail = true;
                }
                break;

            case 3:
                if (Settings.Organizer.ListExists(newList))
                {
                    fail = true;
                }
                break;

            case 4:
                if (Settings.BuyAgent.ListExists(newList))
                {
                    fail = true;
                }
                break;

            case 5:
                if (Settings.SellAgent.ListExists(newList))
                {
                    fail = true;
                }
                break;

            case 6:
                if (Settings.Dress.ListExists(newList))
                {
                    fail = true;
                }
                break;

            case 7:
                if (Settings.Friend.ListExists(newList))
                {
                    fail = true;
                }
                break;

            case 8:
                if (Settings.Restock.ListExists(newList))
                {
                    fail = true;
                }
                break;

            case 9:
                if (RazorEnhanced.Shard.Exists(newList))
                {
                    fail = true;
                }
                break;
            }


            if (fail)
            {
                MessageBox.Show("Invalid list name!",
                                "Invalid list name!",
                                MessageBoxButtons.OK,
                                MessageBoxIcon.Exclamation,
                                MessageBoxDefaultButton.Button1);
                fail = true;
            }
            else
            {
                switch (m_agentid)
                {
                case 1:
                    AutoLoot.AddList(newList);
                    break;

                case 2:
                    Scavenger.AddList(newList);
                    break;

                case 3:
                    Organizer.AddList(newList);
                    break;

                case 4:
                    BuyAgent.AddList(newList);
                    break;

                case 5:
                    SellAgent.AddList(newList);
                    break;

                case 6:
                    Dress.AddList(newList);
                    HotKey.Init();
                    break;

                case 7:
                    Friend.AddList(newList);
                    break;

                case 8:
                    Restock.AddList(newList);
                    break;

                case 9:
                    RazorEnhanced.Shard.Insert(newList, "Not set", "Not Set", "0.0.0.0", "0", false, false);
                    break;
                }

                Close();
            }
        }