示例#1
0
        public static string ItemIcon(ItemParam param)
        {
            if (param != null)
            {
                switch (param.type)
                {
                case EItemType.ArtifactPiece:
                    if (!string.IsNullOrEmpty((string)param.icon))
                    {
                        AssetPath.mSB.Length = 0;
                        AssetPath.mSB.Append("ArtiIcon/");
                        AssetPath.mSB.Append((string)param.icon);
                        return(AssetPath.mSB.ToString());
                    }
                    break;

                case EItemType.Unit:
                    if (!string.IsNullOrEmpty((string)param.icon))
                    {
                        UnitParam unitParam = MonoSingleton <GameManager> .Instance.MasterParam.GetUnitParam(param.iname);

                        if (unitParam != null)
                        {
                            return(AssetPath.UnitIconSmall(unitParam, unitParam.GetJobId(0)));
                        }
                        break;
                    }
                    break;

                default:
                    return(AssetPath.ItemIcon((string)param.icon));
                }
            }
            return((string)null);
        }
示例#2
0
 public static string UnitSkinIconSmall(UnitParam unit, ArtifactParam skin, string jobName)
 {
     if (skin == null)
     {
         return(AssetPath.UnitIconSmall(unit, jobName));
     }
     AssetPath.mSB.Length = 0;
     AssetPath.mSB.Append("Portraits/");
     AssetPath.mSB.Append(unit.model);
     AssetPath.mSB.Append("_");
     AssetPath.mSB.Append(skin.asset);
     return(AssetPath.mSB.ToString());
 }
示例#3
0
        public void Refresh(ChatBlackListParam param)
        {
            if (param == null)
            {
                return;
            }
            if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.Name, (UnityEngine.Object)null))
            {
                this.Name.set_text(param.name);
            }
            if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.Lv, (UnityEngine.Object)null))
            {
                this.Lv.set_text(PlayerData.CalcLevelFromExp(param.exp).ToString());
            }
            if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.LastLogin, (UnityEngine.Object)null))
            {
                this.LastLogin.set_text(ChatLogItem.GetPostAt(param.lastlogin));
            }
            if (!UnityEngine.Object.op_Inequality((UnityEngine.Object) this.Icon, (UnityEngine.Object)null))
            {
                return;
            }
            UnitParam unitParam = MonoSingleton <GameManager> .Instance.MasterParam.GetUnitParam(param.icon);

            if (unitParam == null)
            {
                return;
            }
            if (!string.IsNullOrEmpty(param.skin_iname))
            {
                ArtifactParam skin = Array.Find <ArtifactParam>(MonoSingleton <GameManager> .Instance.MasterParam.Artifacts.ToArray(), (Predicate <ArtifactParam>)(p => p.iname == param.skin_iname));
                MonoSingleton <GameManager> .Instance.ApplyTextureAsync(this.Icon, AssetPath.UnitSkinIconSmall(unitParam, skin, param.job_iname));
            }
            else
            {
                MonoSingleton <GameManager> .Instance.ApplyTextureAsync(this.Icon, AssetPath.UnitIconSmall(unitParam, param.job_iname));
            }
        }
