Procházet zdrojové kódy

角色信息界面技能UI修改,角色觉醒界面修改

zhenglijun před 5 dny
rodič
revize
a717623fa3
17 změnil soubory, kde provedl 495 přidání a 319 odebrání
  1. binární
      Assets/Res/Addressable/FGUI/Equip/Equip_fui.bytes
  2. binární
      Assets/Res/Addressable/FGUI/Player/Player_atlas0.png
  3. binární
      Assets/Res/Addressable/FGUI/Player/Player_fui.bytes
  4. 1 1
      Assets/Scripts/Business/Runtime/Data/PlayerData.cs
  5. 1 1
      Assets/Scripts/Business/Runtime/FGUI/Common/RenamePanel/CommonRenamePanelCtrl.cs
  6. 9 3
      Assets/Scripts/Business/Runtime/FGUI/Player/AwakePanel/PlayerAwakePanelCtrl.cs
  7. 1 0
      Assets/Scripts/Business/Runtime/FGUI/Player/ImprintItemNested/PlayerImprintItemNestedCtrl.cs
  8. 8 0
      Assets/Scripts/Business/Runtime/FGUI/Player/JokSkillNested.meta
  9. 324 0
      Assets/Scripts/Business/Runtime/FGUI/Player/JokSkillNested/PlayerJokSkillNestedCtrl.cs
  10. 11 0
      Assets/Scripts/Business/Runtime/FGUI/Player/JokSkillNested/PlayerJokSkillNestedCtrl.cs.meta
  11. 74 0
      Assets/Scripts/Business/Runtime/FGUI/Player/JokSkillNested/PlayerJokSkillNestedVM.Gen.cs
  12. 11 0
      Assets/Scripts/Business/Runtime/FGUI/Player/JokSkillNested/PlayerJokSkillNestedVM.Gen.cs.meta
  13. 23 0
      Assets/Scripts/Business/Runtime/FGUI/Player/JokSkillNested/PlayerJokSkillNestedView.cs
  14. 11 0
      Assets/Scripts/Business/Runtime/FGUI/Player/JokSkillNested/PlayerJokSkillNestedView.cs.meta
  15. 13 270
      Assets/Scripts/Business/Runtime/FGUI/Player/MainPanel/PlayerMainPanelCtrl.cs
  16. 3 43
      Assets/Scripts/Business/Runtime/FGUI/Player/MainPanel/PlayerMainPanelVM.Gen.cs
  17. 5 1
      Assets/Scripts/Business/Runtime/Network/Controllers/ActJobClassPushCtrl.cs

binární
Assets/Res/Addressable/FGUI/Equip/Equip_fui.bytes


binární
Assets/Res/Addressable/FGUI/Player/Player_atlas0.png


binární
Assets/Res/Addressable/FGUI/Player/Player_fui.bytes


+ 1 - 1
Assets/Scripts/Business/Runtime/Data/PlayerData.cs

@@ -18,7 +18,7 @@ namespace FL.Data
         public string Name { get; set; }
 
         private RunePlanName[] _runePlanNamesArray;// 方案名列表
-        public RunePlanName[] RunePlanNamesArray => _runePlanNamesArray ?? new RunePlanName[6];
+        public RunePlanName[] RunePlanNamesArray => _runePlanNamesArray ??= new RunePlanName[6];
 
         private Attributes _attr;
         public Attributes Attr => _attr ??= ObjectPool.Acquire<Attributes>();

+ 1 - 1
Assets/Scripts/Business/Runtime/FGUI/Common/RenamePanel/CommonRenamePanelCtrl.cs

@@ -65,7 +65,7 @@ namespace FL.FGUI
             }
             else
             {
-                EventSingle.Instance.Notify(EventDefine.ShowTips, StringDefine.commonRenameEmpty);
+                Context.ShowTips(StringDefine.commonRenameEmpty);
             }
         }
 

+ 9 - 3
Assets/Scripts/Business/Runtime/FGUI/Player/AwakePanel/PlayerAwakePanelCtrl.cs

@@ -169,7 +169,7 @@ namespace FL.FGUI
         {
             _selectImprint = 0;
             _selectPlanIndex = PlayerData.Instance.CurPlanIndex;
-            SelectPlanNameItem(0);
+            SelectPlanNameItem(_selectPlanIndex);
             if (_imprintItemList == null) 
             {
                 _imprintItemList = new List<PlayerImprintItemNestedCtrl> 
@@ -261,6 +261,7 @@ namespace FL.FGUI
                     _imprintItemList[i].ShowUI(i,_runeIdArray[i], OnclcickImprintItem);
                 }
             }
+            OnclcickImprintItem(_selectImprint);
         }
 
         /// <summary>
@@ -302,6 +303,10 @@ namespace FL.FGUI
         private void OnclcickImprintItem(int imprintIndex)
         {
             ShowImprintItemUI(imprintIndex);
+            for (int i = 0; i < _imprintItemList.Count; i++)
+            {
+                _imprintItemList[i].ShowSelectUI(i == imprintIndex);
+            }
         }
 
         /// <summary>
@@ -338,7 +343,8 @@ namespace FL.FGUI
             var imprintInfo = _runeTableList[index];
             if (imprintInfo != null) 
             {
-                int runeType = (runeId - index * 10000) / 1000;
+                int a = (runeId - (index + 1) * 10000);
+                int runeType = (runeId - (index+1) * 10000) / 1000 - 1;
                 VM.ImprintNameLabel.text = imprintInfo.Name[runeType];
                 if (bShowChangeImprintBtn && imprintInfo.Handoff.Length == 1) bShowChangeImprintBtn = false;
             }
