public override void OnItemSelect(InventoryItemEntry itemEntry, InventoryView container) { _selectedItem = itemEntry.ItemData; _selectedItemContainer = container; _selectedItemIndex = itemEntry.InventoryIndex; EquipmentInventory.DeselectAll(); CargoEquipmentInventory.DeselectAll(); ShipModsInventory.DeselectAll(); ActionSheet.SetItemTitle(itemEntry.ItemData.Item.DisplayName); //build description with item description and attributes ActionSheet.SetItemDesc(itemEntry.ItemData.Item.Description); ActionSheet.SetItemSubnote("", ""); ActionSheet.ListItemAttributes(itemEntry.ItemData.Item); if (container == EquipmentInventory) { InstallButton.isEnabled = false; RemoveButton.isEnabled = true; } else if (container == CargoEquipmentInventory) { InstallButton.isEnabled = true; RemoveButton.isEnabled = false; } else if (container == ShipModsInventory) { InstallButton.isEnabled = false; RemoveButton.isEnabled = true; } }
public override void OnItemSelect(InventoryItemEntry itemEntry, InventoryView container) { if (itemEntry != null) { _selectedItemContainer = container; _selectedItemEntry = itemEntry; ActionSheet.SetItemTitle(itemEntry.ItemData.Item.DisplayName); //build description with item description and attributes ActionSheet.SetItemDesc(itemEntry.ItemData.Item.Description); ActionSheet.ListItemAttributes(itemEntry.ItemData.Item); ActionSheet.SetItemSubnote("", ""); TraderInventory.DeselectAll(); CargoAmmoInventory.DeselectAll(); if (container == TraderInventory) { SellButton.isEnabled = false; BuyButton.isEnabled = true; } else if (container == CargoAmmoInventory) { SellButton.isEnabled = true; BuyButton.isEnabled = false; } if (_selectedItemEntry.ItemData.Item.Type == ItemType.Ammo || _selectedItemEntry.ItemData.Item.Type == ItemType.Commodity) { QuantitySlider.alpha = 1; NGUITools.SetActive(QuantitySlider.gameObject, true); QuantitySlider.value = 0; _selectedQuantity = 1; QuantityLabel.text = "1"; TotalPriceValue.alpha = 1; TotalPriceValue.text = "$" + Mathf.CeilToInt(_selectedItemEntry.Price * _selectedQuantity).ToString("#,#"); } else if (_selectedItemEntry.ItemData.Quantity > 1) { QuantitySlider.alpha = 1; NGUITools.SetActive(QuantitySlider.gameObject, true); QuantitySlider.value = 1; _selectedQuantity = _selectedItemEntry.ItemData.Quantity; QuantityLabel.text = _selectedItemEntry.ItemData.Quantity.ToString(); TotalPriceValue.alpha = 1; TotalPriceValue.text = "$" + Mathf.CeilToInt(_selectedItemEntry.Price * _selectedQuantity).ToString("#,#"); } else { QuantitySlider.alpha = 0; _selectedQuantity = 1; NGUITools.SetActive(QuantitySlider.gameObject, false); TotalPriceValue.alpha = 1; TotalPriceValue.text = "$" + Mathf.CeilToInt(_selectedItemEntry.Price).ToString("#,#"); } } }
public override void OnItemSelect(InventoryItemEntry itemEntry, InventoryView container) { if (itemEntry != null) { _selectedItemContainer = container; _selectedItem = itemEntry.ItemData; ActionSheet.SetItemTitle(itemEntry.ItemData.Item.DisplayName); //build description with item description and attributes ActionSheet.SetItemDesc(itemEntry.ItemData.Item.Description); ActionSheet.ListItemAttributes(itemEntry.ItemData.Item); ActionSheet.SetItemSubnote("", ""); VaultInventory.DeselectAll(); CargoAmmoInventory.DeselectAll(); if (container == VaultInventory) { StoreButton.isEnabled = false; RetrieveButton.isEnabled = true; } else if (container == CargoAmmoInventory && _currentStationData.HomeStationData != null && _currentStationData.HomeStationData.VaultSize > 0) { StoreButton.isEnabled = true; RetrieveButton.isEnabled = false; } if (_selectedItem.Quantity > 1) { QuantitySlider.alpha = 1; NGUITools.SetActive(QuantitySlider.gameObject, true); QuantitySlider.value = 1; _selectedQuantity = _selectedItem.Quantity; QuantityLabel.text = _selectedItem.Quantity.ToString(); } else { QuantitySlider.alpha = 0; _selectedQuantity = 1; NGUITools.SetActive(QuantitySlider.gameObject, false); } } }
public override void OnItemSelect(InventoryItemEntry itemEntry, InventoryView container) { DockedShipInventory.DeselectAll(); HangarInventory.DeselectAll(); _selectedEntry = itemEntry; Loadout selectedLoadout = null; //check if item is active loadout if (itemEntry.ItemData.Item.Description == GameManager.Inst.PlayerProgress.ActiveLoadout.LoadoutID) { selectedLoadout = GameManager.Inst.PlayerProgress.ActiveLoadout; } else { //check if item is in hangar selectedLoadout = FindLoadoutInHangar(itemEntry.ItemData.Item.Description); } ShipInfoSheet.CurrentLoadout = selectedLoadout; ShipInfoSheet.Refresh(); ShipDataSheet.CurrentLoadout = selectedLoadout; ShipDataSheet.Refresh(); }
public override void OnItemSelect(InventoryItemEntry itemEntry, InventoryView container) { _selectedItemContainer = container; ActionSheet.SetItemTitle(itemEntry.ItemData.Item.DisplayName); //build description with item description and attributes ActionSheet.SetItemDesc(itemEntry.ItemData.Item.Description); ActionSheet.ListItemAttributes(itemEntry.ItemData.Item); string loadedAmmoID = itemEntry.ItemData.RelatedItemID; if (!string.IsNullOrEmpty(loadedAmmoID)) { string ammoName = GameManager.Inst.ItemManager.GetItemStats(loadedAmmoID).DisplayName; ActionSheet.SetItemSubnote("Current Load", ammoName); } else if (!string.IsNullOrEmpty(itemEntry.ItemData.Item.GetStringAttribute("Ammo Type")) && (itemEntry.ItemData.Item.Type == ItemType.Weapon || itemEntry.ItemData.Item.Type == ItemType.Defensives)) { ActionSheet.SetItemSubnote("Current Load", "NONE"); } else { ActionSheet.SetItemSubnote("", ""); } if (container == WeaponInventory || container == DefensivesInventory || itemEntry.ItemData.Item.Type == ItemType.Weapon || itemEntry.ItemData.Item.Type == ItemType.Defensives) { _selectedWeaponItem = itemEntry.ItemData; } else if (container == CargoAmmoInventory) { _selectedWeaponItem = itemEntry.ItemData; } _selectedItemEntry = itemEntry; WeaponInventory.DeselectAll(); DefensivesInventory.DeselectAll(); CargoAmmoInventory.DeselectAll(); if (container == WeaponInventory || container == DefensivesInventory) { InstallButton.isEnabled = false; RemoveButton.isEnabled = true; } else if (container == CargoAmmoInventory) { if (itemEntry.ItemData.Item.Type == ItemType.Weapon || itemEntry.ItemData.Item.Type == ItemType.Defensives) { InstallButton.isEnabled = true; RemoveButton.isEnabled = false; } else if (itemEntry.ItemData.Item.Type == ItemType.Ammo) { InstallButton.isEnabled = false; RemoveButton.isEnabled = false; } } ShipInventorySheet.RefreshLoadButtons(_selectedWeaponItem); }