public static void Show(LopetDataEx petData)
 {
     if (petData == null)
     {
         return;
     }
     if (GUILopetAwakeSuccess.mInstance == null)
     {
         UnityEngine.Object @object = Res.LoadGUI("GUI/GUILopetAwakeSuccess");
         if (@object == null)
         {
             global::Debug.LogError(new object[]
             {
                 "Res.Load GUI/GUILopetAwakeSuccess error"
             });
             return;
         }
         GameObject gameObject = (GameObject)UnityEngine.Object.Instantiate(@object);
         gameObject.name = @object.name;
         gameObject.transform.parent = GameUIManager.mInstance.uiCamera.gameObject.transform;
         gameObject.transform.localPosition = new Vector3(0f, 0f, 3000f);
         gameObject.transform.localScale = Vector3.one;
         GUILopetAwakeSuccess.mInstance = gameObject.AddComponent<GUILopetAwakeSuccess>();
     }
     GUILopetAwakeSuccess.mInstance.Init(petData);
 }
Example #2
0
 public void Clear()
 {
     this.itemData = null;
     this.petData = null;
     this.lopetData = null;
     this.mAdd.enabled = true;
     this.mIconItem.IsVisible = false;
 }
Example #3
0
 public void AddItem(LopetDataEx data)
 {
     if (this.IsInit)
     {
         return;
     }
     this.mContent.AddData(data);
     this.RefreshTips();
 }
 public void SendEquipItemMsg(LopetDataEx data)
 {
     if (data == null)
     {
         return;
     }
     MC2S_LopetSetCombat mC2S_LopetSetCombat = new MC2S_LopetSetCombat();
     mC2S_LopetSetCombat.LopetID = data.GetID();
     Globals.Instance.CliSession.Send(1060, mC2S_LopetSetCombat);
 }
 public void Refresh(LopetDataEx lopetData)
 {
     if (lopetData == null)
     {
         this.mActive.SetActive(false);
         return;
     }
     this.mActive.SetActive(true);
     this.mActiveSkillInfo = lopetData.GetPlayerSkillInfo();
     if (this.mActiveSkillInfo != null)
     {
         this.mActiveSkill.mainTexture = Res.Load<Texture>(string.Format("icon/skill/{0}", this.mActiveSkillInfo.Icon), false);
     }
     else
     {
         this.mActiveSkill.mainTexture = null;
     }
 }
Example #6
0
 public void Init(GUITeamManageSceneV2 basescene)
 {
     if (this.initFlag)
     {
         return;
     }
     this.initFlag = true;
     this.mBaseScene = basescene;
     this.mCurLopet = Globals.Instance.Player.LopetSystem.GetCurLopet(this.mBaseScene.IsLocalPlayer);
     GameObject gameObject = GameUITools.RegisterClickEvent("changeLopetBtn", new UIEventListener.VoidDelegate(this.OnChangeBtnClick), base.gameObject);
     gameObject.SetActive(this.mBaseScene.IsLocalPlayer);
     if (this.mCurLopet == null)
     {
         GameUITools.SetLabelLocalText("Label", "Lopet0", gameObject);
         Vector3 localPosition = gameObject.transform.localPosition;
         localPosition.x = -40f;
         gameObject.transform.localPosition = localPosition;
     }
     else
     {
         GameUITools.SetLabelLocalText("Label", "Lopet1", gameObject);
     }
     GameUITools.FindUISprite("New", gameObject).enabled = Globals.Instance.Player.LopetSystem.HasLopet2Change();
     gameObject = GameUITools.FindGameObject("topInfo", base.gameObject);
     if (this.mCurLopet == null)
     {
         gameObject.SetActive(false);
     }
     else
     {
         gameObject.AddComponent<GUILopetTitleInfo>().Refresh(this.mCurLopet);
         UITable component = GameUITools.FindGameObject("rightInfo/panel/content", base.gameObject).GetComponent<UITable>();
         GameUITools.FindGameObject("a", component.gameObject).AddComponent<GUIAttributeValue>().Refresh(this.mCurLopet);
         this.mLopetSkills = GameUITools.FindGameObject("b", component.gameObject).AddComponent<LopetInfoSkillLayer>();
         this.mLopetSkills.Init();
         this.mLopetSkills.Refresh(this.mCurLopet);
     }
     this.CreateModel();
     gameObject = GameUITools.RegisterClickEvent("yangCBtn", new UIEventListener.VoidDelegate(this.OnYangChengClick), base.gameObject);
     GameUITools.FindGameObject("Effect", gameObject).SetActive(Tools.CanCurLopetAwake() || Tools.CanCurLopetLevelup());
     gameObject.SetActive(this.mBaseScene.IsLocalPlayer && Globals.Instance.Player.LopetSystem.GetCurLopet(this.mBaseScene.IsLocalPlayer) != null);
 }
Example #7
0
 public void Refresh(LopetDataEx data)
 {
     if (!this.initFlag)
     {
         this.CreateObjects();
     }
     if (data == null)
     {
         return;
     }
     int num = 0;
     int num2 = 0;
     int num3 = 0;
     int num4 = 0;
     data.GetAttribute(ref num, ref num2, ref num3, ref num4);
     this.mHP.text = num.ToString();
     this.mAttack.text = num2.ToString();
     this.mPhysicD.text = num3.ToString();
     this.mMagicD.text = num4.ToString();
 }
