Browse Source

修改心境

lzx 2 days ago
parent
commit
364071583c

+ 35 - 0
Assets/Res/Config/SentimentEffectConfig.json

@@ -2,6 +2,7 @@
   "configList": [
     {
       "ID": 101,
+      "groupId": 1,
       "level": 1,
       "name": 3022,
       "icon": "icon",
@@ -15,6 +16,7 @@
     },
     {
       "ID": 102,
+      "groupId": 1,
       "level": 2,
       "name": 3022,
       "icon": "icon",
@@ -28,6 +30,7 @@
     },
     {
       "ID": 103,
+      "groupId": 1,
       "level": 3,
       "name": 3022,
       "icon": "icon",
@@ -41,6 +44,7 @@
     },
     {
       "ID": 104,
+      "groupId": 1,
       "level": 4,
       "name": 3022,
       "icon": "icon",
@@ -54,6 +58,7 @@
     },
     {
       "ID": 105,
+      "groupId": 1,
       "level": 5,
       "name": 3022,
       "icon": "icon",
@@ -67,6 +72,7 @@
     },
     {
       "ID": 201,
+      "groupId": 2,
       "level": 1,
       "name": 3023,
       "icon": "icon",
@@ -80,6 +86,7 @@
     },
     {
       "ID": 202,
+      "groupId": 2,
       "level": 2,
       "name": 3023,
       "icon": "icon",
@@ -93,6 +100,7 @@
     },
     {
       "ID": 203,
+      "groupId": 2,
       "level": 3,
       "name": 3023,
       "icon": "icon",
@@ -106,6 +114,7 @@
     },
     {
       "ID": 204,
+      "groupId": 2,
       "level": 4,
       "name": 3023,
       "icon": "icon",
@@ -119,6 +128,7 @@
     },
     {
       "ID": 205,
+      "groupId": 2,
       "level": 5,
       "name": 3023,
       "icon": "icon",
@@ -132,6 +142,7 @@
     },
     {
       "ID": 301,
+      "groupId": 3,
       "level": 1,
       "name": 3022,
       "icon": "icon",
@@ -145,6 +156,7 @@
     },
     {
       "ID": 302,
+      "groupId": 3,
       "level": 2,
       "name": 3022,
       "icon": "icon",
@@ -158,6 +170,7 @@
     },
     {
       "ID": 303,
+      "groupId": 3,
       "level": 3,
       "name": 3022,
       "icon": "icon",
@@ -171,6 +184,7 @@
     },
     {
       "ID": 304,
+      "groupId": 3,
       "level": 4,
       "name": 3022,
       "icon": "icon",
@@ -184,6 +198,7 @@
     },
     {
       "ID": 305,
+      "groupId": 3,
       "level": 5,
       "name": 3022,
       "icon": "icon",
@@ -197,6 +212,7 @@
     },
     {
       "ID": 401,
+      "groupId": 4,
       "level": 1,
       "name": 3023,
       "icon": "icon",
@@ -210,6 +226,7 @@
     },
     {
       "ID": 402,
+      "groupId": 4,
       "level": 2,
       "name": 3023,
       "icon": "icon",
@@ -223,6 +240,7 @@
     },
     {
       "ID": 403,
+      "groupId": 4,
       "level": 3,
       "name": 3023,
       "icon": "icon",
@@ -236,6 +254,7 @@
     },
     {
       "ID": 404,
+      "groupId": 4,
       "level": 4,
       "name": 3023,
       "icon": "icon",
@@ -249,6 +268,7 @@
     },
     {
       "ID": 405,
+      "groupId": 4,
       "level": 5,
       "name": 3023,
       "icon": "icon",
@@ -262,6 +282,7 @@
     },
     {
       "ID": 501,
+      "groupId": 5,
       "level": 1,
       "name": 3022,
       "icon": "icon",
@@ -275,6 +296,7 @@
     },
     {
       "ID": 502,
+      "groupId": 5,
       "level": 2,
       "name": 3022,
       "icon": "icon",
@@ -288,6 +310,7 @@
     },
     {
       "ID": 503,
+      "groupId": 5,
       "level": 3,
       "name": 3022,
       "icon": "icon",
@@ -301,6 +324,7 @@
     },
     {
       "ID": 504,
+      "groupId": 5,
       "level": 4,
       "name": 3022,
       "icon": "icon",
@@ -314,6 +338,7 @@
     },
     {
       "ID": 505,
+      "groupId": 5,
       "level": 5,
       "name": 3022,
       "icon": "icon",
@@ -327,6 +352,7 @@
     },
     {
       "ID": 601,
+      "groupId": 6,
       "level": 1,
       "name": 3023,
       "icon": "icon",
@@ -340,6 +366,7 @@
     },
     {
       "ID": 602,
+      "groupId": 6,
       "level": 2,
       "name": 3023,
       "icon": "icon",
@@ -353,6 +380,7 @@
     },
     {
       "ID": 603,
+      "groupId": 6,
       "level": 3,
       "name": 3023,
       "icon": "icon",
@@ -366,6 +394,7 @@
     },
     {
       "ID": 604,
+      "groupId": 6,
       "level": 4,
       "name": 3023,
       "icon": "icon",
@@ -379,6 +408,7 @@
     },
     {
       "ID": 605,
+      "groupId": 6,
       "level": 5,
       "name": 3023,
       "icon": "icon",
@@ -392,6 +422,7 @@
     },
     {
       "ID": 701,
+      "groupId": 7,
       "level": 1,
       "name": 3022,
       "icon": "icon",
@@ -406,6 +437,7 @@
     },
     {
       "ID": 702,
+      "groupId": 7,
       "level": 2,
       "name": 3022,
       "icon": "icon",
@@ -420,6 +452,7 @@
     },
     {
       "ID": 703,
+      "groupId": 7,
       "level": 3,
       "name": 3022,
       "icon": "icon",
@@ -434,6 +467,7 @@
     },
     {
       "ID": 704,
+      "groupId": 7,
       "level": 4,
       "name": 3022,
       "icon": "icon",
@@ -448,6 +482,7 @@
     },
     {
       "ID": 705,
+      "groupId": 7,
       "level": 5,
       "name": 3022,
       "icon": "icon",

+ 6 - 0
Assets/Scripts/GameData/ExcelConfig/SentimentEffectConfig.cs

@@ -20,6 +20,12 @@ namespace Excel2Json
 public int ID;
 
 
+		/// <summary>
+		///id组
+		/// </summary>
+public int groupId;
+
+
 		/// <summary>
 		///等级
 		/// </summary>

+ 1 - 1
Assets/Scripts/GameLogic/Player/AccountFileInfo.cs

@@ -139,7 +139,7 @@ public class AccountFileInfo : Singleton<AccountFileInfo>
         // 属性类别
         public int groupId;
         // 词条档位
-        public int level = 1;
+        public int level = 0;
   
     }
 

+ 2 - 1
Assets/Scripts/GameUI/UI/DialoguePanel/DialogueBubblePanel.cs

@@ -123,7 +123,8 @@ namespace Fort23.Mono
                 case ShowDialogueEventData.MessageShowType.Verbatim:
                     _sb.Clear();
                     _currShowMessage = m.ToCharArray();
-                    _sb.Append(_currShowMessage[0]);
+                    if(_currShowMessage.Length > 0)
+                        _sb.Append(_currShowMessage[0]);
                     message.text = _sb.ToString();
                     _isUpdate = true;
                     _currShowIndex = 1;

+ 45 - 10
Assets/Scripts/GameUI/UI/SentimentPanel/SentimentInfoPanel.cs

@@ -1,4 +1,5 @@
 using System.Collections.Generic;
+using System.Linq;
 using Core.Language;
 using Excel2Json;
 using Fort23.Core;
@@ -15,10 +16,15 @@ namespace Fort23.Mono
 
         List<SentimentEffectWidget> sentimentEffectWidgets = new List<SentimentEffectWidget>();
 
+        private List<SentimentEffectConfig> _sentimentEffectConfigs;
+
+        private List<SentimentEffectConfig> currentGroupSentimentEffectConfigs;
+
         private void Init()
         {
             isAddStack = false;
             isPopUi = true;
+            IsShowAppBar = false;
         }
 
         protected override void AddEvent()
@@ -32,11 +38,37 @@ namespace Fort23.Mono
         public override void AddButtonEvent()
         {
             Btn_Close.onClick.AddListener(() => { UIManager.Instance.HideUIUIPanel(this); });
+            Btn_LingWu.onClick.AddListener(() =>
+            {
+                if (curretnSentimentProperty == null)
+                {
+                    return;
+                }
+
+                if (curretnSentimentProperty.level >= currentGroupSentimentEffectConfigs.Count)
+                {
+                    TipMessagePanel.OpenTipMessagePanel("已经达到最大等级");
+                    return;
+                }
+                int level = curretnSentimentProperty.level <= 0 ? 1 : curretnSentimentProperty.level;
+                int conFigId = curretnSentimentProperty.groupId * 100 + level;
+                SentimentEffectConfig sentimentEffectConfig = ConfigComponent.Instance.Get<SentimentEffectConfig>(conFigId);
+
+                //扣除道具
+                // sentimentEffectConfig.upConstItemId.
+                // s
+
+                curretnSentimentProperty.level++;
+
+                AccountFileInfo.Instance.SavePlayerData();
+                UpdateUi();
+            });
         }
 
         public async override CTask<bool> AsyncInit(object[] uiData)
         {
             sentimentData = uiData[0] as AccountFileInfo.SentimentData;
+            _sentimentEffectConfigs = ConfigComponent.Instance.GetAll<SentimentEffectConfig>().ToList();
             SentimentEffectWidget sentimentEffectWidget = await UIManager.Instance.CreateGComponentForObject<SentimentEffectWidget>(MainSentimentEffectWidget, null);
             sentimentEffectWidget.CustomInit(sentimentData.mainSentiment);
             sentimentEffectWidget.OnClick = OnClick;
@@ -51,21 +83,23 @@ namespace Fort23.Mono
             return await base.AsyncInit(uiData);
         }
 
-        // private void UpdateUi(SentimentEffectConfig sentimentEffectConfig)
-        // {
-        //
-        // }
+        private void UpdateUi()
+        {
+            int level = curretnSentimentProperty.level <= 0 ? 1 : curretnSentimentProperty.level;
+            int conFigId = curretnSentimentProperty.groupId * 100 + level;
+            SentimentEffectConfig sentimentEffectConfig = ConfigComponent.Instance.Get<SentimentEffectConfig>(conFigId);
+            currentGroupSentimentEffectConfigs = _sentimentEffectConfigs.Where(se => se.groupId == sentimentEffectConfig.groupId).ToList();
+            Text_Name.text = LanguageManager.Instance.Text(sentimentEffectConfig.name);
+            Text_Desc.text = UtilTools.GetString(LanguageManager.Instance.Text(sentimentEffectConfig.massge), sentimentEffectConfig.effectVale);
+            Text_Level.text = $"当前层 ;{curretnSentimentProperty.level}/{currentGroupSentimentEffectConfigs.Count}";
+        }
 
         private void OnClick(ItemWidgetBasic obj)
         {
             SentimentEffectWidget sentimentEffectWidget = obj as SentimentEffectWidget;
             curretnSentimentProperty = sentimentEffectWidget.sentimentProperty;
-            int conFigId = sentimentEffectWidget.sentimentProperty.groupId * 100 + sentimentEffectWidget.sentimentProperty.level;
-            SentimentEffectConfig sentimentEffectConfig = ConfigComponent.Instance.Get<SentimentEffectConfig>(conFigId);
-            Text_Name.text = LanguageManager.Instance.Text(sentimentEffectConfig.name);
-            Text_Desc.text = UtilTools.GetString(LanguageManager.Instance.Text(sentimentEffectConfig.massge), sentimentEffectConfig.effectVale);
-            Text_Level.text = $"当前层 ;{curretnSentimentProperty.level}/{5}";
-            // UpdateUi(sentimentEffectConfig);
+
+            UpdateUi();
         }
 
         public static async CTask OpenPanel(AccountFileInfo.SentimentData sentimentData)
@@ -79,6 +113,7 @@ namespace Fort23.Mono
             {
                 UIManager.Instance.DormancyGComponent(sentimentEffectWidget);
             }
+
             sentimentEffectWidgets.Clear();
 
             base.Close();

+ 6 - 3
Assets/Scripts/GameUI/UI/SentimentPanel/SentimentPanel.cs

@@ -7,7 +7,8 @@ namespace Fort23.Mono
 	{
 		private void Init()
 		{
-
+			isAddStack = true;
+			IsShowAppBar = false;
 		}
 		protected override void AddEvent()
 		{
@@ -15,11 +16,13 @@ namespace Fort23.Mono
 		}
 		protected override void DelEvent()
 		{
-
 		}
 		public override void AddButtonEvent()
 		{
-
+			Btn_Close.onClick.AddListener(() =>
+			{
+				UIManager.Instance.HideUIUIPanel(this);
+			});
 		}
 
 		public async override CTask<bool> AsyncInit(object[] uiData)

BIN
Excel2Json/Excel/Sentiment.xlsx