public void Refresh() { //make a list of all ship items in the hangar string stationID = GameManager.Inst.PlayerProgress.SpawnStationID; if (GameManager.Inst.WorldManager.DockableStationDatas.ContainsKey(stationID)) { _currentStationData = GameManager.Inst.WorldManager.DockableStationDatas[stationID]; if (_currentStationData.HomeStationData != null) { List <InvItemData> shipHangarItems = new List <InvItemData>(); foreach (Loadout loadout in _currentStationData.HomeStationData.ShipsInHangar) { shipHangarItems.Add(GetShipItemDataFromLoadout(loadout)); } HangarInventory.Initialize(shipHangarItems); HangarInventory.RefreshLoadButtons(); RefreshHangarSpace(_currentStationData.HomeStationData, shipHangarItems); } else { RefreshHangarSpace(null, null); } } //fill the current ship inventory List <InvItemData> dockedShipItems = new List <InvItemData>(); dockedShipItems.Add(GetShipItemDataFromLoadout(GameManager.Inst.PlayerProgress.ActiveLoadout)); DockedShipInventory.Initialize(dockedShipItems); }
public void RefreshLoadButtons(InvItemData relatedItem) { if (relatedItem != null && (relatedItem.Item.Type == ItemType.Weapon || relatedItem.Item.Type == ItemType.Defensives)) { Inventory.RelatedItem = relatedItem; } else { Inventory.RelatedItem = null; } Inventory.RefreshLoadButtons(); }
public void Refresh() { //make a list of all items trader is selling string stationID = GameManager.Inst.PlayerProgress.SpawnStationID; ClearSelections(); if (GameManager.Inst.WorldManager.DockableStationDatas.ContainsKey(stationID)) { _currentStationData = GameManager.Inst.WorldManager.DockableStationDatas[stationID]; ShipInventorySheet.InventoryItemTypes = _itemTypeFilter; if (_itemTypeFilter.Contains(ItemType.Ammo)) { ShipInventorySheet.InventoryType = InventoryType.AmmoBay; } else { ShipInventorySheet.InventoryType = InventoryType.CargoBay; } ShipInventorySheet.Refresh(); ShipInventorySheet.RefreshLoadButtons(null); if (_currentStationData != null && _currentStationData.TraderSaleItems != null) { List <InvItemData> displayedItems = new List <InvItemData>(); foreach (SaleItem saleItem in _currentStationData.TraderSaleItems) { ItemStats itemStats = GameManager.Inst.ItemManager.GetItemStats(saleItem.ItemID); Item item = new Item(itemStats); InvItemData invItem = new InvItemData(); invItem.Item = item; invItem.Quantity = saleItem.Quantity; if (_itemTypeFilter.Contains(itemStats.Type)) { displayedItems.Add(invItem); } } TraderInventory.Initialize(displayedItems); TraderInventory.RefreshLoadButtons(); } RefreshPrices(); RefreshPlayerMoney(); } }
public void Refresh() { //make a list of all items in the vault string stationID = GameManager.Inst.PlayerProgress.SpawnStationID; ClearSelections(); if (GameManager.Inst.WorldManager.DockableStationDatas.ContainsKey(stationID)) { _currentStationData = GameManager.Inst.WorldManager.DockableStationDatas[stationID]; ShipInventorySheet.InventoryItemTypes = _itemTypeFilter; if (_itemTypeFilter.Contains(ItemType.Ammo)) { ShipInventorySheet.InventoryType = InventoryType.AmmoBay; } else { ShipInventorySheet.InventoryType = InventoryType.CargoBay; } ShipInventorySheet.Refresh(); ShipInventorySheet.RefreshLoadButtons(null); if (_currentStationData.HomeStationData != null) { List <InvItemData> allVaultItems = _currentStationData.HomeStationData.ItemsInVault; List <InvItemData> displayedItems = new List <InvItemData>(); foreach (InvItemData item in allVaultItems) { if (_itemTypeFilter.Contains(item.Item.Type)) { displayedItems.Add(item); } } VaultInventory.Initialize(displayedItems); VaultInventory.RefreshLoadButtons(); RefreshVaultSpace(_currentStationData.HomeStationData, allVaultItems); } } }