Example #8
0
 public void Refresh(LopetDataEx data)
 {
     if (!this.initFlag)
     {
         this.CreateObjects();
     }
     if (data.Data.Awake > 0u)
     {
         this.mName.text = Singleton<StringManager>.Instance.GetString("equipImprove14", new object[]
         {
             data.Info.Name,
             data.Data.Awake
         });
     }
     else
     {
         this.mName.text = data.Info.Name;
     }
     this.mName.color = Tools.GetItemQualityColor(data.Info.Quality);
     this.mLevelValue.text = data.Data.Level.ToString();
 }
Example #9
0
 public void ClearRemotePlayerData()
 {
     this.remoteID = 0uL;
     this.remoteName = string.Empty;
     this.remoteLevel = 0;
     this.remoteFurther = 0;
     this.remoteVipLevel = 0;
     this.remoteGender = 0;
     this.remoteCombatValue = 0;
     this.remoteConstellationLevel = 0;
     this.remoteFashionLevel = 0;
     this.remoteLopet = null;
     for (int i = 0; i < this.remoteSockets.Length; i++)
     {
         this.remoteSockets[i] = null;
     }
     for (int j = 0; j < this.remoteAssistPets.Length; j++)
     {
         this.remoteAssistPets[j] = null;
     }
 }
Example #10
0
 public ActorController CreateLopet(LopetDataEx lpData, ActorController.EFactionType factionType, Vector3 position, Quaternion rotation)
 {
     if (lpData == null || lpData.Info == null)
     {
         global::Debug.LogError(new object[]
         {
             "LopetDataEx error"
         });
         return null;
     }
     GameObject gameObject = Res.Load<GameObject>(lpData.Info.ResLoc, false);
     if (gameObject == null)
     {
         global::Debug.LogErrorFormat("Res.Load error, path = {0}", new object[]
         {
             lpData.Info.ResLoc
         });
         return null;
     }
     GameObject gameObject2 = UnityEngine.Object.Instantiate(gameObject, position, rotation) as GameObject;
     if (gameObject2 == null)
     {
         global::Debug.LogErrorFormat("Instantiate error, path = {0}", new object[]
         {
             lpData.Info.ResLoc
         });
         return null;
     }
     NGUITools.SetLayer(gameObject2, LayerDefine.CharLayer);
     Tools.GetSafeComponent<NavMeshAgentEx>(gameObject2);
     Tools.GetSafeComponent<AnimationController>(gameObject2);
     AIController safeComponent = Tools.GetSafeComponent<AIController>(gameObject2);
     safeComponent.EnableAI = false;
     ActorController safeComponent2 = Tools.GetSafeComponent<ActorController>(gameObject2);
     safeComponent2.SetLopetData(lpData, factionType);
     safeComponent2.PlayerheadTip.enabled = false;
     safeComponent.Init();
     return safeComponent2;
 }
Example #11
0
 public static void Show(LopetDataEx lopetData, GUIPetTrainSceneV2.EUILopetTabs type = GUIPetTrainSceneV2.EUILopetTabs.E_UIBaseInfo)
 {
     if (lopetData == null)
     {
         return;
     }
     GameUIManager.mInstance.uiState.mLopetTrainCurLopetDataEx = lopetData;
     GameUIManager.mInstance.uiState.mPetTrainCurPageIndex = (int)type;
     GameUIManager.mInstance.ChangeSession<GUIPetTrainSceneV2>(null, false, true);
 }
Example #12
0
 public void Refresh(LopetDataEx data)
 {
     if (data == null)
     {
         this.OnMinusClick(null);
         return;
     }
     this.itemData = null;
     this.petData = null;
     this.lopetData = data;
     this.mAdd.enabled = false;
     this.mIconItem.IsVisible = true;
     if (this.mBaseScene.mCurType == GUIRecycleScene.ERecycleT.ERecycleT_LopetBreak || this.mBaseScene.mCurType == GUIRecycleScene.ERecycleT.ERecycleT_LopetReborn)
     {
         this.mIconItem.Refresh(this.lopetData, true, false, false);
     }
 }
Example #13
0
 private void OnAwakeLopetEvent(LopetDataEx data)
 {
     if (data != null)
     {
         this.mCurLopetDataEx = data;
         this.Refresh();
         GUILopetAwakeSuccess.Show(data);
     }
 }
Example #14
0
 private void OnLevelupLopetEvent(LopetDataEx data)
 {
     if (data != null)
     {
         this.mCurLopetDataEx = data;
         this.mGUILopetTrainLvlUpInfo.PlayLvlUpEffectAnimation();
     }
 }