示例#4
0
        public void Refresh(UnitParam param, string shard_name = "", int awake_lv = 0, int get_shard = 0, int current_index = 0)
        {
            if (param == null)
            {
                return;
            }
            GameManager instance1 = MonoSingleton <GameManager> .Instance;

            this.InitRebirthStar();
            this.rebirthstar_template.SetActive(false);
            this.mNotUnlockUnit = true;
            this.mget_shard     = get_shard;
            this.msub_shard     = this.GetPastShard(current_index, (string)param.piece);
            this.muse_shard     = 0;
            this.mstart_gauge   = 0;
            this.mremain_shard  = this.mget_shard;
            UnitData unitDataByUnitId = instance1.Player.FindUnitDataByUnitID(param.iname);

            this.mCurrentUnitIname = param.iname;
            string path1 = AssetPath.UnitImage(param, param.GetJobId(0));

            instance1.ApplyTextureAsync(this.unit_img, path1);
            instance1.ApplyTextureAsync(this.unit_img_blur01, path1);
            instance1.ApplyTextureAsync(this.unit_img_blur02, path1);
            string path2 = AssetPath.UnitIconSmall(param, param.GetJobId(0));

            instance1.ApplyTextureAsync((RawImage)this.unit_icon, path2);
            GameSettings instance2 = GameSettings.Instance;

            if (unitDataByUnitId != null && EElement.None <= unitDataByUnitId.Element && unitDataByUnitId.Element < (EElement)instance2.Elements_IconSmall.Length)
            {
                this.element_icon.set_sprite(instance2.Elements_IconSmall[(int)unitDataByUnitId.Element]);
            }
            else
            {
                this.element_icon.set_sprite((Sprite)null);
            }
            this.ShardName.set_text(shard_name);
            this.StartAwakeLv = this.NowAwakeLv = awake_lv;
            if (unitDataByUnitId != null)
            {
                this.mNotUnlockUnit = false;
                this.AwakeLvCap     = unitDataByUnitId.GetAwakeLevelCap();
                int num1 = (int)instance1.MasterParam.GetRarityParam(unitDataByUnitId.Rarity).UnitAwakeLvCap / 5;
                for (int index = 0; index < num1; ++index)
                {
                    GameObject gameObject = (GameObject)Object.Instantiate <GameObject>((M0)this.rebirthstar_template);
                    gameObject.get_transform().SetParent(this.rebirthstar_root.get_transform(), false);
                    gameObject.SetActive(true);
                    this.mRebirthStars.Add(gameObject);
                }
                int index1 = this.StartAwakeLv / 5;
                for (int index2 = 0; index2 < index1 && this.mRebirthStars.Count >= index2; ++index2)
                {
                    Transform child = this.mRebirthStars[index2].get_transform().FindChild("Rebirth_star_anim");
                    ((Component)child.FindChild("Rebirthstar_01")).get_gameObject().SetActive(true);
                    ((Component)child.FindChild("Rebirthstar_02")).get_gameObject().SetActive(true);
                    ((Component)child.FindChild("Rebirthstar_03")).get_gameObject().SetActive(true);
                    ((Component)child.FindChild("Rebirthstar_04")).get_gameObject().SetActive(true);
                    ((Component)child.FindChild("Rebirthstar_05")).get_gameObject().SetActive(true);
                }
                int num2 = this.StartAwakeLv % 5;
                if (num2 > 0)
                {
                    Transform child = this.mRebirthStars[index1].get_transform().FindChild("Rebirth_star_anim");
                    for (int index2 = 0; index2 < num2; ++index2)
                    {
                        string str = "Rebirthstar_0" + (object)(index2 + 1);
                        ((Component)child.FindChild(str)).get_gameObject().SetActive(true);
                    }
                }
                if (this.msub_shard > 0)
                {
                    int startAwakeLv    = this.StartAwakeLv;
                    int msubShard       = this.msub_shard;
                    int awakeNeedPieces = instance1.MasterParam.GetAwakeNeedPieces(startAwakeLv);
                    int num3            = this.AwakeLvCap / 5;
                    while (msubShard >= awakeNeedPieces)
                    {
                        int       num4  = startAwakeLv / 5;
                        int       num5  = Math.Min(5, startAwakeLv % 5) + 1;
                        Transform child = this.mRebirthStars[num4 + 1 < num3 ? num4 : num3 - 1].get_transform().FindChild("Rebirth_star_anim").FindChild("Rebirthstar_0" + num5.ToString());
                        if (Object.op_Inequality((Object)child, (Object)null))
                        {
                            ((Component)child).get_gameObject().SetActive(true);
                        }
                        ++startAwakeLv;
                        if (startAwakeLv < this.AwakeLvCap)
                        {
                            msubShard      -= awakeNeedPieces;
                            awakeNeedPieces = instance1.MasterParam.GetAwakeNeedPieces(startAwakeLv);
                            if (msubShard < awakeNeedPieces)
                            {
                                break;
                            }
                        }
                        else
                        {
                            break;
                        }
                    }
                    if (Object.op_Inequality((Object)this.ShardNext, (Object)null))
                    {
                        this.ShardNext.set_text(awakeNeedPieces.ToString());
                    }
                    if (Object.op_Inequality((Object)this.ShardCurrent, (Object)null))
                    {
                        this.ShardCurrent.set_text(msubShard.ToString());
                    }
                    this.mstart_gauge = msubShard;
                    this.ShardGauge.AnimateValue((float)msubShard / (float)awakeNeedPieces, 0.0f);
                    this.StartAwakeLv = startAwakeLv;
                    this.NowAwakeLv   = this.StartAwakeLv;
                    this.NextAwakeLv  = this.StartAwakeLv + 1 <= this.AwakeLvCap ? this.StartAwakeLv + 1 : this.AwakeLvCap;
                }
            }
            int num = unitDataByUnitId == null?param.GetUnlockNeedPieces() : instance1.MasterParam.GetAwakeNeedPieces(this.StartAwakeLv);

            this.mnext_shard = num;
            this.muse_shard  = this.mget_shard >= num ? num : this.mget_shard;
            if (this.mstart_gauge > 0 && this.mstart_gauge + this.muse_shard > this.mnext_shard)
            {
                this.muse_shard -= this.mstart_gauge;
            }
            this.mremain_shard -= this.muse_shard;
            if (unitDataByUnitId == null && this.muse_shard >= this.mnext_shard)
            {
                this.mUnlockUnit = true;
            }
            if (this.muse_shard >= this.mnext_shard && this.msub_shard <= 0)
            {
                this.NextAwakeLv = this.NowAwakeLv + 1 <= this.AwakeLvCap ? this.NowAwakeLv + 1 : this.AwakeLvCap;
            }
            if (param.jobsets != null && param.jobsets.Length > 0)
            {
                this.mJobID      = new List <string>();
                this.mJobAwakeLv = new List <int>();
                for (int index = 0; index < param.jobsets.Length; ++index)
                {
                    JobSetParam jobSetParam = MonoSingleton <GameManager> .Instance.GetJobSetParam((string)param.jobsets[index]);

                    if (jobSetParam != null && jobSetParam.lock_awakelv > 0 && (unitDataByUnitId == null || !unitDataByUnitId.Jobs[index].IsActivated) && this.StartAwakeLv < jobSetParam.lock_awakelv)
                    {
                        this.mJobID.Add(jobSetParam.job);
                        this.mJobAwakeLv.Add(jobSetParam.lock_awakelv);
                    }
                }
                if (this.mJobID != null && this.mJobID.Count > 1)
                {
                    JobParam jobParam = MonoSingleton <GameManager> .Instance.GetJobParam(this.mJobID[0]);

                    this.JobName.set_text(jobParam.name);
                    this.JobComment.set_text(LocalizedText.Get("sys.GACHA_TEXT_SHARD_AWAKE", new object[1]
                    {
                        (object)jobParam.name
                    }));
                }
            }
            this.isRunningAnimator = true;
        }
