Example #1
0
 public void Refresh(RelationInfo ri, bool isActive)
 {
     this.mRelationInfoData = ri;
     if (this.mRelationInfoData != null)
     {
         this.mName.text = string.Format("{0}{1}[-]", (!isActive) ? "[b2b2b2]" : "[00ff00]", this.mRelationInfoData.Name);
         this.mDesc.text = string.Format("{0}{1}[-]", (!isActive) ? "[b2b2b2]" : "[00ff00]", this.mRelationInfoData.Desc);
         int i = 0;
         int num = 0;
         while (num < this.mRelationInfoData.PetID.Count && num < 3)
         {
             int id = this.mRelationInfoData.PetID[num];
             PetInfo info = Globals.Instance.AttDB.PetDict.GetInfo(id);
             if (info != null)
             {
                 this.mYuanFenPets[i].IsVisible = true;
                 this.mYuanFenPets[i].Refresh(info, isActive);
                 i++;
             }
             num++;
         }
         while (i < 3)
         {
             this.mYuanFenPets[i].IsVisible = false;
             i++;
         }
     }
 }
 public void Refresh(RelationInfo ri, bool isActive)
 {
     this.mRelationInfoData = ri;
     if (this.mRelationInfoData != null)
     {
         if (isActive)
         {
             this.mName.color = Color.green;
             this.mDesc.color = Color.green;
         }
         else
         {
             this.mName.color = new Color32(178, 178, 178, 255);
             this.mDesc.color = this.mName.color;
         }
         this.mName.text = this.mRelationInfoData.Name;
         this.mDesc.text = this.mRelationInfoData.Desc;
         int i = 0;
         if (this.mRelationInfoData.Type == 0)
         {
             int num = 0;
             while (num < this.mRelationInfoData.PetID.Count && num < 3)
             {
                 int id = this.mRelationInfoData.PetID[num];
                 PetInfo info = Globals.Instance.AttDB.PetDict.GetInfo(id);
                 if (info != null)
                 {
                     this.mYuanFenPets[i].IsVisible = true;
                     this.mYuanFenPets[i].Refresh(info, isActive);
                     i++;
                 }
                 num++;
             }
         }
         else if (this.mRelationInfoData.Type == 1)
         {
             int itemID = this.mRelationInfoData.ItemID;
             ItemInfo info2 = Globals.Instance.AttDB.ItemDict.GetInfo(itemID);
             if (info2 != null)
             {
                 this.mYuanFenPets[i].IsVisible = true;
                 this.mYuanFenPets[i].Refresh(info2, isActive);
                 i++;
             }
         }
         while (i < 3)
         {
             this.mYuanFenPets[i].IsVisible = false;
             i++;
         }
     }
 }
Example #3
0
 private bool IsRelationActive(List<int> petIDs, List<int> assistIDs, RelationInfo info)
 {
     if (petIDs == null || info == null)
     {
         return false;
     }
     if (info.Type != 0)
     {
         return false;
     }
     bool result = false;
     for (int i = 0; i < info.PetID.Count; i++)
     {
         if (info.PetID[i] != 0)
         {
             bool flag = false;
             for (int j = 0; j < petIDs.Count; j++)
             {
                 if (info.PetID[i] == petIDs[j])
                 {
                     flag = true;
                     result = true;
                     break;
                 }
             }
             if (!flag)
             {
                 for (int k = 0; k < assistIDs.Count; k++)
                 {
                     if (info.PetID[i] == assistIDs[k])
                     {
                         flag = true;
                         break;
                     }
                 }
             }
             if (!flag)
             {
                 return false;
             }
         }
     }
     return result;
 }
Example #4
0
 public RelationInfoData(RelationInfo rInfo, bool isActive)
 {
     this.mRelationInfo = rInfo;
     this.mIsActive = isActive;
 }
Example #5
0
 public bool IsRelationActive(RelationInfo info)
 {
     if (info == null || this.petData == null)
     {
         return false;
     }
     if (info.Type == 0)
     {
         for (int i = 0; i < info.PetID.Count; i++)
         {
             if (info.PetID[i] != 0 && info.PetID[i] != this.petData.Info.ID)
             {
                 if (!Globals.Instance.Player.TeamSystem.HasPetInfoID(info.PetID[i], this.local))
                 {
                     return false;
                 }
             }
         }
     }
     else if (info.ItemID != 0 && !this.HasItemInfoID(info.ItemID))
     {
         return false;
     }
     return true;
 }