Exemplo n.º 1
0
        // Token: 0x06000D28 RID: 3368 RVA: 0x00041900 File Offset: 0x0003FB00
        private void SetEquipmentDisplay(EquipmentIndex newEquipmentIndex)
        {
            if (newEquipmentIndex == this.currentEquipmentDisplayIndex)
            {
                return;
            }
            for (int i = this.parentedPrefabDisplays.Count - 1; i >= 0; i--)
            {
                if (this.parentedPrefabDisplays[i].equipmentIndex != EquipmentIndex.None)
                {
                    this.parentedPrefabDisplays[i].Undo();
                    this.parentedPrefabDisplays.RemoveAt(i);
                }
            }
            for (int j = this.limbMaskDisplays.Count - 1; j >= 0; j--)
            {
                if (this.limbMaskDisplays[j].equipmentIndex != EquipmentIndex.None)
                {
                    this.limbMaskDisplays[j].Undo(this);
                    this.limbMaskDisplays.RemoveAt(j);
                }
            }
            this.currentEquipmentDisplayIndex = newEquipmentIndex;
            DisplayRuleGroup equipmentDisplayRuleGroup = this.itemDisplayRuleSet.GetEquipmentDisplayRuleGroup(newEquipmentIndex);

            this.InstantiateDisplayRuleGroup(equipmentDisplayRuleGroup, ItemIndex.None, newEquipmentIndex);
        }
 // Token: 0x06000AAA RID: 2730 RVA: 0x00034C2A File Offset: 0x00032E2A
 public void SetEquipmentDisplayRuleGroup(EquipmentIndex equipmentIndex, DisplayRuleGroup displayRuleGroup)
 {
     if (equipmentIndex < EquipmentIndex.CommandMissile || equipmentIndex >= (EquipmentIndex)this.equipmentRuleGroups.Length)
     {
         return;
     }
     this.equipmentRuleGroups[(int)equipmentIndex] = displayRuleGroup;
 }
 // Token: 0x06000AA8 RID: 2728 RVA: 0x00034BCE File Offset: 0x00032DCE
 public void SetItemDisplayRuleGroup(ItemIndex itemIndex, DisplayRuleGroup displayRuleGroup)
 {
     if (itemIndex < ItemIndex.Syringe || itemIndex >= (ItemIndex)this.itemRuleGroups.Length)
     {
         return;
     }
     this.itemRuleGroups[(int)itemIndex] = displayRuleGroup;
 }
Exemplo n.º 4
0
        // Token: 0x06000D29 RID: 3369 RVA: 0x000419D0 File Offset: 0x0003FBD0
        private void EnableItemDisplay(ItemIndex itemIndex)
        {
            if (this.enabledItemDisplays[(int)itemIndex])
            {
                return;
            }
            this.enabledItemDisplays[(int)itemIndex] = true;
            DisplayRuleGroup itemDisplayRuleGroup = this.itemDisplayRuleSet.GetItemDisplayRuleGroup(itemIndex);

            this.InstantiateDisplayRuleGroup(itemDisplayRuleGroup, itemIndex, EquipmentIndex.None);
        }
Exemplo n.º 5
0
 private static void CrownsOnYellow(On.RoR2.CharacterModel.orig_EnableItemDisplay orig, RoR2.CharacterModel self, ItemIndex itemIndex)
 {
     for (int i = 0; i < NewDefsList.Count; i++)
     {
         if (itemIndex == NewDefsList[i].itemIndex)
         {
             RoR2.DisplayRuleGroup equipmentDisplayRuleGroup = self.itemDisplayRuleSet.GetEquipmentDisplayRuleGroup(OldDefsList[i].equipmentIndex);
             self.InstantiateDisplayRuleGroup(equipmentDisplayRuleGroup, NewDefsList[i].itemIndex, EquipmentIndex.None);
         }
     }
     orig(self, itemIndex);
 }
Exemplo n.º 6
0
 // Token: 0x06000D27 RID: 3367 RVA: 0x000417F4 File Offset: 0x0003F9F4
 private void InstantiateDisplayRuleGroup(DisplayRuleGroup displayRuleGroup, ItemIndex itemIndex, EquipmentIndex equipmentIndex)
 {
     if (displayRuleGroup.rules != null)
     {
         for (int i = 0; i < displayRuleGroup.rules.Length; i++)
         {
             ItemDisplayRule     itemDisplayRule = displayRuleGroup.rules[i];
             ItemDisplayRuleType ruleType        = itemDisplayRule.ruleType;
             if (ruleType != ItemDisplayRuleType.ParentedPrefab)
             {
                 if (ruleType == ItemDisplayRuleType.LimbMask)
                 {
                     CharacterModel.LimbMaskDisplay item = new CharacterModel.LimbMaskDisplay
                     {
                         itemIndex      = itemIndex,
                         equipmentIndex = equipmentIndex
                     };
                     item.Apply(this, itemDisplayRule.limbMask);
                     this.limbMaskDisplays.Add(item);
                 }
             }
             else if (this.childLocator)
             {
                 Transform transform = this.childLocator.FindChild(itemDisplayRule.childName);
                 if (transform)
                 {
                     CharacterModel.ParentedPrefabDisplay item2 = new CharacterModel.ParentedPrefabDisplay
                     {
                         itemIndex      = itemIndex,
                         equipmentIndex = equipmentIndex
                     };
                     item2.Apply(this, itemDisplayRule.followerPrefab, transform, itemDisplayRule.localPos, Quaternion.Euler(itemDisplayRule.localAngles), itemDisplayRule.localScale);
                     this.parentedPrefabDisplays.Add(item2);
                 }
             }
         }
     }
 }