Example #15
0
 public void OnListBtnClick(GameObject go)
 {
     if (HOTween.IsTweening(this.mListBtn.transform))
     {
         if (!(go == null))
         {
             return;
         }
         HOTween.Kill(this.mListBtn.transform);
     }
     Globals.Instance.EffectSoundMgr.Play("ui/ui_001");
     if (this.mData != null)
     {
         if (this.mData.BtnsVisible)
         {
             this.mData.BtnsVisible = false;
             base.StartCoroutine(this.HideListBtns());
             if (GUICommonBagItem.mCurBagItemData == this.mData)
             {
                 GUICommonBagItem.mCurBagItemData = null;
                 GUICommonBagItem.mCurBagItem = null;
             }
         }
         else
         {
             this.mData.BtnsVisible = true;
             base.StartCoroutine(this.ShowListBtns());
             if (GUICommonBagItem.mCurBagItemData != null && GUICommonBagItem.mCurBagItem != null && GUICommonBagItem.mCurBagItemData != this.mData)
             {
                 if (!(GUICommonBagItem.mCurBagItem == null))
                 {
                     if (GUICommonBagItem.mCurBagItemData == GUICommonBagItem.mCurBagItem.mData)
                     {
                         GUICommonBagItem.mCurBagItem.OnListBtnClick(null);
                     }
                     else
                     {
                         GUICommonBagItem.mCurBagItemData.BtnsVisible = false;
                     }
                 }
             }
             GUICommonBagItem.mCurBagItemData = this.mData;
             GUICommonBagItem.mCurBagItem = this;
         }
     }
     else if (this.mLopetData != null)
     {
         if (this.mLopetData.State == 1)
         {
             this.mLopetData.State = 0;
             base.StartCoroutine(this.HideListBtns());
             if (GUICommonBagItem.mCurBagItemLopetData == this.mLopetData)
             {
                 GUICommonBagItem.mCurBagItemLopetData = null;
                 GUICommonBagItem.mCurBagItem = null;
             }
         }
         else
         {
             this.mLopetData.State = 1;
             base.StartCoroutine(this.ShowListBtns());
             if (GUICommonBagItem.mCurBagItemLopetData != null && GUICommonBagItem.mCurBagItem != null && GUICommonBagItem.mCurBagItemLopetData != this.mLopetData)
             {
                 if (!(GUICommonBagItem.mCurBagItem == null))
                 {
                     if (GUICommonBagItem.mCurBagItemLopetData == GUICommonBagItem.mCurBagItem.mLopetData)
                     {
                         GUICommonBagItem.mCurBagItem.OnListBtnClick(null);
                     }
                     else
                     {
                         GUICommonBagItem.mCurBagItemLopetData.State = 0;
                     }
                 }
             }
             GUICommonBagItem.mCurBagItemLopetData = this.mLopetData;
             GUICommonBagItem.mCurBagItem = this;
         }
     }
     else if (this.mPetData != null)
     {
         if (this.mPetData.State == 1)
         {
             this.mPetData.State = 0;
             base.StartCoroutine(this.HideListBtns());
             if (GUICommonBagItem.mCurBagItemPetData == this.mPetData)
             {
                 GUICommonBagItem.mCurBagItemPetData = null;
                 GUICommonBagItem.mCurBagItem = null;
             }
         }
         else
         {
             this.mPetData.State = 1;
             base.StartCoroutine(this.ShowListBtns());
             if (GUICommonBagItem.mCurBagItemPetData != null && GUICommonBagItem.mCurBagItem != null && GUICommonBagItem.mCurBagItemPetData != this.mPetData)
             {
                 if (!(GUICommonBagItem.mCurBagItem == null))
                 {
                     if (GUICommonBagItem.mCurBagItemPetData == GUICommonBagItem.mCurBagItem.mPetData)
                     {
                         GUICommonBagItem.mCurBagItem.OnListBtnClick(null);
                     }
                     else
                     {
                         GUICommonBagItem.mCurBagItemPetData.State = 0;
                     }
                 }
             }
             GUICommonBagItem.mCurBagItemPetData = this.mPetData;
             GUICommonBagItem.mCurBagItem = this;
         }
     }
 }
Example #16
0
 private void InitBattelingPetDatas()
 {
     foreach (PetDataEx current in Globals.Instance.Player.PetSystem.Values)
     {
         if (!GameUIManager.mInstance.uiState.IsShowPetZhuWeiPopUp && !GameUIManager.mInstance.uiState.IsShowPetZhuWei)
         {
             if (current.IsBattling())
             {
                 this.mBattleingPetDatas.Add(current);
             }
         }
         else if (current.IsPetAssisting())
         {
             this.mBattleingPetDatas.Add(current);
         }
     }
     this.mBattleingPetDatas.Sort(delegate(PetDataEx a, PetDataEx b)
     {
         int num = Tools.ComparePetSlot(a, b);
         if (num != 0)
         {
             return num;
         }
         if (a.Info.Quality > b.Info.Quality)
         {
             return -1;
         }
         if (a.Info.Quality < b.Info.Quality)
         {
             return 1;
         }
         return a.Info.ID - b.Info.ID;
     });
     this.mBattlingLopetData = Globals.Instance.Player.LopetSystem.GetCurLopet(true);
 }
Example #17
0
 public void SetOldLopetAwakeData(LopetDataEx data)
 {
     data.GetAttribute(ref this.MaxHp, ref this.Attack, ref this.WuFang, ref this.FaFang);
 }
