protected virtual void OnComponentInit(EntityUid uid, PDAComponent pda, ComponentInit args) { if (pda.IdCard != null) { pda.IdSlot.StartingItem = pda.IdCard; } ItemSlotsSystem.AddItemSlot(uid, PDAComponent.PDAIdSlotId, pda.IdSlot); ItemSlotsSystem.AddItemSlot(uid, PDAComponent.PDAPenSlotId, pda.PenSlot); UpdatePDAAppearance(pda); }
private void OnComponentInit(EntityUid uid, PDAComponent pda, ComponentInit args) { var ui = pda.Owner.GetUIOrNull(PDAUiKey.Key); if (ui != null) { ui.OnReceiveMessage += (msg) => OnUIMessage(pda, msg); } if (pda.IdCard != null) { pda.IdSlot.StartingItem = pda.IdCard; } _itemSlotsSystem.AddItemSlot(uid, $"{pda.Name}-id", pda.IdSlot); _itemSlotsSystem.AddItemSlot(uid, $"{pda.Name}-pen", pda.PenSlot); }
private void OnCellSlotInit(EntityUid uid, PowerCellSlotComponent component, ComponentInit args) { _itemSlotsSystem.AddItemSlot(uid, "cellslot_cell_container", component.CellSlot); if (string.IsNullOrWhiteSpace(component.CellSlot.Name) && !string.IsNullOrWhiteSpace(component.SlotName)) { component.CellSlot.Name = component.SlotName; } if (component.StartEmpty) { return; } if (!string.IsNullOrWhiteSpace(component.CellSlot.StartingItem)) { return; } // set default starting cell based on cell-type component.CellSlot.StartingItem = component.SlotSize switch { PowerCellSize.Small => "PowerCellSmallStandard", PowerCellSize.Medium => "PowerCellMediumStandard", PowerCellSize.Large => "PowerCellLargeStandard", _ => throw new ArgumentOutOfRangeException() }; }
private void OnInit(EntityUid uid, NukeComponent component, ComponentInit args) { component.RemainingTime = component.Timer; _itemSlots.AddItemSlot(uid, component.Name, component.DiskSlot); UpdateStatus(uid, component); UpdateUserInterface(uid, component); }
private void OnCellSlotInit(EntityUid uid, PowerCellSlotComponent component, ComponentInit args) { _itemSlotsSystem.AddItemSlot(uid, CellSlotContainer, component.CellSlot); if (string.IsNullOrWhiteSpace(component.CellSlot.Name) && !string.IsNullOrWhiteSpace(component.SlotName)) { component.CellSlot.Name = component.SlotName; } }
private void OnComponentInit(EntityUid uid, PaperLabelComponent component, ComponentInit args) { _itemSlotsSystem.AddItemSlot(uid, component.Name, component.LabelSlot); if (!EntityManager.TryGetComponent(uid, out AppearanceComponent appearance)) { return; } appearance.SetData(PaperLabelVisuals.HasLabel, false); }
private void OnComponentInit(EntityUid uid, SharedIdCardConsoleComponent component, ComponentInit args) { _itemSlotsSystem.AddItemSlot(uid, $"{component.Name}-privilegedId", component.PrivilegedIdSlot); _itemSlotsSystem.AddItemSlot(uid, $"{component.Name}-targetId", component.TargetIdSlot); }
private void OnComponentInit(EntityUid uid, ItemCabinetComponent cabinet, ComponentInit args) { _itemSlotsSystem.AddItemSlot(uid, cabinet.Name, cabinet.CabinetSlot); }
private void OnComponentInit(EntityUid uid, SharedChemMasterComponent component, ComponentInit args) { _itemSlotsSystem.AddItemSlot(uid, $"{component.Name}-beaker", component.BeakerSlot); }
private void OnComponentInit(EntityUid uid, ChemicalPayloadComponent payload, ComponentInit args) { _itemSlotsSystem.AddItemSlot(uid, "BeakerSlotA", payload.BeakerSlotA); _itemSlotsSystem.AddItemSlot(uid, "BeakerSlotB", payload.BeakerSlotB); }
private void OnComponentInit(EntityUid uid, SharedReagentDispenserComponent component, ComponentInit args) { _itemSlotsSystem.AddItemSlot(uid, SharedReagentDispenserComponent.BeakerSlotId, component.BeakerSlot); }
private void OnChargerInit(EntityUid uid, ChargerComponent component, ComponentInit args) { _itemSlotsSystem.AddItemSlot(uid, "charger-slot", component.ChargerSlot); }