예제 #1
0
        private void LoadSuits()
        {
            try
            {
                foreach (Equipment item in Parent.Machine.Utility.EquipmentSettings.IdleEquipment)
                {
                    HudList.HudListRowAccessor row = IdleEquipmentList.AddRow();
                    using (HudStaticText newItem = new HudStaticText())
                    {
                        newItem.Text = item.Name;
                        row[0]       = newItem;
                    }
                }

                foreach (Equipment item in Parent.Machine.Utility.EquipmentSettings.BuffingEquipment)
                {
                    HudList.HudListRowAccessor row = BuffEquipmentList.AddRow();
                    using (HudStaticText newItem = new HudStaticText())
                    {
                        newItem.Text = item.Name;
                        row[0]       = newItem;
                    }
                }
            }
            catch (Exception ex) { Debug.LogException(ex); }
        }
예제 #2
0
        private void BuffAddEquipment_Hit(object sender, EventArgs e)
        {
            try
            {
                if (Parent.Machine.FinishedInitialScan)
                {
                    if (Parent.Machine.Core.CharacterFilter.Name.Equals(Parent.Machine.BuffingCharacter))
                    {
                        if (!Parent.Machine.Core.Actions.CurrentSelection.Equals(0) && Parent.Machine.Core.CharacterFilter.Name.Equals(Parent.Machine.BuffingCharacter))
                        {
                            foreach (WorldObject item in Parent.Machine.CharacterEquipment)
                            {
                                if (item.Id.Equals(Parent.Machine.Core.Actions.CurrentSelection))
                                {
                                    Equipment newEquipment = new Equipment
                                    {
                                        Id          = item.Id,
                                        Name        = item.Name,
                                        EquipMask   = item.Values(LongValueKey.EquipableSlots),
                                        ObjectClass = item.ObjectClass.ToString()
                                    };

                                    if (!Parent.Machine.Utility.EquipmentSettings.BuffingEquipment.Contains(newEquipment))
                                    {
                                        HudList.HudListRowAccessor row = BuffEquipmentList.AddRow();
                                        using (HudStaticText control = new HudStaticText())
                                        {
                                            control.Text = item.Name;
                                            row[0]       = control;
                                        }

                                        Parent.Machine.Utility.EquipmentSettings.BuffingEquipment.Add(newEquipment);
                                        Parent.Machine.Utility.SaveEquipmentSettings();
                                    }
                                    else
                                    {
                                        Debug.ToChat("This item is already in the buffing suit.");
                                    }

                                    break;
                                }
                            }
                        }
                        else
                        {
                            Debug.ToChat("Make sure you have an item selected.");
                        }
                    }
                    else
                    {
                        Debug.ToChat("You must set the buffing character to this character, or be logged into the buffing character to add equipment.");
                    }
                }
                else
                {
                    Debug.ToChat("Please wait until finished scanning your inventory.");
                }
            }
            catch (Exception ex) { Debug.LogException(ex); }
        }
예제 #3
0
 private void BuffEquipmentList_Click(object sender, int row, int col)
 {
     try
     {
         using (HudStaticText equipmentToDelete = (HudStaticText)BuffEquipmentList[row][0])
         {
             BuffEquipmentList.RemoveRow(row);
             foreach (Equipment item in Parent.Machine.Utility.EquipmentSettings.BuffingEquipment)
             {
                 if (item.Name.Equals(equipmentToDelete.Text))
                 {
                     Parent.Machine.Utility.EquipmentSettings.BuffingEquipment.Remove(item);
                     break;
                 }
             }
         }
         Parent.Machine.Utility.SaveEquipmentSettings();
     }
     catch (Exception ex) { Debug.LogException(ex); }
 }