public void FilterCards(Entity mountedModule, ModuleBehaviourType slotType)
 {
     if (this.currentTankPartItem != null)
     {
         ModuleCardItemUIComponent[] componentsInChildren = base.GetComponentsInChildren <ModuleCardItemUIComponent>(true);
         bool flag = false;
         ModuleCardItemUIComponent[] componentArray2 = componentsInChildren;
         int index = 0;
         while (true)
         {
             if (index < componentArray2.Length)
             {
                 ModuleCardItemUIComponent component = componentArray2[index];
                 if (!component.gameObject.activeSelf || !component.GetComponent <ToggleListItemComponent>().Toggle.isOn)
                 {
                     index++;
                     continue;
                 }
                 flag = (component.Type == slotType) && (((component.TankPart != TankPartModuleType.WEAPON) || (this.currentTankPartItem.Type != TankPartItem.TankPartItemType.Turret)) ? ((component.TankPart == TankPartModuleType.TANK) && (this.currentTankPartItem.Type == TankPartItem.TankPartItemType.Hull)) : true);
             }
             foreach (ModuleCardItemUIComponent component2 in componentsInChildren)
             {
                 bool flag2 = ((component2.TankPart != TankPartModuleType.WEAPON) || (this.currentTankPartItem.Type != TankPartItem.TankPartItemType.Turret)) ? ((component2.TankPart == TankPartModuleType.TANK) && (this.currentTankPartItem.Type == TankPartItem.TankPartItemType.Hull)) : true;
                 component2.gameObject.SetActive(flag2);
                 if (flag2 && (((mountedModule != null) && ReferenceEquals(component2.ModuleEntity, mountedModule)) || ((mountedModule == null) && (!flag && (component2.Type == slotType)))))
                 {
                     component2.GetComponent <ToggleListItemComponent>().Toggle.isOn = true;
                     flag = true;
                 }
             }
             this.upgradeModuleTrigger.Triggered();
             return;
         }
     }
 }
 public void TurnOnSlotsByTypeAndHighlightForDrop(ModuleBehaviourType type)
 {
     if (type == ModuleBehaviourType.PASSIVE)
     {
         if (!this.passiveSlot.Locked)
         {
             this.TurnOnAndHighlight(this.passiveSlot);
         }
     }
     else
     {
         if (!this.activeSlot.Locked)
         {
             this.TurnOn(this.activeSlot);
             if (this.activeSlot2.Locked)
             {
                 this.activeSlot.HighlightForDrop();
             }
             else if (!this.activeSlot.HasItem() || (this.activeSlot.HasItem() && this.activeSlot2.HasItem()))
             {
                 this.activeSlot.HighlightForDrop();
             }
         }
         if (!this.activeSlot2.Locked)
         {
             this.TurnOn(this.activeSlot2);
             if (this.activeSlot.Locked)
             {
                 this.activeSlot2.HighlightForDrop();
             }
             else if (!this.activeSlot2.HasItem() || (this.activeSlot.HasItem() && this.activeSlot2.HasItem()))
             {
                 this.activeSlot2.HighlightForDrop();
             }
         }
     }
 }
 public TankSlotView GetSlotForDrop(ModuleBehaviourType type) =>
 (type != ModuleBehaviourType.PASSIVE) ? ((!this.activeSlot.Locked || !this.activeSlot2.Locked) ? (!this.activeSlot.Locked ? (!this.activeSlot2.Locked ? ((!this.activeSlot.HasItem() || !this.activeSlot2.HasItem()) ? (!this.activeSlot.HasItem() ? this.activeSlot : this.activeSlot2) : this.activeSlot) : this.activeSlot) : this.activeSlot2) : null) : (!this.passiveSlot.Locked ? this.passiveSlot : null);
Beispiel #4
0
 public string GetIconByType(ModuleBehaviourType moduleBehaviourType) =>
 this.slotSpriteUids[(int)moduleBehaviourType];