Example #18
0
 public void Refresh()
 {
     if (this.mData != null)
     {
         this.mIconItem.Refresh(this.mData, false, false, false);
         this.mIconItem.SetMask = this.ShowIconGray();
         this.tempStr = this.GetLevel();
         if (string.IsNullOrEmpty(this.tempStr))
         {
             this.mLevel.enabled = false;
         }
         else
         {
             this.mLevel.enabled = true;
             this.mLevel.text = this.tempStr;
         }
         this.tempStr = this.GetName();
         if (string.IsNullOrEmpty(this.tempStr))
         {
             this.mName.enabled = false;
         }
         else
         {
             this.mName.enabled = true;
             this.mName.color = Tools.GetItemQualityColor(this.mData.Info.Quality);
             this.mName.text = this.tempStr;
         }
         this.mPoint0.text = this.GetPoint0();
         this.mPoint0Value.text = this.GetPoint0Value();
         this.mPoint1.text = this.GetPoint1();
         this.mPoint1Value.text = this.GetPoint1Value();
         this.tempInt = this.GetRefineLevel();
         if (this.tempInt > 0)
         {
             this.mRefineLevel.gameObject.SetActive(true);
             this.mRefineLevel.text = Singleton<StringManager>.Instance.GetString("equipImprove1", new object[]
             {
                 this.tempInt
             });
             this.mRefineLevelBG.enabled = true;
         }
         else
         {
             this.tempStr = this.GetTip();
             if (string.IsNullOrEmpty(this.tempStr))
             {
                 this.mRefineLevel.gameObject.SetActive(false);
             }
             else
             {
                 this.mRefineLevel.gameObject.SetActive(true);
                 this.mRefineLevel.text = this.tempStr;
                 this.mRefineLevelBG.enabled = false;
             }
         }
         this.tempStr = this.GetDesc();
         if (string.IsNullOrEmpty(this.tempStr))
         {
             this.mDesc.enabled = false;
         }
         else
         {
             this.mDesc.enabled = true;
             this.mDesc.text = this.tempStr;
         }
         this.tempStr = this.GetRelation();
         if (string.IsNullOrEmpty(this.tempStr))
         {
             this.mRelation.enabled = false;
         }
         else
         {
             this.mRelation.enabled = true;
             this.mRelation.text = this.tempStr;
         }
         if (this.ShowStars())
         {
             this.mStars.Show();
             this.tempInt = this.GetStarsNum();
             this.mStars.Refresh(this.tempInt);
         }
         else
         {
             this.mStars.Hide();
         }
         this.tempPetData = this.GetPetDataEx();
         if (this.tempPetData == null)
         {
             this.mOwner.enabled = false;
         }
         else
         {
             this.mOwner.enabled = true;
             if (this.tempPetData.IsPlayerBattling())
             {
                 this.mOwner.text = Singleton<StringManager>.Instance.GetString("equipImprove10", new object[]
                 {
                     Globals.Instance.Player.Data.Name
                 });
             }
             else
             {
                 this.mOwner.text = Singleton<StringManager>.Instance.GetString("equipImprove10", new object[]
                 {
                     this.tempPetData.Info.FirstName
                 });
             }
         }
         if (this.ShowSelect())
         {
             this.mSelectToggle.SetCheckValue(this.mData.IsSelected);
         }
         this.tempInt = this.GetPrice(out this.tempStr, out this.tempBool);
         if (this.tempInt > 0)
         {
             this.mPrice.gameObject.SetActive(true);
             this.mPrice.text = this.tempInt.ToString();
             this.mPriceIcon.enabled = this.tempBool;
             this.mPriceName.text = this.tempStr;
         }
         else
         {
             this.mPrice.gameObject.SetActive(false);
         }
         if (this.mListBtn.activeInHierarchy)
         {
             if (this.mData.BtnsVisible)
             {
                 this.mInfo.gameObject.SetActive(false);
                 this.mList.SetActive(true);
                 this.mListBtn.transform.localRotation = Quaternion.Euler(0f, 0f, -180f);
                 this.mRefineBtn.gameObject.SetActive(true);
                 this.mEnhanceBtn.gameObject.SetActive(true);
                 if (GUICommonBagItem.mCurBagItem != this)
                 {
                     GUICommonBagItem.mCurBagItem = this;
                     GUICommonBagItem.mCurBagItemData = this.mData;
                 }
             }
             else
             {
                 this.mInfo.gameObject.SetActive(true);
                 this.mList.SetActive(false);
                 this.mListBtn.transform.localRotation = Quaternion.identity;
                 this.mRefineBtn.gameObject.SetActive(false);
                 this.mEnhanceBtn.gameObject.SetActive(false);
             }
             this.tempStr = this.GetEnhanceMax();
             if (string.IsNullOrEmpty(this.tempStr))
             {
                 this.mEnhanceMax.enabled = false;
             }
             else
             {
                 this.mEnhanceMax.enabled = true;
                 this.mEnhanceMax.text = this.tempStr;
             }
             this.tempStr = this.GetRefineMax();
             if (string.IsNullOrEmpty(this.tempStr))
             {
                 this.mRefineMax.enabled = false;
             }
             else
             {
                 this.mRefineMax.enabled = true;
                 this.mRefineMax.text = this.tempStr;
             }
             if (this.ShowListGoBtn())
             {
                 this.mListGoBtn.SetActive(true);
             }
             else
             {
                 this.mListGoBtn.SetActive(false);
             }
         }
         else
         {
             this.mListBtn.SetActive(false);
             this.tempStr = this.GetClickableBtnTxt();
             if (string.IsNullOrEmpty(this.tempStr))
             {
                 this.mClickableBtnSprite.gameObject.SetActive(false);
             }
             else
             {
                 this.mClickableBtnSprite.gameObject.SetActive(true);
                 this.mClickableBtnTxt.text = this.tempStr;
                 NGUITools.SetActive(this.mClickableBtnEffect, this.ShowClickableBtnEffect());
             }
         }
     }
     else if (this.mPetData != null)
     {
         this.mIconItem.Refresh(this.mPetData, false, false, false);
         this.mIconItem.SetMask = this.ShowIconGray();
         this.mIconItem.EnableLeftTopTag = this.ShowIconLeftTopTag();
         this.mIconItem.SetLeftTopTag(this.GetIconLeftTopTagLb());
         this.tempStr = this.GetLevel();
         if (string.IsNullOrEmpty(this.tempStr))
         {
             this.mLevel.enabled = false;
         }
         else
         {
             this.mLevel.enabled = true;
             this.mLevel.text = this.tempStr;
         }
         this.tempStr = this.GetName();
         if (string.IsNullOrEmpty(this.tempStr))
         {
             this.mName.enabled = false;
         }
         else
         {
             this.mName.enabled = true;
             this.mName.color = Tools.GetItemQualityColor(this.mPetData.Info.Quality);
             this.mName.text = this.tempStr;
         }
         this.mPoint0.text = this.GetPoint0();
         this.mPoint0Value.text = this.GetPoint0Value();
         this.mPoint1.text = this.GetPoint1();
         this.mPoint1Value.text = this.GetPoint1Value();
         this.tempStr = this.GetTip();
         if (string.IsNullOrEmpty(this.tempStr))
         {
             this.mRefineLevel.gameObject.SetActive(false);
         }
         else
         {
             this.mRefineLevel.gameObject.SetActive(true);
             this.mRefineLevel.text = this.tempStr;
             this.mRefineLevelBG.enabled = false;
         }
         this.tempStr = this.GetDesc();
         if (string.IsNullOrEmpty(this.tempStr))
         {
             this.mDesc.enabled = false;
         }
         else
         {
             this.mDesc.enabled = true;
             this.mDesc.text = this.tempStr;
         }
         this.tempStr = this.GetRelation();
         if (string.IsNullOrEmpty(this.tempStr))
         {
             this.mRelation.enabled = false;
         }
         else
         {
             this.mRelation.enabled = true;
             this.mRelation.text = this.tempStr;
         }
         if (this.ShowStars())
         {
             this.mStars.Show();
             this.tempInt = this.GetStarsNum();
             this.mStars.Refresh(this.tempInt);
         }
         else
         {
             this.mStars.Hide();
         }
         this.mOwner.enabled = false;
         this.mPrice.gameObject.SetActive(false);
         if (this.mListBtn.activeInHierarchy)
         {
             if (this.mPetData.State == 1)
             {
                 this.mInfo.gameObject.SetActive(false);
                 this.mList.SetActive(true);
                 this.mListBtn.transform.localRotation = Quaternion.Euler(0f, 0f, -180f);
                 this.mRefineBtn.gameObject.SetActive(true);
                 this.mEnhanceBtn.gameObject.SetActive(true);
                 if (GUICommonBagItem.mCurBagItem != this)
                 {
                     GUICommonBagItem.mCurBagItem = this;
                     GUICommonBagItem.mCurBagItemPetData = this.mPetData;
                 }
             }
             else
             {
                 this.mInfo.gameObject.SetActive(true);
                 this.mList.SetActive(false);
                 this.mListBtn.transform.localRotation = Quaternion.identity;
                 this.mRefineBtn.gameObject.SetActive(false);
                 this.mEnhanceBtn.gameObject.SetActive(false);
             }
             if (this.ShowListGoBtn())
             {
                 this.mListGoBtn.SetActive(true);
             }
             else
             {
                 this.mListGoBtn.SetActive(false);
             }
         }
         else
         {
             this.mListBtn.SetActive(false);
             this.tempStr = this.GetClickableBtnTxt();
             if (string.IsNullOrEmpty(this.tempStr))
             {
                 this.mClickableBtnSprite.gameObject.SetActive(false);
             }
             else
             {
                 this.mClickableBtnSprite.gameObject.SetActive(true);
                 this.mClickableBtnTxt.text = this.tempStr;
                 NGUITools.SetActive(this.mClickableBtnEffect, this.ShowClickableBtnEffect());
             }
             this.tempBool = this.EnableClickableBtn();
             if (this.tempBool)
             {
                 this.mClickableBtn.isEnabled = true;
                 for (int i = 0; i < this.mClickableBtns.Length; i++)
                 {
                     this.mClickableBtns[i].SetState(UIButtonColor.State.Normal, true);
                 }
             }
             else
             {
                 this.mClickableBtn.isEnabled = false;
                 for (int j = 0; j < this.mClickableBtns.Length; j++)
                 {
                     this.mClickableBtns[j].SetState(UIButtonColor.State.Disabled, true);
                 }
             }
         }
     }
     else if (this.mLopetData != null)
     {
         this.mIconItem.Refresh(this.mLopetData, false, false, false);
         this.mIconItem.SetMask = this.ShowIconGray();
         this.mIconItem.EnableLeftTopTag = this.ShowIconLeftTopTag();
         this.mIconItem.SetLeftTopTag(this.GetIconLeftTopTagLb());
         this.tempStr = this.GetLevel();
         if (string.IsNullOrEmpty(this.tempStr))
         {
             this.mLevel.enabled = false;
         }
         else
         {
             this.mLevel.enabled = true;
             this.mLevel.text = this.tempStr;
         }
         this.tempStr = this.GetName();
         if (string.IsNullOrEmpty(this.tempStr))
         {
             this.mName.enabled = false;
         }
         else
         {
             this.mName.enabled = true;
             this.mName.color = Tools.GetItemQualityColor(this.mLopetData.Info.Quality);
             this.mName.text = this.tempStr;
         }
         this.mPoint0.text = this.GetPoint0();
         this.mPoint0Value.text = this.GetPoint0Value();
         this.mPoint1.text = this.GetPoint1();
         this.mPoint1Value.text = this.GetPoint1Value();
         this.mEnhanceLb.text = this.GetEnhanceLb();
         this.mRefineLb.text = this.GetRefineLb();
         this.tempStr = this.GetTip();
         if (string.IsNullOrEmpty(this.tempStr))
         {
             this.mRefineLevel.gameObject.SetActive(false);
         }
         else
         {
             this.mRefineLevel.gameObject.SetActive(true);
             this.mRefineLevel.text = this.tempStr;
             this.mRefineLevelBG.enabled = false;
         }
         this.tempStr = this.GetDesc();
         if (string.IsNullOrEmpty(this.tempStr))
         {
             this.mDesc.enabled = false;
         }
         else
         {
             this.mDesc.enabled = true;
             this.mDesc.text = this.tempStr;
         }
         this.tempStr = this.GetRelation();
         if (string.IsNullOrEmpty(this.tempStr))
         {
             this.mRelation.enabled = false;
         }
         else
         {
             this.mRelation.enabled = true;
             this.mRelation.text = this.tempStr;
         }
         if (this.ShowStars())
         {
             this.mStars.Show();
             this.tempInt = this.GetStarsNum();
             this.mStars.Refresh(this.tempInt);
         }
         else
         {
             this.mStars.Hide();
         }
         this.mOwner.enabled = false;
         this.mPrice.gameObject.SetActive(false);
         if (this.mListBtn.activeInHierarchy)
         {
             if (this.mLopetData.State == 1)
             {
                 this.mInfo.gameObject.SetActive(false);
                 this.mList.SetActive(true);
                 this.mListBtn.transform.localRotation = Quaternion.Euler(0f, 0f, -180f);
                 this.mRefineBtn.gameObject.SetActive(true);
                 this.mEnhanceBtn.gameObject.SetActive(true);
                 if (GUICommonBagItem.mCurBagItem != this)
                 {
                     GUICommonBagItem.mCurBagItem = this;
                     GUICommonBagItem.mCurBagItemLopetData = this.mLopetData;
                 }
             }
             else
             {
                 this.mInfo.gameObject.SetActive(true);
                 this.mList.SetActive(false);
                 this.mListBtn.transform.localRotation = Quaternion.identity;
                 this.mRefineBtn.gameObject.SetActive(false);
                 this.mEnhanceBtn.gameObject.SetActive(false);
             }
             this.tempStr = this.GetEnhanceMax();
             if (string.IsNullOrEmpty(this.tempStr))
             {
                 this.mEnhanceMax.enabled = false;
             }
             else
             {
                 this.mEnhanceMax.enabled = true;
                 this.mEnhanceMax.text = this.tempStr;
             }
             this.tempStr = this.GetRefineMax();
             if (string.IsNullOrEmpty(this.tempStr))
             {
                 this.mRefineMax.enabled = false;
             }
             else
             {
                 this.mRefineMax.enabled = true;
                 this.mRefineMax.text = this.tempStr;
             }
             if (this.ShowListGoBtn())
             {
                 this.mListGoBtn.SetActive(true);
             }
             else
             {
                 this.mListGoBtn.SetActive(false);
             }
         }
         else
         {
             this.mListBtn.SetActive(false);
             this.tempStr = this.GetClickableBtnTxt();
             if (string.IsNullOrEmpty(this.tempStr))
             {
                 this.mClickableBtnSprite.gameObject.SetActive(false);
             }
             else
             {
                 this.mClickableBtnSprite.gameObject.SetActive(true);
                 this.mClickableBtnTxt.text = this.tempStr;
                 NGUITools.SetActive(this.mClickableBtnEffect, this.ShowClickableBtnEffect());
             }
         }
     }
 }
 private void Init(LopetDataEx data)
 {
     if (data == null)
     {
         GUILopetAwakeSuccess.TryClose();
         return;
     }
     this.CreateObjects();
     this.mCurPetDataEx = data;
     this.Refresh();
 }