示例#5
0
        public void Refresh(ChatLogParam param, ChatWindow.MessageTemplateType type)
        {
            if (param == null)
            {
                return;
            }
            if (this.mCoroutine != null)
            {
                this.StopCoroutine(this.mCoroutine);
                this.mCoroutine = (Coroutine)null;
            }
            if (UnityEngine.Object.op_Equality((UnityEngine.Object) this.mRoot, (UnityEngine.Object)null))
            {
                if (!UnityEngine.Object.op_Inequality((UnityEngine.Object)((Component)this).get_transform().get_parent(), (UnityEngine.Object)null))
                {
                    return;
                }
                this.mRoot = ((Component)((Component)this).get_transform().get_parent()).get_gameObject();
            }
            this.MessageIcon.SetActive(false);
            this.MessageLog.SetActive(false);
            this.MyMessageIcon.SetActive(false);
            this.MyMessageLog.SetActive(false);
            this.SystemMessageRootObj.SetActive(false);
            switch (type)
            {
            case ChatWindow.MessageTemplateType.OtherUser:
                this.MessageIcon.SetActive(true);
                this.MessageLog.SetActive(true);
                this.mStampRoot     = !UnityEngine.Object.op_Inequality((UnityEngine.Object) this.AnyStampObj, (UnityEngine.Object)null) ? (Transform)null : this.AnyStampObj.get_transform();
                this.mNameObj       = this.AnyNameObj;
                this.mFuIDObj       = this.AnyFuIDObj;
                this.mPostAtObj     = this.AnyPostAtObj;
                this.mStampImageObj = this.AnyStampImageObj;
                this.mMessageObj    = this.AnyMessageTextObj;
                this.mLogRoot       = this.AnyLogRoot;
                this.mLogImg        = (Image)((Component)this.AnyLogRoot).GetComponent <Image>();
                break;

            case ChatWindow.MessageTemplateType.User:
                this.MyMessageIcon.SetActive(true);
                this.MyMessageLog.SetActive(true);
                this.mStampRoot     = !UnityEngine.Object.op_Inequality((UnityEngine.Object) this.MyStampObj, (UnityEngine.Object)null) ? (Transform)null : this.MyStampObj.get_transform();
                this.mNameObj       = this.MyNameObj;
                this.mFuIDObj       = this.MyFuIDObj;
                this.mPostAtObj     = this.MyPostAtObj;
                this.mStampImageObj = this.MyStampImageObj;
                this.mMessageObj    = this.MyMessageTextObj;
                this.mLogRoot       = this.MyLogRoot;
                this.mLogImg        = (Image)((Component)this.MyLogRoot).GetComponent <Image>();
                break;

            case ChatWindow.MessageTemplateType.System:
                this.SystemMessageRootObj.SetActive(true);
                this.SystemMessageTextObj.set_text(param.message);
                this.mCoroutine = this.StartCoroutine(this.RefreshTextLine(param.message));
                return;
            }
            if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.Icon, (UnityEngine.Object)null) && UnityEngine.Object.op_Inequality((UnityEngine.Object) this.LeftIcon, (UnityEngine.Object)null) && UnityEngine.Object.op_Inequality((UnityEngine.Object) this.RightIcon, (UnityEngine.Object)null))
            {
                RawImage  target    = type != ChatWindow.MessageTemplateType.User ? this.LeftIcon : this.RightIcon;
                UnitParam unitParam = MonoSingleton <GameManager> .Instance.MasterParam.GetUnitParam(param.icon);

                if (unitParam != null)
                {
                    if (!string.IsNullOrEmpty(param.skin_iname) && UnityEngine.Object.op_Inequality((UnityEngine.Object)target, (UnityEngine.Object)null))
                    {
                        ArtifactParam skin = Array.Find <ArtifactParam>(MonoSingleton <GameManager> .Instance.MasterParam.Artifacts.ToArray(), (Predicate <ArtifactParam>)(p => p.iname == param.skin_iname));
                        MonoSingleton <GameManager> .Instance.ApplyTextureAsync(target, AssetPath.UnitSkinIconSmall(unitParam, skin, param.job_iname));
                    }
                    else
                    {
                        MonoSingleton <GameManager> .Instance.ApplyTextureAsync(target, AssetPath.UnitIconSmall(unitParam, param.job_iname));
                    }
                }
            }
            if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.mNameObj, (UnityEngine.Object)null))
            {
                this.mNameObj.set_text(param.name);
            }
            if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.mFuIDObj, (UnityEngine.Object)null))
            {
                this.mFuIDObj.set_text(LocalizedText.Get("sys.TEXT_CHAT_FUID", new object[1]
                {
                    (object)param.fuid.Substring(param.fuid.Length - 4, 4)
                }));
            }
            if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.mPostAtObj, (UnityEngine.Object)null))
            {
                this.mPostAtObj.set_text(ChatLogItem.GetPostAt(param.posted_at));
            }
            if ((int)param.message_type == 1)
            {
                if (!UnityEngine.Object.op_Inequality((UnityEngine.Object) this.mRoot, (UnityEngine.Object)null) || !this.mRoot.get_activeInHierarchy())
                {
                    return;
                }
                if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.mStampRoot, (UnityEngine.Object)null))
                {
                    ((Component)this.mStampRoot).get_gameObject().SetActive(false);
                }
                this.mCoroutine = this.StartCoroutine(this.RefreshTextLine(param.message));
            }
            else
            {
                if ((int)param.message_type != 2 || !UnityEngine.Object.op_Inequality((UnityEngine.Object) this.mRoot, (UnityEngine.Object)null) || !this.mRoot.get_activeInHierarchy())
                {
                    return;
                }
                if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.mStampRoot, (UnityEngine.Object)null))
                {
                    ((Component)this.mStampRoot).get_gameObject().SetActive(true);
                }
                if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.Element, (UnityEngine.Object)null))
                {
                    int stampSize = this.STAMP_SIZE;
                    VerticalLayoutGroup component = (VerticalLayoutGroup)((Component)this.mLogRoot).GetComponent <VerticalLayoutGroup>();
                    this.Element.set_minHeight((float)(stampSize + ((LayoutGroup)component).get_padding().get_top() + ((LayoutGroup)component).get_padding().get_bottom() + (int)Mathf.Abs((float)this.mLogRoot.get_anchoredPosition().y)));
                }
                ((Behaviour)this.mLogImg).set_enabled(false);
                this.mCoroutine = this.StartCoroutine(this.RefreshStamp(param.stamp_id));
            }
        }