少年修仙传客户端代码仓库
lcy
2024-11-13 3e942bbe986df92ba74c82c5fa8de62fced3e746
10271 增加玩家定制头像支持
3个文件已修改
70 ■■■■■ 已修改文件
Core/GameEngine/Model/Config/PlayerFaceConfig.cs 29 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/PhantasmPavilion/PhantasmPavilionModel.cs 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/PhantasmPavilion/PhantasmPavilionWin.cs 29 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Core/GameEngine/Model/Config/PlayerFaceConfig.cs
@@ -1,6 +1,6 @@
//--------------------------------------------------------
//    [Author]:           Fish
//    [  Date ]:           Wednesday, November 13, 2024
//    [  Date ]:           2024年11月13日
//--------------------------------------------------------
using System.Collections.Generic;
@@ -18,6 +18,7 @@
    public readonly int[] JobShowList;
    public readonly int UnlockDefault;
    public readonly int ExpireMinutes;
    public readonly int CustomPlayerID;
    public readonly string Image;
    public readonly int BgColor;
    public readonly int EffectID;
@@ -59,21 +60,23 @@
            int.TryParse(tables[4],out ExpireMinutes); 
            Image = tables[5];
            int.TryParse(tables[5],out CustomPlayerID);
            int.TryParse(tables[6],out BgColor);
            Image = tables[6];
            int.TryParse(tables[7],out EffectID);
            int.TryParse(tables[7],out BgColor);
            UnlockNeedItemList = JsonMapper.ToObject<int[][]>(tables[8].Replace("(", "[").Replace(")", "]"));
            int.TryParse(tables[8],out EffectID);
            if (tables[9].Contains("["))
            UnlockNeedItemList = JsonMapper.ToObject<int[][]>(tables[9].Replace("(", "[").Replace(")", "]"));
            if (tables[10].Contains("["))
            {
                LightAttrType = JsonMapper.ToObject<int[]>(tables[9]);
                LightAttrType = JsonMapper.ToObject<int[]>(tables[10]);
            }
            else
            {
                string[] LightAttrTypeStringArray = tables[9].Trim().Split(StringUtility.splitSeparator,StringSplitOptions.RemoveEmptyEntries);
                string[] LightAttrTypeStringArray = tables[10].Trim().Split(StringUtility.splitSeparator,StringSplitOptions.RemoveEmptyEntries);
                LightAttrType = new int[LightAttrTypeStringArray.Length];
                for (int i=0;i<LightAttrTypeStringArray.Length;i++)
                {
@@ -81,13 +84,13 @@
                }
            }
            if (tables[10].Contains("["))
            if (tables[11].Contains("["))
            {
                LightAttrValue = JsonMapper.ToObject<int[]>(tables[10]);
                LightAttrValue = JsonMapper.ToObject<int[]>(tables[11]);
            }
            else
            {
                string[] LightAttrValueStringArray = tables[10].Trim().Split(StringUtility.splitSeparator,StringSplitOptions.RemoveEmptyEntries);
                string[] LightAttrValueStringArray = tables[11].Trim().Split(StringUtility.splitSeparator,StringSplitOptions.RemoveEmptyEntries);
                LightAttrValue = new int[LightAttrValueStringArray.Length];
                for (int i=0;i<LightAttrValueStringArray.Length;i++)
                {
@@ -95,9 +98,9 @@
                }
            }
            int.TryParse(tables[11],out LightFightPower);
            int.TryParse(tables[12],out LightFightPower);
            Descriptive = tables[12];
            Descriptive = tables[13];
        }
        catch (Exception ex)
        {
System/PhantasmPavilion/PhantasmPavilionModel.cs
@@ -245,6 +245,18 @@
            }
        }
        public bool IsCustom(int faceID,out int customPlayerID)
        {
            customPlayerID = 0;
            if (!PlayerFaceConfig.Has(faceID))
                return false;
            customPlayerID = PlayerFaceConfig.Get(faceID).CustomPlayerID;
            if (customPlayerID <= 0)
                return false;
            return true;
        }
        public void SetStarColor(int nowStar, List<ImageEx> starShowList)
        {
            for (int i = 0; i < starShowList.Count; i++)
System/PhantasmPavilion/PhantasmPavilionWin.cs
@@ -250,10 +250,37 @@
            starUpItemCell.SetActive(isStarUpNeedItem && unLockState == 2 && !isLimitTime && isNoMaxStar);
            btnUnLock.SetActive(isUnLockNeedItem && unLockState != 2);
            btnAddStar.SetActive(isStarUpNeedItem && unLockState == 2 && !isLimitTime && isNoMaxStar);
            btnUse.SetActive(!isUsing && unLockState == 2 && model.selectTab != PhantasmPavilionTab.ChatExpression);
            txtTime.SetActive(isInfo && unLockState == 2 || isUnlockDefault);
            StarGroup.SetActive(isInfo && isMaxStarLV && unLockState == 2);
            if (model.selectTab == PhantasmPavilionTab.ChatExpression)
            {
                btnUse.SetActive(false);
            }
            else if (model.selectTab == PhantasmPavilionTab.Avatar)
            {
                if (!isUsing && unLockState == 2)
                {
                    if (!model.IsCustom(id, out int customPlayerID))
                    {
                        btnUse.SetActive(true);
                    }
                    else
                    {
                        btnUse.SetActive(customPlayerID == PlayerDatas.Instance.PlayerId);
                    }
                    DebugEx.Log($"customPlayerID {customPlayerID} PlayerId {PlayerDatas.Instance.PlayerId}");
                }
                else
                {
                    btnUse.SetActive(false);
                }
            }
            else
            {
                btnUse.SetActive(!isUsing && unLockState == 2);
            }
            imgFace.SetActive(model.selectTab == PhantasmPavilionTab.ChatBubble || model.selectTab == PhantasmPavilionTab.ChatExpression);
            model.ShowImage(tab, id, imgFace);