Example #20
0
 public void SetLopetData(LopetDataEx lpData, ActorController.EFactionType faction)
 {
     if (lpData == null)
     {
         global::Debug.LogError(new object[]
         {
             "lpData == null"
         });
         return;
     }
     this.playerSkillID = lpData.Info.PlayerSkillID;
     this.actorType = ActorController.EActorType.ELopet;
     this.factionType = faction;
     this.Unattacked = true;
     this.Unhealed = true;
     int num = 0;
     int num2 = 0;
     int num3 = 0;
     int num4 = 0;
     lpData.GetAttribute(ref num, ref num2, ref num3, ref num4);
     this.attInit[1] = (long)num;
     this.attInit[2] = (long)num2;
     this.attInit[3] = (long)num3;
     this.attInit[4] = (long)num4;
     this.Init();
 }
Example #21
0
 public void SetRemotePlayerData(RemotePlayer data1, RemotePlayerDetail data2)
 {
     if (data1 == null || data2 == null)
     {
         Debug.LogError(new object[]
         {
             "data1 == null || data2 == null"
         });
         return;
     }
     this.ClearRemotePlayerData();
     this.remoteID = data1.GUID;
     this.remoteName = data1.Name;
     this.remoteLevel = data1.Level;
     this.remoteFurther = data1.FurtherLevel;
     this.remoteAwake = data1.AwakeLevel;
     this.remoteAwakeItemFlag = data1.AwakeItemFlag;
     this.remoteVipLevel = data1.VipLevel;
     this.remoteGender = data1.Gender;
     this.remoteConstellationLevel = data1.ConstellationLevel;
     this.remoteFashionLevel = data2.FashionLevel;
     if (data2.Lopet != null && data2.Lopet.InfoID != 0)
     {
         LopetInfo info = Globals.Instance.AttDB.LopetDict.GetInfo(data2.Lopet.InfoID);
         if (info == null)
         {
             Debug.LogErrorFormat("LopetDict.GetInfo error, id = {0}", new object[]
             {
                 data2.Lopet.InfoID
             });
             return;
         }
         this.remoteLopet = new LopetDataEx(data2.Lopet, info);
     }
     PlayerPetInfo.Info2.Name = this.remoteName;
     PlayerPetInfo.Info2.Quality = this.GetRemoteQuality();
     PlayerPetInfo.Info2.Type = this.remoteGender;
     PetData petData = new PetData();
     if (petData == null)
     {
         Debug.LogError(new object[]
         {
             "new PetData error"
         });
         return;
     }
     petData.ID = 0uL;
     petData.InfoID = 90001;
     petData.Level = (uint)this.remoteLevel;
     petData.Further = (uint)this.remoteFurther;
     petData.Awake = (uint)this.remoteAwake;
     petData.ItemFlag = (uint)this.remoteAwakeItemFlag;
     data2.Pets.Add(petData);
     for (int i = 0; i < data2.Pets.Count; i++)
     {
         int num = (int)data2.Pets[i].ID;
         if (num >= 4)
         {
             num -= 4;
             if (num >= 6)
             {
                 Debug.LogErrorFormat("remote assist pet slot error, slot = {0}", new object[]
                 {
                     num
                 });
             }
             else
             {
                 PetInfo info2 = Globals.Instance.AttDB.PetDict.GetInfo(data2.Pets[i].InfoID);
                 if (info2 == null)
                 {
                     Debug.LogErrorFormat("PetDict.GetInfo error, id = {0}", new object[]
                     {
                         data2.Pets[i].InfoID
                     });
                 }
                 else
                 {
                     this.remoteAssistPets[num] = new PetDataEx(data2.Pets[i], info2);
                 }
             }
         }
     }
     int fashionID = data1.FashionID;
     for (int j = 0; j < 4; j++)
     {
         this.remoteSockets[j] = new SocketDataEx();
         if (this.remoteSockets[j] == null)
         {
             Debug.LogError(new object[]
             {
                 "allocate SocketDataEx error!"
             });
         }
         else
         {
             this.remoteSockets[j].Init(j, (j != 0) ? 0 : fashionID, data2);
         }
     }
     this.UpdateRemoteCombatValue();
 }