@@ -449,7 +455,7 @@ namespace FL.FGUI
         }
         private  void SelectPlanNameItem(int index)
         {
-            if (index >= 0)
+            if (index >= 0 && PlayerData.Instance.RunePlanNamesArray.Length > 0)
             {
                 VM.PlansNameBtn.title = PlayerData.Instance.RunePlanNamesArray[index].name;
             }

+ 1 - 0
Assets/Scripts/Business/Runtime/FGUI/Player/ImprintItemNested/PlayerImprintItemNestedCtrl.cs

@@ -52,6 +52,7 @@ namespace FL.FGUI
         {
             _imprintIndex = index;
             _onClickCallback = callback;
+            ShowSelectUI(false);
             var runeInfo = rune_levelTableRepo.Get(runeId);
             if (runeInfo != null) 
             {

+ 8 - 0
Assets/Scripts/Business/Runtime/FGUI/Player/JokSkillNested.meta

@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: C34evCqpVCpm+GBiZGT0GXbliwRmdM0SFyydblqrEANcTdkutf7zju4=
+folderAsset: yes
+DefaultImporter:
+  externalObjects: {}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 324 - 0
Assets/Scripts/Business/Runtime/FGUI/Player/JokSkillNested/PlayerJokSkillNestedCtrl.cs

@@ -0,0 +1,324 @@
+/// #pkgName FGUI包名
+/// #panelName UIPanel名字
+/// #UIName = $"{#pkgName}{#panelName}" UIKey名字
+/// 该脚本由模板创建
+/// created by cb 2024
+
+using FairyGUI;
+using FL.Data;
+using System;
+using System.Collections.Generic;
+using XGame.Database;
+using XGame.Framework.UI;
+
+namespace FL.FGUI
+{
+    /// <summary>
+    /// 职业(主|被)技能
+    /// </summary>
+    public struct JobSkillParam
+    {
+        public int unlockLv;
+        public int skillId;
+        public Action<int, int> onclickSkillIcon;
+    }
+
+    /// <summary>
+    /// UI逻辑处理类
+    /// </summary>
+    /// <typeparam name=""></typeparam>
+    public partial class PlayerJokSkillNestedCtrl : UIController<PlayerJokSkillNestedVM>
+    {
+        private int _skillId; // 当前主动技能id
+        private careerTable _jobInfo; // 当前职业信息
+        private JobSkillParam[] _passiveSkillDataArray; // 被动技能数据列表
+        private Dictionary<EAttributeType, string> _attributeDescMap;
+
+        protected override void OnEnable(object intent)
+        {
+            AddUIListenres();
+            AddEventListener();
+        }
+        protected override void OnDisable()
+        {
+            RemoveUIListenres();
+            RemoveEventListener();
+            ShowSkillInfoGroup(false);
+            if (_attributeDescMap != null)
+            {
+                _attributeDescMap.Clear();
+                _attributeDescMap = null;
+            }
+            _jobInfo = null;
+            if (_passiveSkillDataArray != null) _passiveSkillDataArray = null;
+        }
+        #region UI事件
+        private void AddUIListenres()
+        {
+            VM.AttrInfoBtn.onClick.Add(OnClickAttrInfoBtn);
+            VM.JobBtn.onClick.Add(OnClickJobBtn);
+            VM.SkillBtn.onClick.Add(OnClickSkillBtn);
+            VM.WakeUpBtn.onClick.Add(OnClickWakeUpBtn);
+            VM.TransferBtn.onClick.Add(OnClickTransferBtn);
+            VM.HideSkillInfoGroupBtn.onClick.Add(OnClickHideSkillInfoGroupBtn);
+
+        }
+        private void RemoveUIListenres()
+        {
+            VM.AttrInfoBtn.onClick.Remove(OnClickAttrInfoBtn);
+            VM.JobBtn.onClick.Remove(OnClickJobBtn);
+            VM.SkillBtn.onClick.Remove(OnClickSkillBtn);
+            VM.WakeUpBtn.onClick.Remove(OnClickWakeUpBtn);
+            VM.TransferBtn.onClick.Remove(OnClickTransferBtn);
+            VM.HideSkillInfoGroupBtn.onClick.Remove(OnClickHideSkillInfoGroupBtn);
+
+        }
+        private void OnClickAttrInfoBtn(EventContext context)
+        {
+            Context.UI.OpenAsync(UIKeys.PlayerDetailsAttribute);
+        }
+        /// <summary>
+        /// 职业(整个线路图)预览
+        /// </summary>
+        /// <param name="context"></param>
+        private void OnClickJobBtn(EventContext context)
+        {
+            Context.ShowTips("职业(整个线路图)预览");
+        }
+        private void OnClickSkillBtn(EventContext context)
+        {
+            if (_skillId > 0)
+                OnClickSkillIcon(_skillId, -1);
+        }
+        /// <summary>
+        /// 觉醒按钮
+        /// </summary>
+        /// <param name="context"></param>
+        private void OnClickWakeUpBtn(EventContext context)
+        {
+            Context.UI.OpenAsync(UIKeys.PlayerAwakePanel);
+        }
+        /// <summary>
+        /// 转职按钮
+        /// </summary>
+        /// <param name="context"></param>
+        private void OnClickTransferBtn(EventContext context)
+        {
+            // 分条件满足和不满足的(相当于展示下阶职业的预览ui)显示  
+            // 当前是否最高级职业
+            if (_jobInfo.Job_change?.Length > 0)
+            {
+                Context.UI.OpenAsync(UIKeys.PlayerTransferPanel, false);
+            }
+            else
+            {
+                OnClickJobBtn(null);
+            }
+        }
+        /// <summary>
+        /// 隐藏技能信息提示框
+        /// </summary>
+        /// <param name="context"></param>
+        private void OnClickHideSkillInfoGroupBtn(EventContext context)
+        {
+            ShowSkillInfoGroup(false);
+        }
+
+        #endregion
+
+        private void AddEventListener()
+        {
+            EventSingle.Instance.AddListener(EventDefine.AttributeChange, OnChangeAttribute); // 角色属性变化
+
+        }
+        private void RemoveEventListener()
+        {
+            EventSingle.Instance.RemoveListener(EventDefine.AttributeChange, OnChangeAttribute); // 角色属性变化
+        }
+
+        public void Init()
+        {
+            if (_attributeDescMap == null)
+            {
+                _attributeDescMap = new Dictionary<EAttributeType, string>()
+                {
+                    {EAttributeType.Atk, GetAttributeDesc(EAttributeType.Atk)},
+                    {EAttributeType.Hp, GetAttributeDesc(EAttributeType.Hp)},
+                    {EAttributeType.Def, GetAttributeDesc(EAttributeType.Def)},
+                    { EAttributeType.AtkSpeed, GetAttributeDesc(EAttributeType.AtkSpeed)}
+                };
+            }
+            InitPassiveSkillDataList();
+            ShowSkillInfoGroup(false);
+        }
+        public void ShowAttributeUI()
+        {
+            ShowAtrributeVal(VM.AtkLabel, EAttributeType.Atk);
+            ShowAtrributeVal(VM.HpLabel, EAttributeType.Hp);
+            ShowAtrributeVal(VM.DefLabel, EAttributeType.Def);
+            ShowAtrributeVal(VM.AtkSpeedLabel, EAttributeType.AtkSpeed, true);
+        }
+
+        private string GetAttributeDesc(EAttributeType attrType)
+        {
+            var attrInfo = AttrDescTableRepo.Get((int)attrType);
+            return attrInfo?.ShowName ?? string.Empty;
+        }
+
+        /// <summary>
+        /// 角色属性变化
+        /// </summary>
+        /// <param name="eventId"></param>
+        /// <param name="args"></param>
+        private void OnChangeAttribute(int eventId, object args)
+        {
+            EAttributeType attrType = (EAttributeType)args;
+            if (attrType == EAttributeType.Atk)
+            {
+                ShowAtrributeVal(VM.AtkLabel, EAttributeType.Atk);
+            }
+            else if (attrType == EAttributeType.Hp)
+            {
+                ShowAtrributeVal(VM.HpLabel, EAttributeType.Hp);
+            }
+            else if (attrType == EAttributeType.Def)
+            {
+                ShowAtrributeVal(VM.DefLabel, EAttributeType.Def);
+            }
+            else if (attrType == EAttributeType.AtkSpeed)
+            {
+                ShowAtrributeVal(VM.AtkSpeedLabel, EAttributeType.AtkSpeed, true);
+            }
+        }
+
+        
+        private void ShowAtrributeVal(GTextField attrLabel, EAttributeType attrType, bool bAtkSpeed = false)
+        {
+            var attrVal = PlayerData.Instance.Attr.GetValue(attrType);
+            attrLabel.text = $"{_attributeDescMap[attrType]}:{(bAtkSpeed ? TableUtils.ToRealDouble(attrVal).ToString("F1") : attrVal.ToString())}";
+        }
+
+
+        public void ShowJobUI()
+        {
+            _jobInfo = careerTableRepo.Get(PlayerData.Instance.JobId);
+            if (_jobInfo == null) return;
+
+            int playerLv = PlayerData.Instance.Level;
+            VM.JobNameLabel.text = _jobInfo.Name;
+            VM.TransfersCountLabel.text = _jobInfo.Change_times.ToString(); // 转职次数
+            // 当前是否最高级职业
+            bool bSuperlative = _jobInfo.Job_change.Length == 0;
+            if (!bSuperlative)
+            {
+                var advanceInfo = careerTableRepo.Get(_jobInfo.Job_change[0]);
+                if (advanceInfo == null)
+                {
+                    bSuperlative = true;
+                }
+                else
+                {
+                    VM.UnlockLabel.text = string.Format(StringDefine.UnlockAdvanceJob, playerLv, advanceInfo.Unlock);
+                }
+            }
+            VM.SuperlativeCtrl.selectedIndex = bSuperlative ? 1 : 0;
+            ShowJobSkillUI(_jobInfo.Skill);
+            ShowJobPassiveSkillUI(_jobInfo.Passive_skill);
+            ShowWakeUpBtn(_jobInfo.Change_times > 4); // 若角色转职未达到五阶段,将隐藏觉醒按钮
+        }
+
+        /// <summary>
+        /// 是否显示觉醒按钮
+        /// </summary>
+        /// <param name="bShow"></param>
+        private void ShowWakeUpBtn(bool bShow)
+        {
+            VM.WakeUpBtn.visible = bShow;
+        }
+
+
+        /// <summary>
+        /// 点击技能图标
+        /// </summary>
+        /// <param name="skillId"></param>
+        private void OnClickSkillIcon(int skillId, int index)
+        {
+            var skillInfo = SkillTableRepo.Get(skillId);
+            if (skillInfo == null) return;
+
+            VM.SkillInfoTipCtrl.selectedIndex = index == -1 ? 0 : (index + 1);
+            ShowSkillInfoGroup(true, skillInfo);
+        }
+
+        /// <summary>
+        /// 显示技能弹窗信息UI
+        /// </summary>
+        /// <param name="Show"></param>
+        /// <param name="bPassive"></param>
+        private void ShowSkillInfoGroup(bool bShow, SkillTable skillInfo = null)
+        {
+            VM.SkillInfoGroup.visible = bShow;
+            VM.HideSkillInfoGroupBtn.visible = bShow;
+            if (bShow && skillInfo != null)
+            {
+                VM.SkillIcon.icon = skillInfo.Icon;
+                VM.SkillNameLabel.text = skillInfo.Name;
+                VM.SkillDescLabel.text = skillInfo.Desc;
+                if (skillInfo.ModalityType == 1) // 主动技能
+                {
+                    VM.SkillCdLabel.text = (skillInfo.RestTime * 0.001f).ToString("F1");
+                }
+            }
+        }
+
+        /// <summary>
+        /// 职业主动技能UI(解锁等级|技能id|技能等级)
+        /// </summary>
+        private void ShowJobSkillUI(int[] skillIds)
+        {
+            if (skillIds.Length > 1)
+            {
+                _skillId = skillIds[1];
+                var skillInfo = SkillTableRepo.Get(skillIds[1]);
+                if (skillInfo != null)
+                {
+                    VM.JobSkillLabel.text = skillInfo.Name;
+                    VM.SkillBtn.icon = skillInfo.Icon;
+                }
+            }
+            else
+            {
+                _skillId = 0;
+            }
+        }
+
+        private void InitPassiveSkillDataList()
+        {
+            if (_passiveSkillDataArray == null || _passiveSkillDataArray.Length == 0)
+            {
+                _passiveSkillDataArray = new JobSkillParam[5];
+            }
+        }
+
+        /// <summary>
+        /// 职业被动技能UI
+        /// </summary>
+        private void ShowJobPassiveSkillUI(int[] skillIds)
+        {
+            int index = 0;
+            for (int i = 0; i < skillIds.Length; i += 2)
+            {
+                _passiveSkillDataArray[index] = new JobSkillParam()
+                {
+                    unlockLv = skillIds[i],
+                    skillId = skillIds[i + 1],
+                    onclickSkillIcon = OnClickSkillIcon
+                };
+                index++;
+            }
+            VM.PassiveSkillList.BindDatas(_passiveSkillDataArray);
+        }
+
+        
+    }
+}

+ 11 - 0
Assets/Scripts/Business/Runtime/FGUI/Player/JokSkillNested/PlayerJokSkillNestedCtrl.cs.meta

@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: DSkbtymsW38wIlP/pUNpaJy0jQ0zglpjwwNtMkz5O5jz+4p+mi/IgA0=
+MonoImporter:
+  externalObjects: {}
+  serializedVersion: 2
+  defaultReferences: []
+  executionOrder: 0
+  icon: {instanceID: 0}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 74 - 0
Assets/Scripts/Business/Runtime/FGUI/Player/JokSkillNested/PlayerJokSkillNestedVM.Gen.cs

@@ -0,0 +1,74 @@
+/// #pkgName FGUI包名
+/// #panelName UIPanel名字
+/// #UIName = $"{#pkgName}{#panelName}" UIKey名字
+/// #PropertyDefineArea 属性定义区域
+/// #PropertyAssignArea 属性赋值区域
+/// #ComponentType 组件类型
+/// #PropertyName 属性名字
+/// 该脚本由模板创建,不可编辑
+/// created by cb 2024
+using FairyGUI;
+using XGame.Framework.FGUI;
+using XGame.Framework.UI;
+
+namespace FL.FGUI
+{
+    /// <summary>
+    /// 该脚本由模板创建,不可修改,不可编辑
+    /// </summary>
+    public partial class PlayerJokSkillNestedVM : FguiViewModel
+    {
+        public Controller SuperlativeCtrl { get; private set; }
+        public Controller SkillInfoTipCtrl { get; private set; }
+        public GTextField HpLabel { get; private set; }
+        public GTextField DefLabel { get; private set; }
+        public GTextField AtkLabel { get; private set; }
+        public GTextField AtkSpeedLabel { get; private set; }
+        public GButton AttrInfoBtn { get; private set; }
+        public GButton JobBtn { get; private set; }
+        public GButton SkillBtn { get; private set; }
+        public GTextField TransfersCountLabel { get; private set; }
+        public GTextField JobNameLabel { get; private set; }
+        public GTextField JobSkillLabel { get; private set; }
+        public GTextField JobUnLockLabel { get; private set; }
+        public GList PassiveSkillList { get; private set; }
+        public GTextField UnlockLabel { get; private set; }
+        public GButton WakeUpBtn { get; private set; }
+        public GButton TransferBtn { get; private set; }
+        public GButton HideSkillInfoGroupBtn { get; private set; }
+        public GLoader SkillIcon { get; private set; }
+        public GTextField SkillNameLabel { get; private set; }
+        public GTextField SkillCdLabel { get; private set; }
+        public GTextField SkillDescLabel { get; private set; }
+        public GGroup SkillInfoGroup { get; private set; }
+
+        protected override void BindComponents(GComponent panel, IUIViewAdapter adapter)
+        {
+            SuperlativeCtrl = panel.GetController("SuperlativeCtrl");
+            SkillInfoTipCtrl = panel.GetController("SkillInfoTipCtrl");
+            HpLabel = panel.GetChild("HpLabel") as GTextField;
+            DefLabel = panel.GetChild("DefLabel") as GTextField;
+            AtkLabel = panel.GetChild("AtkLabel") as GTextField;
+            AtkSpeedLabel = panel.GetChild("AtkSpeedLabel") as GTextField;
+            AttrInfoBtn = panel.GetChild("AttrInfoBtn") as GButton;
+            JobBtn = panel.GetChild("JobBtn") as GButton;
+            SkillBtn = panel.GetChild("SkillBtn") as GButton;
+            TransfersCountLabel = panel.GetChild("TransfersCountLabel") as GTextField;
+            JobNameLabel = panel.GetChild("JobNameLabel") as GTextField;
+            JobSkillLabel = panel.GetChild("JobSkillLabel") as GTextField;
+            JobUnLockLabel = panel.GetChild("JobUnLockLabel") as GTextField;
+            PassiveSkillList = panel.GetChild("PassiveSkillList") as GList;
+            PassiveSkillList.Init(typeof(PlayerPassiveSkillListItemView), adapter.CreateListItem);
+            UnlockLabel = panel.GetChild("UnlockLabel") as GTextField;
+            WakeUpBtn = panel.GetChild("WakeUpBtn") as GButton;
+            TransferBtn = panel.GetChild("TransferBtn") as GButton;
+            HideSkillInfoGroupBtn = panel.GetChild("HideSkillInfoGroupBtn") as GButton;
+            SkillIcon = panel.GetChild("SkillIcon") as GLoader;
+            SkillNameLabel = panel.GetChild("SkillNameLabel") as GTextField;
+            SkillCdLabel = panel.GetChild("SkillCdLabel") as GTextField;
+            SkillDescLabel = panel.GetChild("SkillDescLabel") as GTextField;
+            SkillInfoGroup = panel.GetChild("SkillInfoGroup") as GGroup;
+
+        }
+    }
+}

+ 11 - 0
Assets/Scripts/Business/Runtime/FGUI/Player/JokSkillNested/PlayerJokSkillNestedVM.Gen.cs.meta

@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: WShNsS/+UXLkFk64yb/H0UJ4SCoiIG391IAHfTTRLqHqp+trflyvoKA=
+MonoImporter:
+  externalObjects: {}
+  serializedVersion: 2
+  defaultReferences: []
+  executionOrder: 0
+  icon: {instanceID: 0}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 23 - 0
Assets/Scripts/Business/Runtime/FGUI/Player/JokSkillNested/PlayerJokSkillNestedView.cs

@@ -0,0 +1,23 @@
+/// #pkgName FGUI包名
+/// #panelName UIPanel名字
+/// #UIName = $"{#pkgName}{#panelName}" UIKey名字
+/// 该脚本由模板创建
+/// created by cb 2024
+
+using XGame.Framework.UI;
+
+namespace FL.FGUI
+{
+    public static partial class UINestedKeys
+    {
+        private static UIKey _PlayerJokSkillNested;
+        public static UIKey PlayerJokSkillNested => _PlayerJokSkillNested ?? (_PlayerJokSkillNested = new UIKey("Player", "JokSkillNested", typeof(PlayerJokSkillNestedView)));
+    }
+    public partial class PlayerJokSkillNestedView : NestedView<PlayerJokSkillNestedCtrl, PlayerJokSkillNestedVM>
+    {
+        protected override void OnDispose()
+        {
+        }
+    }
+}
+

+ 11 - 0
Assets/Scripts/Business/Runtime/FGUI/Player/JokSkillNested/PlayerJokSkillNestedView.cs.meta

@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: WX4dtCj/ACozo5JEUxq4StVELafPAzK3wInUru7kJilUO+SJU+UNA50=
+MonoImporter:
+  externalObjects: {}
+  serializedVersion: 2
+  defaultReferences: []
+  executionOrder: 0
+  icon: {instanceID: 0}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 13 - 270
Assets/Scripts/Business/Runtime/FGUI/Player/MainPanel/PlayerMainPanelCtrl.cs

@@ -7,7 +7,6 @@
 using FairyGUI;
 using FL.Data;
 using FL.Data.Items;
-using System;
 using System.Collections.Generic;
 using XGame.Database;
 using XGame.Framework.UI;
@@ -15,27 +14,12 @@ using XGame.Framework.UI;
 namespace FL.FGUI
 {
     /// <summary>
-    /// 职业(主|被)技能
-    /// </summary>
-    public struct JobSkillParam
-    {
-        public int unlockLv;
-        public int skillId;
-        public Action<int,int> onclickSkillIcon;
-    }
-
-    /// <summary>
     /// UI逻辑处理类
     /// </summary>
     /// <typeparam name=""></typeparam>
     public partial class PlayerMainPanelCtrl : UIController<PlayerMainPanelVM>
     {
-        private int _index;
-        private int _skillId; // 当前主动技能id
-        private careerTable _jobInfo; // 当前职业信息
         private List<CommonItemBaseView> _equipItemList;
-        private JobSkillParam[] _passiveSkillDataArray; // 被动技能数据列表
-        private Dictionary<EAttributeType, string> _attributeDescMap;
 
         protected override void OnEnable(object intent)
         {
@@ -48,65 +32,41 @@ namespace FL.FGUI
         {
             RemoveUIListenres();
             RemoveEventListener();
-            ShowSkillInfoGroup(false);
             if (_equipItemList != null)
             {
                 _equipItemList.Clear();
                 _equipItemList = null;
             }
 
-            if (_attributeDescMap != null)
-            {
-                _attributeDescMap.Clear();
-                _attributeDescMap = null;
-            }
             VM.PlayerSpine.url = string.Empty;
-            _jobInfo = null;
-            if (_passiveSkillDataArray != null) _passiveSkillDataArray = null;
         }
         #region UI事件
         private void AddUIListenres()
         {
-            VM.AttrInfoBtn.onClick.Add(OnClickAttrInfoBtn);
-            VM.SkillBtn.onClick.Add(OnClickSkillBtn);
-            //VM.ChangeBtn.onClick.Add(OnClickChangeBtn);
             VM.MountBtn.onClick.Add(OnClickMountBtn);
             VM.ArtifactBtn.onClick.Add(OnClickArtifactBtn);
             VM.ContractBtn.onClick.Add(OnClickContractBtn);
             VM.JewelryBtn.onClick.Add(OnClickJewelryBtn);
             VM.NotOpenBtn1.onClick.Add(OnClickNotOpenBtn1);
             VM.NotOpenBtn2.onClick.Add(OnClickNotOpenBtn2);
-            VM.TransferBtn.onClick.Add(OnClickTransferBtn);
-            VM.WakeUpBtn.onClick.Add(OnClickWakeUpBtn);
-            VM.JobBtn.onClick.Add(OnClickJobBtn);
-            VM.HideSkillInfoGroupBtn.onClick.Add(OnClickHideSkillInfoGroupBtn);
+            VM.UpgradeLvBtn.onClick.Add(OnClickUpgradeLvBtn);
         }
         private void RemoveUIListenres()
         {
-            VM.AttrInfoBtn.onClick.Remove(OnClickAttrInfoBtn);
-            VM.SkillBtn.onClick.Remove(OnClickSkillBtn);
-            //VM.ChangeBtn.onClick.Remove(OnClickChangeBtn);
             VM.MountBtn.onClick.Remove(OnClickMountBtn);
             VM.ArtifactBtn.onClick.Remove(OnClickArtifactBtn);
             VM.ContractBtn.onClick.Remove(OnClickContractBtn);
             VM.JewelryBtn.onClick.Remove(OnClickJewelryBtn);
             VM.NotOpenBtn1.onClick.Remove(OnClickNotOpenBtn1);
             VM.NotOpenBtn2.onClick.Remove(OnClickNotOpenBtn2);
-            VM.TransferBtn.onClick.Remove(OnClickTransferBtn);
-            VM.WakeUpBtn.onClick.Remove(OnClickWakeUpBtn);
-            VM.JobBtn.onClick.Remove(OnClickJobBtn);
-            VM.HideSkillInfoGroupBtn.onClick.Add(OnClickHideSkillInfoGroupBtn);
+            VM.UpgradeLvBtn.onClick.Remove(OnClickUpgradeLvBtn);
         }
 
-        private void OnClickAttrInfoBtn(EventContext context)
+        private void OnClickUpgradeLvBtn(EventContext context)
         {
-            Context.UI.OpenAsync(UIKeys.PlayerDetailsAttribute);
-        }
-        private void OnClickSkillBtn(EventContext context)
-        {
-            if (_skillId > 0)
-                OnClickSkillIcon(_skillId, -1);
+            Context.ShowTips("一键使用经验道具进行升级事件");
         }
+
         private void OnClickChangeBtn(EventContext context)
         {
             Context.ShowTips("更换契约技能");
@@ -136,54 +96,10 @@ namespace FL.FGUI
             Context.ShowTips(StringDefine.notOpen);
         }
 
-        /// <summary>
-        /// 转职按钮
-        /// </summary>
-        /// <param name="context"></param>
-        private void OnClickTransferBtn(EventContext context)
-        {
-            // 分条件满足和不满足的(相当于展示下阶职业的预览ui)显示  
-            // 当前是否最高级职业
-            if (_jobInfo.Job_change?.Length > 0)
-            {
-                Context.UI.OpenAsync(UIKeys.PlayerTransferPanel, false);
-            }
-            else
-            {
-                OnClickJobBtn(null);
-            }
-        }
-        /// <summary>
-        /// 觉醒按钮
-        /// </summary>
-        /// <param name="context"></param>
-        private void OnClickWakeUpBtn(EventContext context)
-        {
-            Context.UI.OpenAsync(UIKeys.PlayerAwakePanel);
-        }
-        /// <summary>
-        /// 职业(整个线路图)预览
-        /// </summary>
-        /// <param name="context"></param>
-        private void OnClickJobBtn(EventContext context)
-        {
-            Context.ShowTips("职业(整个线路图)预览");
-        }
-
-        /// <summary>
-        /// 隐藏技能信息提示框
-        /// </summary>
-        /// <param name="context"></param>
-        private void OnClickHideSkillInfoGroupBtn(EventContext context) 
-        {
-            ShowSkillInfoGroup(false);
-        }
-
         #endregion
         private void AddEventListener()
         {
             EventSingle.Instance.AddListener(EventDefine.OnChangeEquip, OnChangeEquip);
-            EventSingle.Instance.AddListener(EventDefine.AttributeChange, OnChangeAttribute); // 角色属性变化
             EventSingle.Instance.AddListener(EventDefine.PlayerExpAdd, AddPlayerExp);
             EventSingle.Instance.AddListener(EventDefine.RefreshWearEquipUI, RefreshWearEquipUI);
             EventSingle.Instance.AddListener(EventDefine.TransferSucess, TransferSucess);
@@ -192,7 +108,6 @@ namespace FL.FGUI
         private void RemoveEventListener()
         {
             EventSingle.Instance.RemoveListener(EventDefine.OnChangeEquip, OnChangeEquip);
-            EventSingle.Instance.RemoveListener(EventDefine.AttributeChange, OnChangeAttribute); // 角色属性变化
             EventSingle.Instance.RemoveListener(EventDefine.PlayerExpAdd, AddPlayerExp);
             EventSingle.Instance.RemoveListener(EventDefine.RefreshWearEquipUI, RefreshWearEquipUI);
             EventSingle.Instance.RemoveListener(EventDefine.TransferSucess, TransferSucess);
@@ -208,18 +123,9 @@ namespace FL.FGUI
                     VM.Weapon,VM.Helmet,VM.Clothes,VM.Hand,VM.Pants,VM.Boots
                 };
             }
-            if (_attributeDescMap == null)
-            {
-                _attributeDescMap = new Dictionary<EAttributeType, string>()
-                {
-                    {EAttributeType.Atk, GetAttributeDesc(EAttributeType.Atk)},
-                    {EAttributeType.Hp, GetAttributeDesc(EAttributeType.Hp)},
-                    {EAttributeType.Def, GetAttributeDesc(EAttributeType.Def)},
-                    { EAttributeType.AtkSpeed, GetAttributeDesc(EAttributeType.AtkSpeed)}
-                };
-            }
-            InitPassiveSkillDataList();
-            ShowSkillInfoGroup(false);
+
+            VM.JokSkillNested.Ctrl.Init();
+
             PlayerService.Instance.SendToEquipInto();
         }
 
@@ -231,7 +137,7 @@ namespace FL.FGUI
             //ShowContractSkills(201711);
             LoadPlayerSpine("info_job_1001_1_SkeletonData");
 
-            ShowJobUI();
+            VM.JokSkillNested.Ctrl.ShowJobUI();
         }
 
         /// <summary>
@@ -319,10 +225,7 @@ namespace FL.FGUI
             VM.NameLabel.text = PlayerData.Instance.Name;
             ShowPlayerLevel();
             ShowExp(false);
-            ShowAtrributeVal(VM.AtkLabel, EAttributeType.Atk);
-            ShowAtrributeVal(VM.HpLabel, EAttributeType.Hp);
-            ShowAtrributeVal(VM.DefLabel, EAttributeType.Def);
-            ShowAtrributeVal(VM.AtkSpeedLabel, EAttributeType.AtkSpeed, true);
+            VM.JokSkillNested.Ctrl.ShowAttributeUI();
         }
         private void ShowPlayerLevel()
         {
@@ -354,166 +257,8 @@ namespace FL.FGUI
             ShowExp();
         }
 
-        private string GetAttributeDesc(EAttributeType attrType)
-        {
-            var attrInfo = AttrDescTableRepo.Get((int)attrType);
-            return attrInfo?.ShowName ?? string.Empty;
-        }
-
-        /// <summary>
-        /// 角色属性变化
-        /// </summary>
-        /// <param name="eventId"></param>
-        /// <param name="args"></param>
-        private void OnChangeAttribute(int eventId, object args)
-        {
-            EAttributeType attrType = (EAttributeType)args;
-            if (attrType == EAttributeType.Atk)
-            {
-                ShowAtrributeVal(VM.AtkLabel, EAttributeType.Atk);
-            }
-            else if (attrType == EAttributeType.Hp)
-            {
-                ShowAtrributeVal(VM.HpLabel, EAttributeType.Hp);
-            }
-            else if (attrType == EAttributeType.Def)
-            {
-                ShowAtrributeVal(VM.DefLabel, EAttributeType.Def);
-            }
-            else if (attrType == EAttributeType.AtkSpeed)
-            {
-                ShowAtrributeVal(VM.AtkSpeedLabel, EAttributeType.AtkSpeed, true);
-            }
-        }
-        private void ShowAtrributeVal(GTextField attrLabel, EAttributeType attrType, bool bAtkSpeed = false)
-        {
-            var attrVal = PlayerData.Instance.Attr.GetValue(attrType);
-            attrLabel.text = $"{_attributeDescMap[attrType]}:{(bAtkSpeed ? TableUtils.ToRealDouble(attrVal).ToString("F1") : attrVal.ToString())}";
-        }
-
         #endregion
 
-        #region 职业信息
-        private void ShowJobUI()
-        {
-            _jobInfo = careerTableRepo.Get(PlayerData.Instance.JobId);
-            if (_jobInfo == null) return;
-
-            int playerLv = PlayerData.Instance.Level;
-            VM.JobNameLabel.text = _jobInfo.Name;
-            VM.TransfersCountLabel.text = _jobInfo.Change_times.ToString(); // 转职次数
-            // 当前是否最高级职业
-            bool bSuperlative = _jobInfo.Job_change.Length == 0;
-            if (!bSuperlative)
-            {
-                var advanceInfo = careerTableRepo.Get(_jobInfo.Job_change[0]);
-                if (advanceInfo == null) 
-                {
-                    bSuperlative = true;
-                }
-                else
-                {
-                    VM.UnlockLabel.text = string.Format(StringDefine.UnlockAdvanceJob, playerLv, advanceInfo.Unlock);
-                }
-            }
-            VM.SuperlativeCtrl.selectedIndex = bSuperlative ? 1 : 0;
-            ShowJobSkillUI(_jobInfo.Skill);
-            ShowJobPassiveSkillUI(_jobInfo.Passive_skill);
-            ShowWakeUpBtn(_jobInfo.Change_times > 4); // 若角色转职未达到五阶段,将隐藏觉醒按钮
-        }
-
-
-        /// <summary>
-        /// 是否显示觉醒按钮
-        /// </summary>
-        /// <param name="bShow"></param>
-        private void ShowWakeUpBtn(bool bShow)
-        {
-            VM.WakeUpBtn.visible = bShow;
-        }
-
-        /// <summary>
-        /// 职业主动技能UI(解锁等级|技能id|技能等级)
-        /// </summary>
-        private void ShowJobSkillUI(int[] skillIds)
-        {
-            if (skillIds.Length > 1)
-            {
-                _skillId = skillIds[1];
-                var skillInfo = SkillTableRepo.Get(skillIds[1]);
-                if (skillInfo != null)
-                {
-                    VM.JobSkillLabel.text = skillInfo.Name;
-                    VM.SkillBtn.icon = skillInfo.Icon;
-                }
-            }
-            else
-            {
-                _skillId = 0;
-            }
-        }
-
-        private void InitPassiveSkillDataList()
-        {
-            if (_passiveSkillDataArray == null || _passiveSkillDataArray.Length == 0)
-            {
-                _passiveSkillDataArray = new JobSkillParam[5];
-            }
-        }
-
-        /// <summary>
-        /// 职业被动技能UI
-        /// </summary>
-        private void ShowJobPassiveSkillUI(int[] skillIds)
-        {
-            int index = 0;
-            for (int i = 0; i < skillIds.Length; i += 2)
-            {
-                _passiveSkillDataArray[index] = new JobSkillParam()
-                {
-                    unlockLv = skillIds[i],
-                    skillId = skillIds[i + 1],
-                    onclickSkillIcon = OnClickSkillIcon
-                };
-                index++;
-            }
-            VM.PassiveSkillList.BindDatas(_passiveSkillDataArray);
-        }
-
-        /// <summary>
-        /// 点击技能图标
-        /// </summary>
-        /// <param name="skillId"></param>
-        private void OnClickSkillIcon(int skillId, int index)
-        {
-            var skillInfo = SkillTableRepo.Get(skillId);
-            if (skillInfo == null) return;
-
-            VM.SkillInfoTipCtrl.selectedIndex = index == -1 ? 0 : (index+1);
-            ShowSkillInfoGroup(true, skillInfo);
-        }
-
-        /// <summary>
-        /// 显示技能弹窗信息UI
-        /// </summary>
-        /// <param name="Show"></param>
-        /// <param name="bPassive"></param>
-        private void ShowSkillInfoGroup(bool bShow, SkillTable skillInfo = null)
-        {
-            VM.SkillInfoGroup.visible = bShow;
-            VM.HideSkillInfoGroupBtn.visible = bShow;
-            if (bShow && skillInfo != null)
-            {
-                VM.SkillIcon.icon = skillInfo.Icon;
-                VM.SkillNameLabel.text = skillInfo.Name;
-                VM.SkillDescLabel.text = skillInfo.Desc;
-                if (skillInfo.ModalityType == 1) // 主动技能
-                {
-                    VM.SkillCdLabel.text = (skillInfo.RestTime * 0.001f).ToString("F1");
-                }
-            }
-        }
-
         /// <summary>
         /// 转职成功
         /// </summary>
@@ -522,7 +267,7 @@ namespace FL.FGUI
         private void TransferSucess(int eventId, object args)
         {
             Context.UI.OpenAsync(UIKeys.PlayerTransferSucessPanel);
-            ShowJobUI();
+            VM.JokSkillNested.Ctrl.ShowJobUI();
         }
 
         /// <summary>
@@ -532,10 +277,8 @@ namespace FL.FGUI
         /// <param name="args"></param>
         private void ResetJobSucess(int eventId, object args)
         {
-            Context.UI.OpenAsync(UIKeys.PlayerTransferPanel,true);
-            ShowJobUI();
+            Context.UI.OpenAsync(UIKeys.PlayerTransferPanel, true);
+            VM.JokSkillNested.Ctrl.ShowJobUI();
         }
-
-        #endregion
     }
 }

+ 3 - 43
Assets/Scripts/Business/Runtime/FGUI/Player/MainPanel/PlayerMainPanelVM.Gen.cs

@@ -32,33 +32,13 @@ namespace FL.FGUI
         public GTextField NameLabel { get; private set; }
         public GTextField LvLabl { get; private set; }
         public GButton UpgradeLvBtn { get; private set; }
+        public PlayerJokSkillNestedView JokSkillNested { get; private set; }
         public GButton MountBtn { get; private set; }
         public GButton ArtifactBtn { get; private set; }
         public GButton ContractBtn { get; private set; }
         public GButton JewelryBtn { get; private set; }
         public GButton NotOpenBtn1 { get; private set; }
         public GButton NotOpenBtn2 { get; private set; }
-        public GTextField HpLabel { get; private set; }
-        public GTextField DefLabel { get; private set; }
-        public GTextField AtkLabel { get; private set; }
-        public GTextField AtkSpeedLabel { get; private set; }
-        public GButton AttrInfoBtn { get; private set; }
-        public GButton JobBtn { get; private set; }
-        public GButton SkillBtn { get; private set; }
-        public GTextField TransfersCountLabel { get; private set; }
-        public GTextField JobNameLabel { get; private set; }
-        public GTextField JobSkillLabel { get; private set; }
-        public GTextField JobUnLockLabel { get; private set; }
-        public GList PassiveSkillList { get; private set; }
-        public GTextField UnlockLabel { get; private set; }
-        public GButton WakeUpBtn { get; private set; }
-        public GButton TransferBtn { get; private set; }
-        public GButton HideSkillInfoGroupBtn { get; private set; }
-        public GLoader SkillIcon { get; private set; }
-        public GTextField SkillNameLabel { get; private set; }
-        public GTextField SkillCdLabel { get; private set; }
-        public GTextField SkillDescLabel { get; private set; }
-        public GGroup SkillInfoGroup { get; private set; }
 
         protected override void BindComponents(GComponent panel, IUIViewAdapter adapter)
         {
@@ -82,34 +62,14 @@ namespace FL.FGUI
             NameLabel = panel.GetChild("NameLabel") as GTextField;
             LvLabl = panel.GetChild("LvLabl") as GTextField;
             UpgradeLvBtn = panel.GetChild("UpgradeLvBtn") as GButton;
+            JokSkillNested = adapter.CreateNested<PlayerJokSkillNestedView>(new FguiNested(panel.GetChild("JokSkillNested").asCom), true);
+            AddChild(JokSkillNested);
             MountBtn = panel.GetChild("MountBtn") as GButton;
             ArtifactBtn = panel.GetChild("ArtifactBtn") as GButton;
             ContractBtn = panel.GetChild("ContractBtn") as GButton;
             JewelryBtn = panel.GetChild("JewelryBtn") as GButton;
             NotOpenBtn1 = panel.GetChild("NotOpenBtn1") as GButton;
             NotOpenBtn2 = panel.GetChild("NotOpenBtn2") as GButton;
-            HpLabel = panel.GetChild("HpLabel") as GTextField;
-            DefLabel = panel.GetChild("DefLabel") as GTextField;
-            AtkLabel = panel.GetChild("AtkLabel") as GTextField;
-            AtkSpeedLabel = panel.GetChild("AtkSpeedLabel") as GTextField;
-            AttrInfoBtn = panel.GetChild("AttrInfoBtn") as GButton;
-            JobBtn = panel.GetChild("JobBtn") as GButton;
-            SkillBtn = panel.GetChild("SkillBtn") as GButton;
-            TransfersCountLabel = panel.GetChild("TransfersCountLabel") as GTextField;
-            JobNameLabel = panel.GetChild("JobNameLabel") as GTextField;
-            JobSkillLabel = panel.GetChild("JobSkillLabel") as GTextField;
-            JobUnLockLabel = panel.GetChild("JobUnLockLabel") as GTextField;
-            PassiveSkillList = panel.GetChild("PassiveSkillList") as GList;
-            PassiveSkillList.Init(typeof(PlayerPassiveSkillListItemView), adapter.CreateListItem);
-            UnlockLabel = panel.GetChild("UnlockLabel") as GTextField;
-            WakeUpBtn = panel.GetChild("WakeUpBtn") as GButton;
-            TransferBtn = panel.GetChild("TransferBtn") as GButton;
-            HideSkillInfoGroupBtn = panel.GetChild("HideSkillInfoGroupBtn") as GButton;
-            SkillIcon = panel.GetChild("SkillIcon") as GLoader;
-            SkillNameLabel = panel.GetChild("SkillNameLabel") as GTextField;
-            SkillCdLabel = panel.GetChild("SkillCdLabel") as GTextField;
-            SkillDescLabel = panel.GetChild("SkillDescLabel") as GTextField;
-            SkillInfoGroup = panel.GetChild("SkillInfoGroup") as GGroup;
 
         }
     }

+ 5 - 1
Assets/Scripts/Business/Runtime/Network/Controllers/ActJobClassPushCtrl.cs

@@ -22,7 +22,11 @@ namespace FL.Network
             // 方案列表
             if (message.runePlanName != null) 
             {
-
+                var runePlanNamesArray = PlayerData.Instance.RunePlanNamesArray;
+                foreach (var item in message.runePlanName)
+                {
+                    runePlanNamesArray[item.id - 1] = item;
+                }
             }
 
             // 方案加点数据