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); } }
private void IdleAddEquipment_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)) { 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.IdleEquipment.Contains(newEquipment)) { HudList.HudListRowAccessor row = IdleEquipmentList.AddRow(); using (HudStaticText control = new HudStaticText()) { control.Text = item.Name; row[0] = control; } Parent.Machine.Utility.EquipmentSettings.IdleEquipment.Add(newEquipment); Parent.Machine.Utility.SaveEquipmentSettings(); } else { Debug.ToChat("This item is already in the idle suit."); } break; } } } else { Debug.ToChat("Make sure you are selecting an item in your own inventory."); } } 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); } }