Example #22
0
 private void AddLopet(LopetData data)
 {
     LopetInfo info = Globals.Instance.AttDB.LopetDict.GetInfo(data.InfoID);
     if (info == null)
     {
         Debug.LogError(new object[]
         {
             string.Format("LopetDict.GetInfo error, id = {0}", data.InfoID)
         });
         return;
     }
     LopetDataEx lopetDataEx = new LopetDataEx(data, info);
     this.lopets.Add(lopetDataEx.Data.ID, lopetDataEx);
 }
Example #23
0
 private void Init(LopetDataEx lopetData, GUILopetInfoScene.EType type)
 {
     Transform transform = base.transform.Find("UIMiddle");
     this.mCardModel = transform.Find("modelPos").gameObject;
     this.mGUIPetTitleInfo = transform.Find("topInfoPanel/lopetTopInfo").gameObject.AddComponent<GUILopetTitleInfo>();
     this.mGUIPetTitleInfo.Refresh(lopetData);
     GameObject gameObject = transform.Find("closeBtn").gameObject;
     UIEventListener expr_65 = UIEventListener.Get(gameObject);
     expr_65.onClick = (UIEventListener.VoidDelegate)Delegate.Combine(expr_65.onClick, new UIEventListener.VoidDelegate(this.OnCloseBtnClick));
     UITable component = GameUITools.FindGameObject("rightInfo/rightInfoPanel/content", transform.gameObject).GetComponent<UITable>();
     GameUITools.FindGameObject("a", component.gameObject).AddComponent<GUIAttributeValue>().Refresh(lopetData);
     LopetInfoSkillLayer lopetInfoSkillLayer = GameUITools.FindGameObject("b", component.gameObject).AddComponent<LopetInfoSkillLayer>();
     lopetInfoSkillLayer.Init();
     lopetInfoSkillLayer.Refresh(lopetData);
     UISprite component2 = GameUITools.FindGameObject("e", component.gameObject).GetComponent<UISprite>();
     UILabel uILabel = GameUITools.FindUILabel("desc", component2.gameObject);
     uILabel.text = lopetData.Info.Desc;
     component2.height = 50 + Mathf.RoundToInt(uILabel.printedSize.y);
     component.repositionNow = true;
     SourceItemUITable sourceItemUITable = GameUITools.FindGameObject("rightInfo/rightInfoPanel2/content", transform.gameObject).AddComponent<SourceItemUITable>();
     UILabel uILabel2 = GameUITools.FindUILabel("rightInfo/rightInfoPanel2/txt0", transform.gameObject);
     sourceItemUITable.maxPerLine = 1;
     sourceItemUITable.arrangement = UICustomGrid.Arrangement.Vertical;
     sourceItemUITable.cellWidth = 360f;
     sourceItemUITable.cellHeight = 76f;
     sourceItemUITable.gapHeight = 4f;
     sourceItemUITable.gapWidth = 0f;
     sourceItemUITable.ClearData();
     ItemInfo fragmentInfo = LopetFragment.GetFragmentInfo(lopetData.Info.ID);
     GUIHowGetPetItemPopUp.InitSourceItems(fragmentInfo, sourceItemUITable);
     if (sourceItemUITable.mDatas.Count > 0)
     {
         uILabel2.gameObject.SetActive(false);
     }
     else
     {
         uILabel2.gameObject.SetActive(true);
     }
     UIEventListener expr_210 = UIEventListener.Get(GameUITools.FindGameObject("rightInfo/Tabs/0", transform.gameObject));
     expr_210.onClick = (UIEventListener.VoidDelegate)Delegate.Combine(expr_210.onClick, new UIEventListener.VoidDelegate(this.OnTabClick));
     UIEventListener expr_246 = UIEventListener.Get(GameUITools.FindGameObject("rightInfo/Tabs/1", transform.gameObject));
     expr_246.onClick = (UIEventListener.VoidDelegate)Delegate.Combine(expr_246.onClick, new UIEventListener.VoidDelegate(this.OnTabClick));
     this.mState1Go = transform.Find("state1").gameObject;
     if (type != GUILopetInfoScene.EType.EType_Info)
     {
         if (type == GUILopetInfoScene.EType.EType_Fragment)
         {
             this.mState1Go.gameObject.SetActive(true);
         }
     }
     else
     {
         this.mState1Go.gameObject.SetActive(false);
     }
     Transform transform2 = this.mState1Go.transform;
     UISlider component3 = transform2.Find("expBar").GetComponent<UISlider>();
     UILabel component4 = component3.transform.Find("num").GetComponent<UILabel>();
     int itemCount = Globals.Instance.Player.ItemSystem.GetItemCount(fragmentInfo.ID);
     component4.text = this.mSb.Remove(0, this.mSb.Length).Append(itemCount).Append("/").Append(fragmentInfo.Value1).ToString();
     component3.value = ((fragmentInfo.Value1 == 0) ? 0f : Mathf.Clamp01((float)itemCount / (float)fragmentInfo.Value1));
     this.ClearModel();
     this.asyncEntiry = ActorManager.CreateUILopet(lopetData.Info, 450, true, true, this.mCardModel, 1f, delegate(GameObject go)
     {
         this.asyncEntiry = null;
         this.mModelTmp = go;
         if (this.mModelTmp != null)
         {
             this.mUIActorController = this.mModelTmp.GetComponent<UIActorController>();
             if (this.mUIActorController != null)
             {
                 this.mUIActorController.PlayIdleAnimationAndVoice();
             }
             Tools.SetMeshRenderQueue(this.mModelTmp, 5390);
         }
     });
 }
