Example #1
0
 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);
 }
Example #2
0
        public void CancelHighlightForDrop()
        {
            this.dropInnerGlow.gameObject.SetActive(false);
            this.dropOuterGlow.gameObject.SetActive(false);
            SlotItemView item = this.GetItem();

            if (item != null)
            {
                item.HighlightEnable = true;
            }
        }
Example #3
0
        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);
            }
        }
Example #4
0
 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);
         }
     }
 }
Example #5
0
 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]);
         }
     }
 }
Example #6
0
 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);
         }
     }
 }
Example #7
0
 private void OnItemClick(SlotItemView slotItem)
 {
     this.Select(slotItem);
 }
Example #8
0
        private void OnAnyItemDragStart(DragAndDropItem item, PointerEventData eventData)
        {
            SlotItemView component = item.GetComponent <SlotItemView>();

            this.Select(component);
        }
Example #9
0
 public void AddSlotItem(ModuleItem moduleItem, SlotItemView slotItemView)
 {
     slots[moduleItem].SetItem(slotItemView);
 }