public void AddInPet(PetDataEx data) { this.mCurPetData = data; this.mTargetPet = null; this.mSelectPop.Close(); this.RefreshInInfo(); }
public void Refresh(PetDataEx petData) { if (petData != null) { this.mCollectionTable2.Refresh(petData); } }
public static int SortByPetDatas2(PetDataEx aP, PetDataEx bP) { if (aP == null || bP == null) { return 0; } if (aP.Info.Quality > bP.Info.Quality) { return 1; } if (aP.Info.Quality < bP.Info.Quality) { return -1; } if (aP.Info.SubQuality > bP.Info.SubQuality) { return 1; } if (aP.Info.SubQuality < bP.Info.SubQuality) { return -1; } if (aP.Data.Level > bP.Data.Level) { return 1; } if (aP.Data.Level < bP.Data.Level) { return -1; } return aP.Info.ID - bP.Info.ID; }
public static void Show(PetDataEx petData) { if (petData == null) { return; } if (GUIMagicMirrorExchangeSuccess.mInstance == null) { UnityEngine.Object @object = Res.LoadGUI("GUI/GUIMagicMirrorExchangeSuccess"); if (@object == null) { global::Debug.LogError(new object[] { "Res.Load GUI/GUIMagicMirrorExchangeSuccess 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; GUIMagicMirrorExchangeSuccess.mInstance = gameObject.AddComponent<GUIMagicMirrorExchangeSuccess>(); } GUIMagicMirrorExchangeSuccess.mInstance.Init(petData); }
public void Clear() { this.itemData = null; this.petData = null; this.lopetData = null; this.mAdd.enabled = true; this.mIconItem.IsVisible = false; }
public void AddOutPet(PetDataEx pet) { if (pet == null) { return; } this.mTargetPet = pet; this.mSelectPop.Close(); this.RefreshOutInfo(); }
public void Refresh(PetDataEx pdEx) { if (this.mPetDataEx != pdEx) { this.mPetDataEx = pdEx; this.RefreshContents0(); int curState = this.GetCurState(); if (curState == 0 || curState == 1) { this.RefreshContents1(); } } }
public void Refresh(PetDataEx petData) { if (petData != null) { for (int i = 0; i < 8; i++) { if (this.mCollectionPetInfos[i] != null && this.mCollectionPetInfos[i].ID == petData.Info.ID) { this.mCollectionContent[i].Refresh(petData.Info); } } } }
public void ShowSummonSkills(PetDataEx petData, PetInfo petInfo = null) { if (petData != null) { this.mActiveSkillInfo = petData.GetPlayerSkillInfo(); if (this.mActiveSkillInfo != null) { Texture mainTexture = Res.Load<Texture>(string.Format("icon/skill/{0}", this.mActiveSkillInfo.Icon), false); this.mActiveSkill.mainTexture = mainTexture; } else { this.mActiveSkill.mainTexture = null; } } else { this.mActiveSkill.mainTexture = null; } if (this.mPassiveSkills[0] != null && petData != null) { int i = 0; for (int j = 0; j < 3; j++) { this.mPassiveSkillInfos[i] = petData.GetSkillInfo(1 + j); if (this.mPassiveSkillInfos[i] != null && this.mPassiveSkillInfos[i].ID != 0) { this.mPassiveSkills[i].gameObject.SetActive(true); if (j == 0 || (ulong)petData.Data.Further > (ulong)((long)(j + 1))) { this.mPassiveSkillIcons[i].gameObject.SetActive(true); this.mPassiveSkillIconGreys[i].gameObject.SetActive(false); this.mPassiveSkillIcons[i].spriteName = this.mPassiveSkillInfos[i].Icon; } else { this.mPassiveSkillIcons[i].gameObject.SetActive(false); this.mPassiveSkillIconGreys[i].gameObject.SetActive(true); this.mPassiveSkillIconGreys[i].spriteName = this.mPassiveSkillInfos[i].Icon; } i++; } } while (i < 3) { this.mPassiveSkillInfos[i] = null; this.mPassiveSkills[i].gameObject.SetActive(false); i++; } } }
public static bool IsMeetConditions() { foreach (PetDataEx current in Globals.Instance.Player.PetSystem.Values) { if (current.Data.ID != 100uL && current.Data.InfoID != 90000) { if ((ulong)current.Data.Further >= (ulong)((long)Tutorial_PetSkillLU.PetFurtherLevel)) { Tutorial_PetSkillLU.tempPetData = current; return true; } } } return false; }
public int SortByQuality(PetDataEx aItem, PetDataEx bItem) { if (aItem == null || bItem == null) { return 0; } if (aItem.Relation > bItem.Relation) { return -1; } if (aItem.Relation < bItem.Relation) { return 1; } if (aItem.Info.Quality > bItem.Info.Quality) { return -1; } if (aItem.Info.Quality < bItem.Info.Quality) { return 1; } if (aItem.Info.SubQuality > bItem.Info.SubQuality) { return -1; } if (aItem.Info.SubQuality < bItem.Info.SubQuality) { return 1; } if (aItem.Data.Level > bItem.Data.Level) { return -1; } if (aItem.Data.Level < bItem.Data.Level) { return 1; } if (aItem.Info.ID < bItem.Info.ID) { return -1; } if (aItem.Info.ID > bItem.Info.ID) { return 1; } return 0; }
private void Step_01() { this.petData = Globals.Instance.Player.PetSystem.GetPetByInfoID(Tutorial_Team2.PetInfoID); if (this.petData == null || this.petData.Data.Level > 1u) { TutorialEntity.SetNextTutorialStep(1, TutorialManager.ETutorialNum.Tutorial_PetLevelUp, true, true, true); return; } if (Globals.Instance.TutorialMgr.CurrentScene is GUIMainMenuScene) { base.Step_TeamBtn(); TutorialEntity.SetNextTutorialStep(2, TutorialManager.ETutorialNum.Tutorial_Null, false, false, false); } else if (Globals.Instance.TutorialMgr.CurrentScene is GUITeamManageSceneV2) { TutorialEntity.SetNextTutorialStep(3, TutorialManager.ETutorialNum.Tutorial_Null, false, false, false); this.Step_03(); } }
protected override void OnPostLoadGUI() { this.mSlot = GameUIManager.mInstance.uiState.CombatPetSlot; SocketDataEx socket = Globals.Instance.Player.TeamSystem.GetSocket(this.mSlot); if (socket != null) { this.mPetData = socket.GetPet(); } else { int slot = this.mSlot - 4; this.mPetData = Globals.Instance.Player.TeamSystem.GetAssist(slot); } TopGoods topGoods = GameUIManager.mInstance.GetTopGoods(); topGoods.Show("PetFurther7"); topGoods.BackClickListener = new UIEventListener.VoidDelegate(this.OnBackClick); Globals.Instance.BackgroundMusicMgr.PlayLobbyMusic(); this.CreateObjects(); UIEventListener expr_B8 = UIEventListener.Get(this.mSelect.gameObject); expr_B8.onClick = (UIEventListener.VoidDelegate)Delegate.Combine(expr_B8.onClick, new UIEventListener.VoidDelegate(this.OnSlectClick)); TeamSubSystem expr_E8 = Globals.Instance.Player.TeamSystem; expr_E8.EquipPetEvent = (TeamSubSystem.PetUpdateCallback)Delegate.Combine(expr_E8.EquipPetEvent, new TeamSubSystem.PetUpdateCallback(this.OnEquipPetEvent)); Globals.Instance.TutorialMgr.InitializationCompleted(this, null); }
public void SetSelectPetDatas(PetDataEx[] pdExs) { for (int i = 0; i < 5; i++) { this.mSelPetDatas[i] = pdExs[i]; } this.InitPetItems(); this.Refresh(); Globals.Instance.TutorialMgr.InitializationCompleted(this, null); }
private void OnMsgPetExchange(MemoryStream stream) { MS2C_PetExchange mS2C_PetExchange = Serializer.NonGeneric.Deserialize(typeof(MS2C_PetExchange), stream) as MS2C_PetExchange; if (mS2C_PetExchange.Result != 0) { GameUIManager.mInstance.ShowMessageTip("PetR", mS2C_PetExchange.Result); return; } GUIMagicMirrorExchangeSuccess.Show(this.mTargetPet); this.mCurPetData = null; this.mTargetPet = null; this.RefreshInInfo(); }
private bool IsSelectPetData(PetDataEx pdEx) { for (int i = 0; i < 5; i++) { if (this.mSelPetDatas[i] != null && this.mSelPetDatas[i].Data.ID == pdEx.Data.ID) { return true; } } return false; }
private void ClearData() { this.mItemInfo = null; this.mPetInfo = null; this.mPetData = null; this.mRewardData = null; this.mFashionInfo = null; }
public void Refresh(PetDataEx data, bool showName = false, bool showNum = false, bool showMinus = false) { if (this.mPetInfo == data.Info) { return; } this.InitBool(showName, showNum, showMinus); this.mPetData = data; this.mPetInfo = data.Info; this.SetType(CommonIconItem.ECIIT.ECIIT_Pet); }
private IEnumerator DoFeatureCardAnim(PetDataEx petData) { return null; //GUIReward.<DoFeatureCardAnim>c__Iterator6C <DoFeatureCardAnim>c__Iterator6C = new GUIReward.<DoFeatureCardAnim>c__Iterator6C(); //<DoFeatureCardAnim>c__Iterator6C.petData = petData; //<DoFeatureCardAnim>c__Iterator6C.<$>petData = petData; //<DoFeatureCardAnim>c__Iterator6C.<>f__this = this; //return <DoFeatureCardAnim>c__Iterator6C; }
private int SortByPetAssisting(PetDataEx aItem, PetDataEx bItem) { if (!aItem.IsPetAssisting()) { if (!bItem.IsPetAssisting()) { return this.SortByQuality(aItem, bItem); } return 1; } else { if (!bItem.IsPetAssisting()) { return -1; } return this.SortByQuality(aItem, bItem); } }
public void Open(PetDataEx petData) { base.gameObject.SetActive(true); this.mData = petData; if (this.mData == null) { this.mTips.text = Singleton<StringManager>.Instance.GetString("Mirror0"); for (int i = 0; i < this.mTabs.Length; i++) { if (this.mTabs[i] != null) { this.mTabs[i].enabled = true; } } int num = -1; foreach (PetDataEx current in Globals.Instance.Player.PetSystem.Values) { if (!current.IsPlayerBattling()) { if (current.Info.Quality >= 3 && current.IsOld() && !current.IsPetAssisting() && !current.IsBattling() && (current.Info.Type < num || num < 0)) { num = current.Info.Type; } } } if (num < 0) { num = 1; } else if (num == 3) { num = 1; } if (this.mTabs[num - 1] != null) { if (this.mTabs[num - 1].value) { this.InitData(num); } else { this.mTabs[num - 1].value = true; } } for (int j = 0; j < this.mTabSprites.Length; j++) { if (this.mTabSprites[j] != null) { this.mTabSprites[j].color = Color.white; } } } else { if (this.mData.Info.Type > this.mTabs.Length || this.mData.Info.Type < 0) { return; } if (this.mData.Data.Further > 0u) { this.mTips.text = Singleton<StringManager>.Instance.GetString("Mirror1", new object[] { Tools.GetItemQualityColorHex(this.mData.Info.Quality, Singleton<StringManager>.Instance.GetString("equipImprove14", new object[] { Tools.GetPetName(this.mData.Info), this.mData.Data.Further })) }); } else { this.mTips.text = Singleton<StringManager>.Instance.GetString("Mirror1", new object[] { Tools.GetItemQualityColorHex(this.mData.Info.Quality, Tools.GetPetName(this.mData.Info)) }); } int num2 = this.mData.Info.Type; if (num2 == 3) { num2 = 1; } if (this.mTabs[num2 - 1] != null) { if (this.mTabs[num2 - 1].value) { this.InitData(num2); } else { this.mTabs[num2 - 1].value = true; } } for (int k = 0; k < this.mTabs.Length; k++) { if (this.mTabs[k] != null) { this.mTabs[k].enabled = false; } } for (int l = 0; l < this.mTabSprites.Length; l++) { if (l == num2 - 1) { if (this.mTabSprites[l] != null) { this.mTabSprites[l].color = Color.white; } } else if (this.mTabSprites[l] != null) { this.mTabSprites[l].color = Color.black; } } } GameUITools.PlayOpenWindowAnim(this.mWindow.transform, null, true); }
public void Refresh(PetDataEx pdEx, bool isLocal, bool isPlayer = false) { if (pdEx != null) { if (isPlayer) { this.mPropertySp.gameObject.SetActive(false); this.mPetTypeIcon.gameObject.SetActive(false); this.mZiZhiGo.SetActive(false); this.mZhujueGo.SetActive(true); } else { this.mPropertySp.gameObject.SetActive(true); string propertyIconWithBorder = Tools.GetPropertyIconWithBorder((EElementType)pdEx.Info.ElementType); this.mPropertySp.spriteName = propertyIconWithBorder; this.mPropertySpBtn.normalSprite = propertyIconWithBorder; this.mPropertySpBtn.hoverSprite = propertyIconWithBorder; this.mPropertySpBtn.pressedSprite = propertyIconWithBorder; this.mPetTypeIcon.gameObject.SetActive(true); string petTypeIcon = Tools.GetPetTypeIcon(pdEx.Info.Type); this.mPetTypeIcon.spriteName = petTypeIcon; this.mPetTypeIconBtn.normalSprite = petTypeIcon; this.mPetTypeIconBtn.hoverSprite = petTypeIcon; this.mPetTypeIconBtn.pressedSprite = petTypeIcon; this.mZiZhiGo.SetActive(true); this.mZhujueGo.SetActive(false); this.mZiZhiNum.text = pdEx.Info.SubQuality.ToString(); } this.mSb.Remove(0, this.mSb.Length); if (isPlayer) { if (isLocal) { this.mSb.Append(Globals.Instance.Player.Data.Name); if (Globals.Instance.Player.Data.FurtherLevel > 0) { this.mSb.Append(" +").Append(Globals.Instance.Player.Data.FurtherLevel); } if ((ulong)Globals.Instance.Player.Data.Level < (ulong)((long)GameConst.GetInt32(24))) { this.mStarsGo.SetActive(false); } else { this.mStarsGo.SetActive(true); uint num = 0u; uint petStarAndLvl = Tools.GetPetStarAndLvl((uint)Globals.Instance.Player.Data.AwakeLevel, out num); for (uint num2 = 0u; num2 < 5u; num2 += 1u) { this.mStars[(int)((UIntPtr)num2)].gameObject.SetActive(true); if (num2 < petStarAndLvl) { this.mStars[(int)((UIntPtr)num2)].spriteName = "star"; } else { this.mStars[(int)((UIntPtr)num2)].spriteName = "starBg"; } } } } else { this.mSb.Append(pdEx.Info.Name); if (pdEx.Data.Further > 0u) { this.mSb.Append(" +").Append(pdEx.Data.Further); } if ((ulong)pdEx.Data.Level < (ulong)((long)GameConst.GetInt32(24))) { this.mStarsGo.SetActive(false); } else { this.mStarsGo.SetActive(true); uint num3 = 0u; uint petStarAndLvl2 = Tools.GetPetStarAndLvl(pdEx.Data.Awake, out num3); for (uint num4 = 0u; num4 < 5u; num4 += 1u) { this.mStars[(int)((UIntPtr)num4)].gameObject.SetActive(true); if (num4 < petStarAndLvl2) { this.mStars[(int)((UIntPtr)num4)].spriteName = "star"; } else { this.mStars[(int)((UIntPtr)num4)].spriteName = "starBg"; } } } } } else { this.mSb.Append(Tools.GetPetName(pdEx.Info)); if (pdEx.Data.Further > 0u) { this.mSb.Append(" +").Append(pdEx.Data.Further); } if ((ulong)pdEx.Data.Level < (ulong)((long)GameConst.GetInt32(24))) { this.mStarsGo.SetActive(false); } else { this.mStarsGo.SetActive(true); uint num5 = 0u; uint petStarAndLvl3 = Tools.GetPetStarAndLvl(pdEx.Data.Awake, out num5); for (uint num6 = 0u; num6 < 5u; num6 += 1u) { this.mStars[(int)((UIntPtr)num6)].gameObject.SetActive(true); if (num6 < petStarAndLvl3) { this.mStars[(int)((UIntPtr)num6)].spriteName = "star"; } else { this.mStars[(int)((UIntPtr)num6)].spriteName = "starBg"; } } } } uint num7 = 0u; if (isLocal) { num7 = Globals.Instance.Player.Data.Level; } else { SocketDataEx socket = Globals.Instance.Player.TeamSystem.GetSocket(0, false); if (socket != null) { PetDataEx pet = socket.GetPet(); if (pet != null) { num7 = pet.Data.Level; } } } this.mNameTxt.text = this.mSb.ToString(); this.mNameTxt.color = Tools.GetItemQualityColor(pdEx.Info.Quality); this.mLvlNum.text = ((!isPlayer) ? string.Format("{0}/{1}", pdEx.Data.Level, num7) : pdEx.Data.Level.ToString()); } }
private void Step_09(bool showPlot = false) { if (showPlot || Globals.Instance.TutorialMgr.CurrentScene is GUIPetTrainSkillInfo) { base.HideFadeBG(); GameUIManager.mInstance.ShowPlotDialog(1109, null, null); TutorialEntity.SetNextTutorialStep(1, TutorialManager.ETutorialNum.Tutorial_PetSkillLU, true, true, true); Tutorial_PetSkillLU.tempPetData = null; } }
private void Init(PetDataEx data) { if (data == null) { GUIMagicMirrorExchangeSuccess.TryClose(); return; } this.CreateObjects(); this.mCurPetDataEx = data; this.Refresh(); }
public void Show(PetDataEx pdEx, int whichPart, ItemInfo idEx, int uiState) { this.CurPetDataEx = pdEx; this.WhichPart = whichPart; this.mUIState = uiState; if (uiState == 1 || uiState == 4) { if (idEx != null) { this.mItemInfo = idEx; this.SetCurState(this.mUIState); } } else { this.mItemInfo = null; this.SetCurState(this.mUIState); } }
private bool HasYuanFenItems(PetDataEx pdEx) { bool result = false; if (pdEx != null) { for (int i = 0; i < 3; i++) { RelationInfo info = Globals.Instance.AttDB.RelationDict.GetInfo(pdEx.Info.RelationID[i]); if (info != null) { result = true; break; } } } return result; }
private void InitData(int type) { if (this.mData == null) { this.mContent.ClearData(); this.mContent.SetDragAmount(0f, 0f); foreach (PetDataEx current in Globals.Instance.Player.PetSystem.Values) { if (!current.IsPlayerBattling()) { if (type == 1 || type == 3) { if ((current.Info.Type == 1 || current.Info.Type == 3) && current.Info.Quality >= 3 && current.IsOld()) { this.mContent.AddData(current); } } else if (current.Info.Type == type && current.Info.Quality >= 3 && current.IsOld()) { this.mContent.AddData(current); } } } } else { this.mContent.ClearData(); this.mContent.SetDragAmount(0f, 0f); foreach (PetInfo current2 in Globals.Instance.AttDB.PetDict.Values) { if (current2.ID != 90000 && current2.ID != 90001 && !current2.ShowCollection) { if (type == 1 || type == 3) { if ((current2.Type == 1 || current2.Type == 3) && current2.Quality >= 3 && current2.ID != this.mData.Info.ID) { PetDataEx data = new PetDataEx(this.mData.Data, current2); this.mContent.AddData(data); } } else if (current2.Type == this.mData.Info.Type && current2.Quality >= 3 && current2.ID != this.mData.Info.ID) { PetDataEx data = new PetDataEx(this.mData.Data, current2); this.mContent.AddData(data); } } } } }
public void Refresh(PetDataEx data) { this.mPetDataEx = data; this.Refresh(); }
private void HandleShowPetCmd(CommandParser.Command param) { int num = 0; int.TryParse(param.GetParam(1), out num); PetInfo info = Globals.Instance.AttDB.PetDict.GetInfo(num); if (info == null) { global::Debug.LogErrorFormat("PetDict.GetInfo error, id = {0}", new object[] { num }); return; } PetDataEx petData = new PetDataEx(new PetData { InfoID = num, Level = 1u }, info); GetPetLayer.Show(petData, null, GetPetLayer.EGPL_ShowNewsType.Null); }
public void AddPetItem(PetDataEx data) { data.State = 0; this.mInventoryTable.AddData(data); }