Example #24
0
 public void Refresh(LopetDataEx data, bool showName = false, bool showNum = false, bool showMinus = false)
 {
     if (this.mLopetData == data)
     {
         return;
     }
     this.InitBool(showName, showNum, showMinus);
     this.mLopetData = data;
     this.mLopetInfo = data.Info;
     this.SetType(CommonIconItem.ECIIT.ECIIT_Lopet);
 }
Example #25
0
 public void Destroy()
 {
     for (int i = 0; i < this.sockets.Length; i++)
     {
         this.sockets[i] = null;
         this.remoteSockets[i] = null;
     }
     for (int j = 0; j < this.assistPets.Length; j++)
     {
         this.assistPets[j] = null;
         this.remoteAssistPets[j] = null;
     }
     this.remoteLopet = null;
     this.combatValue = 0;
     this.Version = 0u;
 }
Example #26
0
 public override void Refresh(object data)
 {
     if (this.mData == data)
     {
         return;
     }
     if (data is ItemDataEx)
     {
         this.mData = (ItemDataEx)data;
     }
     else if (data is PetDataEx)
     {
         this.mPetData = (PetDataEx)data;
     }
     else
     {
         if (!(data is LopetDataEx))
         {
             return;
         }
         this.mLopetData = (LopetDataEx)data;
     }
     this.Refresh();
 }
Example #27
0
 private void OnAddLopetEvent(LopetDataEx data)
 {
     this.mPetLayer.AddItem(data);
 }