public void BodyPartOnItemSelected(ItemListSelectedEventArgs args) { if (_parts.TryGetValue(_slots[args.ItemIndex], out _currentBodyPart)) { UpdateBodyPartBox(_currentBodyPart, _slots[args.ItemIndex]); } }
public void BodyPartOnItemSelected(ItemListSelectedEventArgs args) { if (IoCManager.Resolve <IEntityManager>().TryGetComponent <SharedBodyComponent>(_currentEntity, out var body)) { return; } var slot = body.SlotAt(args.ItemIndex); _currentBodyPart = body.PartAt(args.ItemIndex).Key; if (slot.Part != null) { UpdateBodyPartBox(slot.Part, slot.Id); } }
public void BodyPartOnItemSelected(ItemListSelectedEventArgs args) { var body = CurrentBody; if (body == null) { return; } var slot = body.SlotAt(args.ItemIndex).Key; _currentBodyPart = body.PartAt(args.ItemIndex).Value; if (body.Parts.TryGetValue(slot, out var part)) { UpdateBodyPartBox(part, slot); } }
public void BodyPartOnItemSelected(ItemListSelectedEventArgs args) { var body = CurrentBody; if (body == null) { return; } var slot = body.SlotAt(args.ItemIndex); _currentBodyPart = body.PartAt(args.ItemIndex).Key; if (slot.Part != null) { UpdateBodyPartBox(slot.Part, slot.Id); } }
// TODO BODY Guaranteed this is going to crash when a part's mechanisms change. This part is left as an exercise for the reader. public void MechanismOnItemSelected(ItemListSelectedEventArgs args) { UpdateMechanismBox(_currentBodyPart?.Mechanisms.ElementAt(args.ItemIndex)); }
public void MechanismOnItemSelected(ItemListSelectedEventArgs args) { UpdateMechanismBox(_currentBodyPart.Mechanisms[args.ItemIndex]); }