少年修仙传客户端代码仓库
Client_PangDeRong
2018-11-19 4506a35a0d399ac896c54f3a4c31b006cd699671
4534 【1.3】【前端】组队功能和助战积分优化
6个文件已添加
3个文件已修改
265 ■■■■■ 已修改文件
System/Dungeon/AssistPlayerCell.cs 59 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/Dungeon/AssistPlayerCell.cs.meta 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/Dungeon/DungeonAssistModel.cs 53 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/Dungeon/DungeonAssistModel.cs.meta 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/Dungeon/DungeonAssistPlayerWin.cs 112 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/Dungeon/DungeonAssistPlayerWin.cs.meta 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/Dungeon/DungeonAssistWin.cs 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/WindowBase/ModelCenter.cs 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UI/Common/TimeDownMgr.cs 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/Dungeon/AssistPlayerCell.cs
New file
@@ -0,0 +1,59 @@
using UnityEngine;
using UnityEngine.UI;
using TableConfig;
namespace Snxxz.UI
{
    public class AssistPlayerCell : MonoBehaviour
    {
        [SerializeField] Text nameText;
        [SerializeField] Text lvText;
        [SerializeField] GameObject lvIcon;
        [SerializeField] Image headIcon;
        [SerializeField] Image realmIcon;
        [SerializeField] Button helpBtn;
        FriendsModel _friendsModel;
        FriendsModel friendsModel
        {
            get
            {
                return _friendsModel ?? (_friendsModel = ModelCenter.Instance.GetModel<FriendsModel>());
            }
        }
        public void SetDisplay(int playerId)
        {
            var playerInfo = friendsModel.GetFirendInfo(playerId);
            if (playerInfo == null) return;
            nameText.text = playerInfo.PlayerName;
            headIcon.SetSprite(GeneralDefine.GetOtherJobHeadPortrait(playerInfo.Job, 0));
            int realmLv = playerInfo.RealmLV;
            var realmConfig = Config.Instance.Get<RealmConfig>(playerInfo.RealmLV);
            realmIcon.SetSprite(realmConfig == null ? "NoRealm" : realmConfig.Img);
            int nirvanaLv = playerInfo.LV - friendsModel.OpenGreatLV;
            lvIcon.gameObject.SetActive(nirvanaLv > 0);
            if (nirvanaLv > 0)
            {
                lvText.text = nirvanaLv.ToString();
            }
            else
            {
                lvText.text = playerInfo.LV.ToString();
            }
        }
        public void UpdateAssistState(int assistType)
        {
            switch(assistType)
            {
                case 0:
                    break;
                case 1:
                    break;
            }
        }
    }
}
System/Dungeon/AssistPlayerCell.cs.meta
New file
@@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: df6489325863f5d45b60e71c8c234e6d
timeCreated: 1542617010
licenseType: Pro
MonoImporter:
  serializedVersion: 2
  defaultReferences: []
  executionOrder: 0
  icon: {instanceID: 0}
  userData:
  assetBundleName:
  assetBundleVariant:
System/Dungeon/DungeonAssistModel.cs
New file
@@ -0,0 +1,53 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Snxxz.UI
{
    [XLua.LuaCallCSharp]
    public class DungeonAssistModel : Model, IBeforePlayerDataInitialize, IPlayerLoginOk
    {
        public string helpInfoLocalSave { get; private set; }
        public List<string> helpInfolist { get; private set; }
        public override void Init()
        {
        }
        public void OnBeforePlayerDataInitialize()
        {
        }
        public void OnPlayerLoginOk()
        {
            int playerId = (int)PlayerDatas.Instance.baseData.PlayerID;
            helpInfoLocalSave = StringUtility.Contact("HelpInfoLocalSave", playerId);
            GetLocalSaveData();
        }
        public override void UnInit()
        {
        }
        private void GetLocalSaveData()
        {
            string[] helpInfos = LocalSave.GeStringArray(helpInfoLocalSave);
            helpInfolist = helpInfos == null ? null : helpInfos.ToList();
        }
        public void SetHelpInfoLocalSave(string info)
        {
            helpInfolist = helpInfolist == null ? new List<string>() : helpInfolist;
            if (helpInfolist.Count >= 20)
            {
                helpInfolist.RemoveAt(0);
            }
            helpInfolist.Add(info);
            LocalSave.SetStringArray(helpInfoLocalSave, helpInfolist.ToArray());
        }
    }
}
System/Dungeon/DungeonAssistModel.cs.meta
New file
@@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: 721bc9700ae71ba4eab410bb7f14f6f3
timeCreated: 1542615038
licenseType: Pro
MonoImporter:
  serializedVersion: 2
  defaultReferences: []
  executionOrder: 0
  icon: {instanceID: 0}
  userData:
  assetBundleName:
  assetBundleVariant:
System/Dungeon/DungeonAssistPlayerWin.cs
New file
@@ -0,0 +1,112 @@
using System;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
namespace Snxxz.UI
{
    [XLua.Hotfix]
    public class DungeonAssistPlayerWin : Window
    {
        [SerializeField] Button oneKeyHelpBtn;
        [SerializeField] Text oneKeyHelpText;
        [SerializeField] Button refreshBtn;
        [SerializeField] Text refreshText;
        [SerializeField] List<AssistPlayerCell> assistPlayers = new List<AssistPlayerCell>();
        public const int duration = 10;
        #region Built-in
        protected override void BindController()
        {
        }
        protected override void AddListeners()
        {
        }
        protected override void OnPreOpen()
        {
            SetDisplay();
        }
        protected override void OnAfterOpen()
        {
        }
        protected override void OnPreClose()
        {
        }
        protected override void OnAfterClose()
        {
        }
        #endregion
        public void SetDisplay()
        {
            UpdateAssistPlayers();
            UpdateOneKeyAssist();
            UpdateRefreshTimes();
        }
        private void UpdateAssistPlayers()
        {
            List<int> playerIds = null;
            if (playerIds == null) return;
            for(int i = 0; i < assistPlayers.Count; i++)
            {
                var assistPlayer = assistPlayers[i];
                if(i < playerIds.Count)
                {
                    assistPlayer.gameObject.SetActive(true);
                    assistPlayer.SetDisplay(playerIds[i]);
                }
                else
                {
                    assistPlayer.gameObject.SetActive(false);
                }
            }
        }
        private void UpdateOneKeyAssist()
        {
            UpdateTime(duration);
            TimeDownMgr.Instance.Begin(TimeDownMgr.CoolTimeType.DungeonAssistCoolTime,duration,UpdateTime);
        }
        private void UpdateRefreshTimes()
        {
            refreshText.text = StringUtility.Contact("刷新\n","(",5,")");
        }
        private void UpdateTime(float time)
        {
            if(time > 0)
            {
                oneKeyHelpText.text = StringUtility.Contact("一键召唤(",time,")");
            }
            else
            {
                oneKeyHelpText.text = "一键召唤";
            }
        }
        private void ClickOneKeyAssist()
        {
            CloseClick();
        }
        private void ClickRefresh()
        {
            UpdateAssistPlayers();
            UpdateOneKeyAssist();
        }
    }
}
System/Dungeon/DungeonAssistPlayerWin.cs.meta
New file
@@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: 4a94d7e1c2953de4e8271897605c63a4
timeCreated: 1542615272
licenseType: Pro
MonoImporter:
  serializedVersion: 2
  defaultReferences: []
  executionOrder: 0
  icon: {instanceID: 0}
  userData:
  assetBundleName:
  assetBundleVariant:
System/Dungeon/DungeonAssistWin.cs
@@ -4,6 +4,7 @@
namespace Snxxz.UI
{
    [XLua.Hotfix]
    public class DungeonAssistWin : Window
    {
        [SerializeField] ScrollerController resultCtrl; 
System/WindowBase/ModelCenter.cs
@@ -208,6 +208,7 @@
            RegisterModel<AccumulateRechargeModel>();
            RegisterModel<FBHelpPointExchageModel>();
            RegisterModel<IceCrystalVeinModel>();
            RegisterModel<DungeonAssistModel>();
            inited = true;
        }
UI/Common/TimeDownMgr.cs
@@ -5,7 +5,7 @@
[XLua.LuaCallCSharp]
public class TimeDownMgr : SingletonMonobehaviour<TimeDownMgr> {
    public enum CoolTimeType
    {
@@ -27,6 +27,7 @@
        HappyFreeRuneXB = 15,  //符印寻宝免费时间倒计时
        HappyXBWarehouse = 16,  //寻宝仓库整理倒计时
        FlashRushToBuyAppointment = 17, //限时抢购预约倒计时
        DungeonAssistCoolTime = 18, //副本助战一键召唤倒计时
    }
    public void Begin(CoolTimeType type, float duration,Action<float> func,float tick=1.0f)