public static void GetAttribute(LopetInfo lInfo, LopetData lData, ref int maxHP, ref int attack, ref int physicDefense, ref int magicDefense) { if (lInfo == null) { global::Debug.LogError(new object[] { "lInfo == null" }); return; } maxHP = lInfo.MaxHP + lInfo.MaxHPInc * (int)lData.Level; attack = lInfo.Attack + lInfo.AttackInc * (int)lData.Level; physicDefense = lInfo.PhysicDefense + lInfo.PhysicDefenseInc * (int)lData.Level; magicDefense = lInfo.MagicDefense + lInfo.MagicDefenseInc * (int)lData.Level; int num = (int)(lData.Awake - 1u); if (num >= 0 && num < GameConst.GetInt32(251)) { if (num < lInfo.AwakeAttack.Count) { attack += lInfo.AwakeAttack[num]; } if (num < lInfo.AwakePhysicDefense.Count) { physicDefense += lInfo.AwakePhysicDefense[num]; } if (num < lInfo.AwakeMagicDefense.Count) { magicDefense += lInfo.AwakeMagicDefense[num]; } if (num < lInfo.AwakeMaxHP.Count) { maxHP += lInfo.AwakeMaxHP[num]; } } }
private void Init(ItemInfo info, int num) { if (info.Type != 3 || info.SubType != 3) { global::Debug.LogErrorFormat("Use reward type error {0}", new object[] { (EItemType)info.Type }); base.gameObject.SetActive(false); return; } this.itemInfo = info; this.lopetInfo = Globals.Instance.AttDB.LopetDict.GetInfo(this.itemInfo.Value2); if (this.lopetInfo == null) { global::Debug.LogError(new object[] { string.Format("LopetDict.GetInfo, ID = {0}", this.itemInfo.Value2) }); base.gameObject.SetActive(false); return; } UISprite uISprite = GameUITools.FindUISprite("Quality", base.gameObject); uISprite.spriteName = Tools.GetItemQualityIcon(this.lopetInfo.Quality); UISprite component = base.GetComponent<UISprite>(); component.spriteName = this.lopetInfo.Icon; UILabel uILabel = GameUITools.FindUILabel("num", base.gameObject); uILabel.text = string.Format("{0}{1}[-] [FFFFFF]x{2}", Tools.GetItemQualityColorHex(this.lopetInfo.Quality), this.itemInfo.Name, num); }
public void Refresh(PetInfo petInfo, int curPetCount, int needPetCount) { this.mItemInfo = null; this.mPetInfo = petInfo; this.mLopetInfo = null; this.IsEnough = (curPetCount >= needPetCount); if (petInfo != null) { this.mIcon.gameObject.SetActive(true); this.mQualityMask.gameObject.SetActive(true); this.mIcon.spriteName = petInfo.Icon; this.mQualityMask.spriteName = Tools.GetItemQualityIcon(petInfo.Quality); } else { this.mIcon.gameObject.SetActive(false); this.mQualityMask.gameObject.SetActive(false); } this.mSb.Remove(0, this.mSb.Length); if (curPetCount < needPetCount) { this.mSb.Append("[ff0000]"); } else { this.mSb.Append("[ffffff]"); } this.mSb.Append(curPetCount).Append("[-]/").Append(needPetCount); this.mNum.text = this.mSb.ToString(); }
public void Init(ItemInfo info, int num, bool showValue, bool showTips) { this.itemInfo = info; this.count = num; this.lopetInfo = Globals.Instance.AttDB.LopetDict.GetInfo(this.itemInfo.Value2); if (this.lopetInfo == null) { global::Debug.LogError(new object[] { string.Format("LopetDict.GetInfo, ID = {0}", this.itemInfo.Value2) }); base.gameObject.SetActive(false); return; } UISprite component = base.GetComponent<UISprite>(); component.spriteName = Tools.GetItemQualityIcon(this.lopetInfo.Quality); UISprite uISprite = GameUITools.FindUISprite("icon", base.gameObject); uISprite.spriteName = this.lopetInfo.Icon; UILabel uILabel = GameUITools.FindUILabel("num", base.gameObject); if (showValue) { uILabel.text = this.count.ToString(); } else { uILabel.gameObject.SetActive(false); } if (showTips) { UIEventListener expr_FD = UIEventListener.Get(base.gameObject); expr_FD.onClick = (UIEventListener.VoidDelegate)Delegate.Combine(expr_FD.onClick, new UIEventListener.VoidDelegate(this.OnRewardClick)); } }
public void AddAffixLopet(LopetInfo petInfo) { int affixEmptyIndex = this.GetAffixEmptyIndex(); if (affixEmptyIndex != -1) { this.mReward[affixEmptyIndex] = GameUITools.CreateReward(16, petInfo.ID, 1, this.mMailAffixGoods[affixEmptyIndex], false, true, 36f, -7f, -2000f, 20f, 13f, 7f, 0); if (this.mReward[affixEmptyIndex] != null) { this.mReward[affixEmptyIndex].AddComponent<UIDragScrollView>(); } this.mMailAffixGoods[affixEmptyIndex].gameObject.SetActive(true); } }
public static QuestRewardLopet CreateReward(LopetInfo info, int num) { GameObject gameObject = Tools.InstantiateGUIPrefab("GUI/QuestRewardLopet"); if (gameObject != null) { QuestRewardLopet questRewardLopet = gameObject.AddComponent<QuestRewardLopet>(); if (questRewardLopet != null) { questRewardLopet.Init(info, num); return questRewardLopet; } } return null; }
public void Init(int lopetInfoID, bool showTips) { this.lopetInfo = Globals.Instance.AttDB.LopetDict.GetInfo(lopetInfoID); if (this.lopetInfo == null) { global::Debug.LogError(new object[] { string.Format("LopetDict.GetInfo, ID = {0}", lopetInfoID) }); return; } UISprite component = base.GetComponent<UISprite>(); component.spriteName = Tools.GetItemQualityIcon(this.lopetInfo.Quality); UISprite uISprite = GameUITools.FindUISprite("itemIcon", base.gameObject); uISprite.spriteName = this.lopetInfo.Icon; if (showTips) { UIEventListener expr_95 = UIEventListener.Get(base.gameObject); expr_95.onClick = (UIEventListener.VoidDelegate)Delegate.Combine(expr_95.onClick, new UIEventListener.VoidDelegate(this.OnRewardClick)); } }
private void Init(LopetInfo info, int num) { this.petInfo = info; if (this.petInfo == null) { base.gameObject.SetActive(false); return; } UISprite component = base.GetComponent<UISprite>(); component.spriteName = this.petInfo.Icon; UISprite uISprite = GameUITools.FindUISprite("Quality", base.gameObject); uISprite.spriteName = Tools.GetItemQualityIcon(this.petInfo.Quality); UILabel uILabel = GameUITools.FindUILabel("num", base.gameObject); if (num > 1) { uILabel.text = string.Format("{0}{1}[-] [FFFFFF]x{2}", Tools.GetItemQualityColorHex(this.petInfo.Quality), this.petInfo.Name, num); } else { uILabel.text = this.petInfo.Name; uILabel.color = Tools.GetItemQualityColor(this.petInfo.Quality); } }
private void RefreshReward() { if (this.mRewardData == null) { return; } if (this.showName) { this.mName.enabled = true; this.mName.color = Tools.GetItemQualityColor(0); } else { this.mName.enabled = false; } if (this.showNum) { this.mNum.enabled = true; } else { this.mNum.enabled = false; } ERewardType rewardType = (ERewardType)this.mRewardData.RewardType; switch (rewardType) { case ERewardType.EReward_Money: case ERewardType.EReward_Diamond: case ERewardType.EReward_Energy: case ERewardType.EReward_Exp: case ERewardType.EReward_GuildRepution: case ERewardType.EReward_MagicCrystal: case ERewardType.EReward_MagicSoul: case ERewardType.EReward_FireDragonScale: case ERewardType.EReward_KingMedal: case ERewardType.EReward_StarSoul: case ERewardType.EReward_Honor: case ERewardType.EReward_Emblem: case ERewardType.EReward_LopetSoul: case ERewardType.EReward_FestivalVoucher: this.mQualityMark.spriteName = Tools.GetRewardFrame(rewardType); this.mItemIcon.spriteName = Tools.GetRewardIcon(rewardType); this.mNum.text = Tools.FormatValue(this.mRewardData.RewardValue1); this.mName.text = Tools.GetRewardTypeName(rewardType, 0); this.mName.color = Tools.GetRewardNameColor(rewardType); break; case ERewardType.EReward_Item: { ItemInfo info = Globals.Instance.AttDB.ItemDict.GetInfo(this.mRewardData.RewardValue1); if (info == null) { global::Debug.LogErrorFormat("ItemDict.GetInfo error, id = {0}", new object[] { this.mRewardData.RewardValue1 }); return; } this.mItemInfo = info; this.SetType(CommonIconItem.ECIIT.ECIIT_Item); this.SetNum((!this.showNum) ? 0 : this.mRewardData.RewardValue2); break; } case ERewardType.EReward_Pet: { PetInfo info2 = Globals.Instance.AttDB.PetDict.GetInfo(this.mRewardData.RewardValue1); if (info2 == null) { global::Debug.LogErrorFormat("PetDict.GetInfo error, id = {0}", new object[] { this.mRewardData.RewardValue1 }); return; } this.mPetInfo = info2; this.SetType(CommonIconItem.ECIIT.ECIIT_Pet); this.SetNum((!this.showNum) ? 0 : this.mRewardData.RewardValue2); break; } case ERewardType.EReward_Fashion: { FashionInfo info3 = Globals.Instance.AttDB.FashionDict.GetInfo(this.mRewardData.RewardValue1); if (info3 == null) { global::Debug.LogErrorFormat("FashionDict.GetInfo error, id = {0}", new object[] { this.mRewardData.RewardValue1 }); return; } this.mFashionInfo = info3; this.SetType(CommonIconItem.ECIIT.ECIIT_Fashion); this.SetNum((!this.showNum) ? 0 : this.mRewardData.RewardValue2); break; } case ERewardType.EReward_Lopet: { LopetInfo info4 = Globals.Instance.AttDB.LopetDict.GetInfo(this.mRewardData.RewardValue1); if (info4 == null) { global::Debug.LogErrorFormat("LopetDict.GetInfo error, id = {0}", new object[] { this.mRewardData.RewardValue1 }); return; } this.mLopetInfo = info4; this.SetType(CommonIconItem.ECIIT.ECIIT_Lopet); this.SetNum((!this.showNum) ? 0 : this.mRewardData.RewardValue2); break; } } }
private void RefreshItem() { if (this.mItemInfo == null) { return; } this.mItemIcon.spriteName = this.mItemInfo.Icon; this.mQualityMark.spriteName = Tools.GetItemQualityIcon(this.mItemInfo.Quality); if (this.mItemInfo.Type == 3) { this.mFragmentMask.enabled = true; if (this.mItemInfo.SubType == 0) { this.mPetInfo = Globals.Instance.AttDB.PetDict.GetInfo(this.mItemInfo.Value2); if (this.mPetInfo == null) { global::Debug.LogErrorFormat("PetDict get info error , ID : {0}", new object[] { this.mItemInfo.Value2 }); return; } this.mItemIcon.enabled = false; this.mLopetIcon.enabled = false; this.mPetIcon.enabled = true; this.mPetIcon.spriteName = this.mPetInfo.Icon; this.mFragmentMask.spriteName = "frag"; } else if (this.mItemInfo.SubType == 3) { this.mLopetInfo = Globals.Instance.AttDB.LopetDict.GetInfo(this.mItemInfo.Value2); if (this.mLopetInfo == null) { global::Debug.LogErrorFormat("LopetDict get info error , ID : {0}", new object[] { this.mItemInfo.Value2 }); return; } this.mItemIcon.enabled = false; this.mPetIcon.enabled = false; this.mLopetIcon.enabled = true; this.mLopetIcon.spriteName = this.mLopetInfo.Icon; this.mFragmentMask.spriteName = "frag"; } else { this.mFragmentMask.spriteName = "frag2"; } } else { this.mFragmentMask.enabled = false; } if (this.showName) { this.mName.enabled = true; this.mName.text = this.mItemInfo.Name; this.mName.color = Tools.GetItemQualityColor(this.mItemInfo.Quality); } else { this.mName.enabled = false; } int itemCount = Globals.Instance.Player.ItemSystem.GetItemCount(this.mItemInfo.ID); if (this.showNum && itemCount > 0) { this.mNum.enabled = true; this.mNum.text = Tools.FormatValue(itemCount); } else { this.mNum.enabled = false; } }
public void Refresh(LopetInfo info, bool showName = false, bool showNum = false, bool showMinus = false) { if (this.mLopetInfo == info) { return; } this.InitBool(showName, showNum, showMinus); this.mLopetInfo = info; this.SetType(CommonIconItem.ECIIT.ECIIT_Lopet); }
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); }
public LopetDataEx(LopetData data, LopetInfo info) { this.Data = data; this.Info = info; }
public static ResourceEntity CreateUILopet(LopetInfo lpInfo, int depth = 0, bool playAction = true, bool canRotate = true, GameObject parent = null, float scale = 1f, Action<GameObject> callback = null) { if (lpInfo == null) { global::Debug.LogError(new object[] { "LopetInfo == null" }); if (callback != null) { callback(null); } return null; } return ActorManager.CreateUIActorAsync(lpInfo.ResLoc, string.Empty, lpInfo.ScaleInUI * scale, depth, playAction, canRotate, parent, 0, string.Empty, 180f, delegate(GameObject obj) { if (lpInfo.OffsetYInUI != 0f) { obj.transform.localPosition = new Vector3(0f, lpInfo.OffsetYInUI, 0f); } if (callback != null) { callback(obj); } }); }
public static void ShowThis(LopetInfo info) { if (info == null) { return; } ItemInfo fragmentInfo = LopetFragment.GetFragmentInfo(info.ID); if (fragmentInfo == null) { global::Debug.LogErrorFormat("LopetFragment.GetFragmentInfo error, LopetInfo id = {0}", new object[] { info.ID }); return; } GameUIPopupManager.GetInstance().PushState(GameUIPopupManager.eSTATE.GUIHowGetPetItemPopUp, false, null, null); GameUIPopupManager.GetInstance().GetCurrentPopup().InitPopUp(fragmentInfo); }