zhaoyang 2 жил өмнө
parent
commit
edf79f5f8a

+ 1 - 1
FGUIProject/assets/League/components/ListSkillLayerItem.xml

@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>
-<component size="740,123">
+<component size="740,123" overflow="hidden">
   <displayList>
     <list id="n14_pvb4" name="listSkill" xy="0,0" size="740,123" layout="row" colGap="100" defaultItem="ui://tw70qm9dpvb45d" align="center">
       <relation target="" sidePair="center-center"/>

+ 10 - 3
FGUIProject/assets/RoleInfo/components/ComBtn.xml

@@ -25,8 +25,8 @@
       <Button title="设置玩家章节" titleFontSize="30"/>
     </component>
     <text id="n18_lqp0" name="txtChapter" xy="333,245" size="44,42" group="n27_ysx9" fontSize="30" autoSize="none" text="5" input="true" prompt="[color=#B6A688]章[/color]"/>
-    <text id="n24_lqp0" name="n24" xy="454,246" size="33,41" group="n27_ysx9" fontSize="30" text="关"/>
-    <text id="n21_lqp0" name="n21" xy="377,245" size="33,41" group="n27_ysx9" fontSize="30" text="章"/>
+    <text id="n24_lqp0" name="n24" xy="454,246" size="34,41" group="n27_ysx9" fontSize="30" text="关"/>
+    <text id="n21_lqp0" name="n21" xy="377,245" size="34,41" group="n27_ysx9" fontSize="30" text="章"/>
     <text id="n19_lqp0" name="txtChapterLv" xy="411,245" size="42,42" group="n27_ysx9" fontSize="30" autoSize="none" text="1" input="true" prompt="[color=#B6A688]关[/color]"/>
     <group id="n27_ysx9" name="n27" xy="1,244" size="487,46" group="n28_ysx9" advanced="true">
       <gearDisplay controller="c1" pages="0,1"/>
@@ -39,6 +39,13 @@
     <group id="n40_u10a" name="n40" xy="0,305" size="482,46" group="n28_ysx9" advanced="true" layout="hz" colGap="2">
       <gearDisplay controller="c1" pages="0"/>
     </group>
-    <group id="n28_ysx9" name="n28" xy="0,0" size="488,351" advanced="true" layout="vt" lineGap="15" excludeInvisibles="true"/>
+    <component id="n41_gfx4" name="btnLeagueSkill" src="c5sc8h" fileName="components/ButtonGM.xml" xy="0,366" size="330,46" group="n44_gfx4">
+      <Button title="学习茶艺技能" titleFontSize="30"/>
+    </component>
+    <text id="n42_gfx4" name="txtskillType" xy="332,367" size="92,42" group="n44_gfx4" fontSize="30" autoSize="none" text="" input="true" prompt="[color=#666666]第N层[/color]"/>
+    <group id="n44_gfx4" name="n44" xy="0,366" size="424,46" group="n28_ysx9" advanced="true" layout="hz" colGap="2">
+      <gearDisplay controller="c1" pages="0"/>
+    </group>
+    <group id="n28_ysx9" name="n28" xy="0,0" size="488,412" advanced="true" layout="vt" lineGap="15" excludeInvisibles="true"/>
   </displayList>
 </component>

+ 14 - 3
GameClient/Assets/Game/HotUpdate/Data/LeagueDataManager.cs

@@ -12,7 +12,7 @@ namespace GFGGame
     public class LeagueDataManager : SingletonBase<LeagueDataManager>
     {
         public int Type = 2;// 1:已经加入军团 2:未加入军团
-        public int CurType { get { return Math.Max(GameGlobal.myNumericComponent.GetAsInt(NumericType.LeagueSkillMaxType), 1); } }
+        public int MaxFinishType { get { return GetSkillCurType(); } }
         public int CurLayer { get { return Math.Max(GameGlobal.myNumericComponent.GetAsInt(NumericType.LeagueSkillMaxLayer), 1); } }
         public LeagueData LeagueData;//联盟信息
         public int HallLevel { get { return (int)GetNumeriValue(LeagueNumericType.HallLevel); } }
@@ -117,6 +117,7 @@ namespace GFGGame
             int score = 0;
             foreach (int key in SkillDataManager.Instance.LeagueSkillScoreDatas.Keys)
             {
+
                 score += SkillDataManager.Instance.LeagueSkillScoreDatas[key][scoreType];
             }
             return score;
@@ -126,6 +127,7 @@ namespace GFGGame
         {
             int score = 0;
             if (!SkillDataManager.Instance.LeagueSkillScoreDatas.ContainsKey(skillType)) return score;
+            if (!SkillDataManager.Instance.LeagueSkillScoreDatas[skillType].ContainsKey(scoreType)) return score;
             return SkillDataManager.Instance.LeagueSkillScoreDatas[skillType][scoreType];
         }
         //检测一个技能是否激活
@@ -134,13 +136,22 @@ namespace GFGGame
             if (!SkillDataManager.Instance.LeagueSkillDatas.ContainsKey(skillType)) return false;
             return SkillDataManager.Instance.LeagueSkillDatas[skillType].IndexOf(skillId) >= 0;
         }
