public InventoryItemDialog() { //Load up the static item managers if (m_physicalItemsManager == null) { m_physicalItemsManager = new PhysicalItemDefinitionsManager(); m_physicalItemsManager.Load(PhysicalItemDefinitionsManager.GetContentDataFile("PhysicalItems.sbc")); } if (m_componentsManager == null) { m_componentsManager = new ComponentDefinitionsManager(); m_componentsManager.Load(ComponentDefinitionsManager.GetContentDataFile("Components.sbc")); } if (m_ammoManager == null) { m_ammoManager = new AmmoMagazinesDefinitionsManager(); m_ammoManager.Load(AmmoMagazinesDefinitionsManager.GetContentDataFile("AmmoMagazines.sbc")); } //Populate the static list with the ids from the items if (m_idList == null) { m_idList = new List <SerializableDefinitionId>(); foreach (var def in m_physicalItemsManager.Definitions) { m_idList.Add(def.Id); } foreach (var def in m_componentsManager.Definitions) { m_idList.Add(def.Id); } foreach (var def in m_ammoManager.Definitions) { m_idList.Add(def.Id); } } InitializeComponent(); CMB_ItemType.BeginUpdate(); foreach (var entry in m_idList) { CMB_ItemType.Items.Add(entry); } CMB_ItemType.EndUpdate(); TXT_ItemAmount.Text = "0.0"; }
public InventoryItemEntity(MyObjectBuilder_InventoryItem definition, Object backingObject) : base(definition, backingObject) { if (m_physicalItemsManager == null) { m_physicalItemsManager = new PhysicalItemDefinitionsManager(); m_physicalItemsManager.Load(PhysicalItemDefinitionsManager.GetContentDataFile("PhysicalItems.sbc")); } if (m_componentsManager == null) { m_componentsManager = new ComponentDefinitionsManager(); m_componentsManager.Load(ComponentDefinitionsManager.GetContentDataFile("Components.sbc")); } if (m_ammoManager == null) { m_ammoManager = new AmmoMagazinesDefinitionsManager(); m_ammoManager.Load(AmmoMagazinesDefinitionsManager.GetContentDataFile("AmmoMagazines.sbc")); } FindMatchingItem(); }
public ItemSerializableDefinitionIdTypeConverter() { //Load up the static item managers if (m_physicalItemsManager == null) { m_physicalItemsManager = new PhysicalItemDefinitionsManager(); m_physicalItemsManager.Load(PhysicalItemDefinitionsManager.GetContentDataFile("PhysicalItems.sbc")); } if (m_componentsManager == null) { m_componentsManager = new ComponentDefinitionsManager(); m_componentsManager.Load(ComponentDefinitionsManager.GetContentDataFile("Components.sbc")); } if (m_ammoManager == null) { m_ammoManager = new AmmoMagazinesDefinitionsManager(); m_ammoManager.Load(AmmoMagazinesDefinitionsManager.GetContentDataFile("AmmoMagazines.sbc")); } //Populate the static list with the ids from the items if (m_idList == null) { m_idList = new List <SerializableDefinitionId>(); foreach (var def in m_physicalItemsManager.Definitions) { m_idList.Add(def.Id); } foreach (var def in m_componentsManager.Definitions) { m_idList.Add(def.Id); } foreach (var def in m_ammoManager.Definitions) { m_idList.Add(def.Id); } } }