public override void SetItem(SlotItemView item) { if (!item.ModuleItem.Slot.Equals(this.SlotNode.Entity)) { throw new ArgumentException($"Screen slot entity {this.SlotNode.Entity.Id} doesn't match module item slot entity {item.ModuleItem.Slot.Id}"); } base.SetItem(item); }
public void CancelHighlightForDrop() { this.dropInnerGlow.gameObject.SetActive(false); this.dropOuterGlow.gameObject.SetActive(false); SlotItemView item = this.GetItem(); if (item != null) { item.HighlightEnable = true; } }
private void AddItemToTankCollection(ModuleItem moduleItem, SlotItemView slotItemView) { TankPartCollectionView tankPartCollection = this.GetTankPartCollection(moduleItem); if (moduleItem.ModuleBehaviourType == ModuleBehaviourType.PASSIVE) { tankPartCollection.passiveSlot.SetItem(slotItemView); } else if (tankPartCollection.activeSlot.SlotNode.Entity.Equals(moduleItem.Slot)) { tankPartCollection.activeSlot.SetItem(slotItemView); } else { tankPartCollection.activeSlot2.SetItem(slotItemView); } }
public void Select(SlotItemView slotItem) { if (this.selectedSlotItem != slotItem) { if (this.selectedSlot != null) { this.selectedSlot.Deselect(); this.selectedSlot = null; } if (this.selectedSlotItem != null) { this.selectedSlotItem.Deselect(); } slotItem.Select(); this.selectedSlotItem = slotItem; if (this.onSelectionChange != null) { this.onSelectionChange(slotItem.ModuleItem); } } }
public void Select(CollectionSlotView slot) { if (this.selectedSlot != slot) { if (this.selectedSlotItem != null) { this.selectedSlotItem.Deselect(); this.selectedSlotItem = null; } if (this.selectedSlot != null) { this.selectedSlot.Deselect(); } slot.Select(); this.selectedSlot = slot; if (this.onSelectionChange != null) { this.onSelectionChange(slotToModuleItem[this.selectedSlot]); } } }
public void Clear() { if (this.selectedSlot != null) { this.selectedSlot.Deselect(); this.selectedSlot = null; if (this.onSelectionChange != null) { this.onSelectionChange(null); } } else if (this.selectedSlotItem != null) { this.selectedSlotItem.Deselect(); this.selectedSlotItem = null; if (this.onSelectionChange != null) { this.onSelectionChange(null); } } }
private void OnItemClick(SlotItemView slotItem) { this.Select(slotItem); }
private void OnAnyItemDragStart(DragAndDropItem item, PointerEventData eventData) { SlotItemView component = item.GetComponent <SlotItemView>(); this.Select(component); }
public void AddSlotItem(ModuleItem moduleItem, SlotItemView slotItemView) { slots[moduleItem].SetItem(slotItemView); }