+        private int GetSkillCurType()
+        {
+            LeagueSkillCountCfg[] skillCountCfgs = LeagueSkillCountCfgArray.Instance.dataArray;
+            for (int i = 0; i < skillCountCfgs.Length; i++)
+            {
+                if (GetSkillProgressByType(skillCountCfgs[i].type) < 100) return skillCountCfgs[i].type - 1;
+            }
+            return skillCountCfgs[skillCountCfgs.Length - 1].type;
+        }
 
         //根据技能类型获取该类型进度
         public double GetSkillProgressByType(int skillType)
         {
             LeagueSkillCountCfg skillCountCfg = LeagueSkillCountCfgArray.Instance.GetCfg(skillType);
-            if (skillCountCfg.type - CurType < 0) return 100;
-            if (skillCountCfg.type - CurType > 0) return 0;
+            // if (skillCountCfg.type - CurType < 0) return 100;
+            // if (skillCountCfg.type - CurType > 0) return 0;
 
             float count = !SkillDataManager.Instance.LeagueSkillDatas.ContainsKey(skillType) ? 0 : SkillDataManager.Instance.LeagueSkillDatas[skillType].Count;
             float maxCount = skillCountCfg.skillCount;

+ 9 - 5
GameClient/Assets/Game/HotUpdate/Data/SkillDataManager.cs

@@ -63,19 +63,23 @@ namespace GFGGame
                     for (int i = 0; i < skillIds.Count; i++)
                     {
                         LeagueSkillCfg skillCfg = LeagueSkillCfgArray.Instance.GetCfg(skillIds[i]);
+                        if (skillIds[i] == 105)
+                        {
+                            Debug.Log("");
+                        }
                         if (!LeagueSkillDatas.ContainsKey(skillCfg.type))
                         {
                             LeagueSkillDatas.Add(skillCfg.type, new List<int>());
                             LeagueSkillScoreDatas.Add(skillCfg.type, new Dictionary<int, int>());
-                            LeagueSkillScoreDatas[skillType][ConstDressUpScoreType.SCORE_FENG] = 0;
-                            LeagueSkillScoreDatas[skillType][ConstDressUpScoreType.SCORE_HUA] = 0;
-                            LeagueSkillScoreDatas[skillType][ConstDressUpScoreType.SCORE_XUE] = 0;
-                            LeagueSkillScoreDatas[skillType][ConstDressUpScoreType.SCORE_YUE] = 0;
+                            LeagueSkillScoreDatas[skillCfg.type][ConstDressUpScoreType.SCORE_FENG] = 0;
+                            LeagueSkillScoreDatas[skillCfg.type][ConstDressUpScoreType.SCORE_HUA] = 0;
+                            LeagueSkillScoreDatas[skillCfg.type][ConstDressUpScoreType.SCORE_XUE] = 0;
+                            LeagueSkillScoreDatas[skillCfg.type][ConstDressUpScoreType.SCORE_YUE] = 0;
                         }
                         if (LeagueSkillDatas[skillCfg.type].IndexOf(skillIds[i]) < 0)
                         {
                             LeagueSkillDatas[skillCfg.type].Add(skillIds[i]);
-                            LeagueSkillScoreDatas[skillType][skillCfg.score] = LeagueSkillScoreDatas[skillType][skillCfg.score] + skillCfg.value;
+                            LeagueSkillScoreDatas[skillCfg.type][skillCfg.score] = LeagueSkillScoreDatas[skillCfg.type][skillCfg.score] + skillCfg.value;
                         }
                     }
                     break;

+ 6 - 0
GameClient/Assets/Game/HotUpdate/FairyGUI/GenCode/RoleInfo/UI_ComBtn.cs

@@ -19,6 +19,8 @@ namespace UI.RoleInfo
         public GButton m_btnArenaGrade;
         public GTextInput m_txtArenaGrade;
         public GTextInput m_txtArenaRank;
+        public GButton m_btnLeagueSkill;
+        public GTextInput m_txtskillType;
         public const string URL = "ui://374k3dwvlqp0dm";
         public const string PACKAGE_NAME = "RoleInfo";
         public const string RES_NAME = "ComBtn";
@@ -78,6 +80,8 @@ namespace UI.RoleInfo
             m_btnArenaGrade = (GButton)comp.GetChild("btnArenaGrade");
             m_txtArenaGrade = (GTextInput)comp.GetChild("txtArenaGrade");
             m_txtArenaRank = (GTextInput)comp.GetChild("txtArenaRank");
+            m_btnLeagueSkill = (GButton)comp.GetChild("btnLeagueSkill");
+            m_txtskillType = (GTextInput)comp.GetChild("txtskillType");
         }
         public void Dispose(bool disposeTarget = false)
         {
@@ -93,6 +97,8 @@ namespace UI.RoleInfo
             m_btnArenaGrade = null;
             m_txtArenaGrade = null;
             m_txtArenaRank = null;
+            m_btnLeagueSkill = null;
+            m_txtskillType = null;
             if(disposeTarget && target != null)
             {
                 target.RemoveFromParent();

+ 4 - 4
GameClient/Assets/Game/HotUpdate/Views/League/LeagueSkillUpView.cs

@@ -56,9 +56,9 @@ namespace GFGGame
             _valueBarController.OnShown();
             _valueBarController.Controller(11);
             _ui.m_list.numItems = LeagueSkillCountCfgArray.Instance.GetCfg(_type).layerCount;
-            if (LeagueDataManager.Instance.GetSkillProgressByType(_type) < 100)
+            if (LeagueDataManager.Instance.GetSkillProgressByType(_type) < 100 && LeagueDataManager.Instance.GetSkillProgressByType(_type) > 0)
             {
-                _ui.m_list.ScrollToView(LeagueDataManager.Instance.CurLayer);
+                _ui.m_list.ScrollToView(LeagueDataManager.Instance.CurLayer - 1);
             }
             UpdateView();
         }
@@ -93,7 +93,7 @@ namespace GFGGame
         {
             UI_ListScoreItem item = UI_ListScoreItem.Proxy(obj);
             item.m_loaIcon.url = ResPathUtil.GetScorePath(index + 1);
-            item.m_txtProperty.text = LeagueDataManager.Instance.GetAllSkillScore(index + 1).ToString();
+            item.m_txtProperty.text = LeagueDataManager.Instance.GetSkillScoreByType(_type, index + 1).ToString();
             UI_ListScoreItem.ProxyEnd();
         }
         private void RenderListItem(int index, GObject obj)
@@ -137,7 +137,7 @@ namespace GFGGame
             List<LeagueSkillCfg> lastSkillCfgs = LeagueSkillCfgArray.Instance.GetCfgsBytypeAndlayer(_type, skillCfg.layer - 1);
             for (int i = 0; i < lastSkillCfgs.Count; i++)
             {
-                if (SkillDataManager.Instance.LeagueSkillDatas[_type].IndexOf(lastSkillCfgs[i].id) < 0)
+                if (!SkillDataManager.Instance.LeagueSkillDatas.ContainsKey(_type) || SkillDataManager.Instance.LeagueSkillDatas[_type].IndexOf(lastSkillCfgs[i].id) < 0)
                 {
                     return;
                 }

+ 4 - 3
GameClient/Assets/Game/HotUpdate/Views/League/LeagueSkillView.cs

@@ -57,7 +57,7 @@ namespace GFGGame
             _ui.m_list.numItems = LeagueSkillCountCfgArray.Instance.dataArray.Length;
             if (LeagueDataManager.Instance.GetSkillProgressByType(_ui.m_list.numItems) < 100)
             {
-                _ui.m_list.ScrollToView(LeagueDataManager.Instance.CurType - 1);
+                _ui.m_list.ScrollToView(LeagueDataManager.Instance.MaxFinishType);
             }
         }
 
@@ -92,7 +92,8 @@ namespace GFGGame
         {
             LeagueSkillCountCfg skillCountCfg = LeagueSkillCountCfgArray.Instance.dataArray[index];
             UI_ListSkillTypeItem item = UI_ListSkillTypeItem.Proxy(obj);
-            if (skillCountCfg.type <= LeagueDataManager.Instance.CurType)
+            int maxFinishType = LeagueDataManager.Instance.MaxFinishType;
+            if (skillCountCfg.type <= maxFinishType + 1)
             {
                 item.m_txtTitle.text = string.Format("茶艺-{0}", skillCountCfg.name);
             }
@@ -116,7 +117,7 @@ namespace GFGGame
         {
             GObject obj = context.sender as GObject;
             int type = (int)obj.data;
-            if (type > LeagueDataManager.Instance.CurType)
+            if (type > LeagueDataManager.Instance.MaxFinishType + 1)
             {
                 PromptController.Instance.ShowFloatTextPrompt("学完前一类所有技能开启");
                 return;

+ 33 - 0
GameClient/Assets/Game/HotUpdate/Views/RoleInfo/GMPanelView.cs

@@ -1,4 +1,5 @@
 using FairyGUI;
+using System.Collections.Generic;
 using System.Text.RegularExpressions;
 using UI.RoleInfo;
 
@@ -33,6 +34,7 @@ namespace GFGGame
             _ui.m_ComBtn.m_btnSetChapter.onClick.Add(OnClickBtnSetChapter);
             _ui.m_ComBtn.m_btnAll.onClick.Add(OnClickBtnAll);
             _ui.m_ComBtn.m_btnArenaGrade.onClick.Add(OnClickBtnArenaGrade);
+            _ui.m_ComBtn.m_btnLeagueSkill.onClick.Add(OnClickBtnLeagueSkill);
             _ui.m_btnAddItem.onClick.Add(OnClickBtnAddItem);
             _ui.m_btnGM.onClick.Add(OnClickBtnGM);
         }
@@ -140,6 +142,37 @@ namespace GFGGame
             }
         }
 
+        private async void OnClickBtnLeagueSkill()
+        {
+            int _type = int.Parse(_ui.m_ComBtn.m_txtskillType.text);
+            List<LeagueSkillCfg> skillCfgs = LeagueSkillCfgArray.Instance.GetCfgsBytype(_type);
+            for (int i = 0; i < skillCfgs.Count; i++)
+            {
+                int skillId = skillCfgs[i].id;
+                if (SkillDataManager.Instance.LeagueSkillDatas.ContainsKey(_type) && SkillDataManager.Instance.LeagueSkillDatas[_type].IndexOf(skillId) >= 0)
+                {
+                    continue;
+                }
+                LeagueSkillCfg skillCfg = LeagueSkillCfgArray.Instance.GetCfg(skillId);
+                // List<LeagueSkillCfg> lastSkillCfgs = LeagueSkillCfgArray.Instance.GetCfgsBytypeAndlayer(_type, skillCfg.layer - 1);
+                // for (int j = 0; j < lastSkillCfgs.Count; j++)
+                // {
+                //     if (!SkillDataManager.Instance.LeagueSkillDatas.ContainsKey(_type) || SkillDataManager.Instance.LeagueSkillDatas[_type].IndexOf(lastSkillCfgs[j].id) < 0)
+                //     {
+                //         return;
+                //     }
+                // }
+                long needCount = skillCfg.consumeArr[0][1];
+                long hasCount = ItemDataManager.GetItemNum(skillCfg.consumeArr[0][0]);
+                if (hasCount < needCount)
+                {
+                    PromptController.Instance.ShowFloatTextPrompt("ÏûºÄ²»×ã");
+                    break;
+                }
+                await SkillSProxy.ReqActiveSkill(SkillType.LeagueSkill, skillId);
+            }
+            PromptController.Instance.ShowFloatTextPrompt("ѧϰ½áÊø");
+        }
         private async void OnClickBtnAll()
         {
             bool result = await StorageSProxy.ReqSetClientValue(ConstStorageId.STORAGE_SKIP_GUIDE, 2);

BIN
GameClient/Assets/ResIn/Config/excelConfig.sqlite.bytes


BIN
GameClient/Assets/ResIn/UI/League/League_fui.bytes


BIN
GameClient/Assets/ResIn/UI/RoleInfo/RoleInfo_fui.bytes