Browse Source

Merge branch 'master' of http://192.168.123.2:3000/ck/XiuXianGame

zg 3 ngày trước cách đây
mục cha
commit
161cbf0fa5

+ 1 - 1
Assets/Res/UI/SkillSelectPanel/GongFaUpgradePanel.prefab

@@ -1634,7 +1634,7 @@ GameObject:
   m_Icon: {fileID: 0}
   m_NavMeshLayer: 0
   m_StaticEditorFlags: 0
-  m_IsActive: 1
+  m_IsActive: 0
 --- !u!224 &3050497527537795491
 RectTransform:
   m_ObjectHideFlags: 0

+ 27 - 18
Assets/Scripts/GameUI/UI/DaoYouPanel/DaoYouInfoPanel.cs

@@ -17,6 +17,8 @@ namespace Fort23.Mono
 
         private DaoyouModelConfig _daoyouModelConfig;
 
+        private WidgetItem currentSelectWidgetItem;
+
         List<WidgetItem> widgetItems = new List<WidgetItem>();
         List<WidgetItem> giveWidgetItems = new List<WidgetItem>();
         List<DaoYouLevelWidget> _daoYouLevelWidgets = new List<DaoYouLevelWidget>();
@@ -43,16 +45,10 @@ namespace Fort23.Mono
 
         public override void AddButtonEvent()
         {
-            Btn_CiZuiHelp.onClick.AddListener(() =>
-            {
-                HelpTipPanel.OpenTipMessagePanel(10791);
-            });
-            
-            Btn_SongLiHelp.onClick.AddListener(() =>
-            {
-                HelpTipPanel.OpenTipMessagePanel(10790);
-            });
-            
+            Btn_CiZuiHelp.onClick.AddListener(() => { HelpTipPanel.OpenTipMessagePanel(10791); });
+
+            Btn_SongLiHelp.onClick.AddListener(() => { HelpTipPanel.OpenTipMessagePanel(10790); });
+
             Btn_Emotion.onClick.AddListener((() => { ShowMessage(); }));
 
             Btn_Facorability.onClick.AddListener(() =>
@@ -117,6 +113,7 @@ namespace Fort23.Mono
             Btn_Back.onClick.AddListener(() =>
             {
                 ClosePoolGive();
+                currentSelectWidgetItem = null;
                 GiveGite.gameObject.SetActive(false);
                 AppBarPanel.OpenPanel(this);
             });
@@ -164,13 +161,14 @@ namespace Fort23.Mono
                         //喜好礼物翻倍
                         if (_daoyouModelConfig.PreferGiftID.Contains(daoyouGiftConfig.ItemID))
                         {
-                            daoYouData.exp += (int)(daoyouGiftConfig.emotionValue * bl * 0.001f * PlayerManager.Instance.gameConstantConfig.daolvfavoratePara * 0.01f);
+                            daoYouData.exp += (int)(daoyouGiftConfig.emotionValue * bl * 0.001f *
+                                                    PlayerManager.Instance.gameConstantConfig.daolvfavoratePara *
+                                                    0.01f);
                         }
                         else
                         {
                             daoYouData.exp += (int)(daoyouGiftConfig.emotionValue * bl * 0.001f);
                         }
-                       
                     }
 
 
@@ -225,7 +223,8 @@ namespace Fort23.Mono
             Text_message.text = LanguageManager.Instance.Text(emotionConfig.des);
             ShowMessage();
             Icon_bodyIcon.icon_name = _daoyouModelConfig.bodyIcon;
-            Icon_bodyIcon.GetComponent<RectTransform>().anchoredPosition = new Vector2(_daoyouModelConfig.bodyPos[0],_daoyouModelConfig.bodyPos[1]);
+            Icon_bodyIcon.GetComponent<RectTransform>().anchoredPosition =
+                new Vector2(_daoyouModelConfig.bodyPos[0], _daoyouModelConfig.bodyPos[1]);
             await UpdateUI();
             return await base.AsyncInit(uiData);
         }
@@ -283,7 +282,7 @@ namespace Fort23.Mono
                 Btn_Eveent.gameObject.SetActive(false);
             }
 
-            Slider_Emotion.fillAmount = daoYouData.emotionValue / 100;
+            Slider_Emotion.fillAmount = daoYouData.emotionValue / 100f;
 
             HeroPowerUpConfig heroPowerUpConfig =
                 ConfigComponent.Instance.Get<HeroPowerUpConfig>(PlayerManager.Instance.GetDaoYouLevel(daoYouData));
@@ -323,7 +322,9 @@ namespace Fort23.Mono
             Text_CurrentName.text = LanguageManager.Instance.Text(currentDaoyouLevelupConfig.name);
             Text_CurrentLevel.text = daoYouData.favorabilityLv.ToString();
             Slider_LeveUp.maxValue = currentDaoyouLevelupConfig.exp;
-            if (daoYouData.favorabilityLv >= _daoYouLevelWidgets.Count)
+
+            DaoyouLevelupConfig[] configs = ConfigComponent.Instance.GetAll<DaoyouLevelupConfig>();
+            if (daoYouData.favorabilityLv >= configs.Length)
             {
                 Text_Exp.text = $"{daoYouData.exp}/MAX";
             }
@@ -332,7 +333,7 @@ namespace Fort23.Mono
                 Text_Exp.text = $"{daoYouData.exp}/{currentDaoyouLevelupConfig.exp}";
             }
 
-          
+
             Slider_LeveUp.value = daoYouData.exp;
 
             if (_daoyouModelConfig.PreferGiftID != null)
@@ -366,7 +367,6 @@ namespace Fort23.Mono
             }
 
 
-            DaoyouLevelupConfig[] configs = ConfigComponent.Instance.GetAll<DaoyouLevelupConfig>();
             foreach (var daoyouLevelupConfig in configs)
             {
                 DaoYouLevelWidget daoYouLevelWidget =
@@ -442,9 +442,17 @@ namespace Fort23.Mono
                 giveWidgetItems.Add(widgetItem);
             }
 
+
             if (giveWidgetItems.Count > 0)
             {
-                giveWidgetItems[0].OnPointerClick();
+                if (currentSelectWidgetItem != null)
+                {
+                    currentSelectWidgetItem.OnPointerClick();
+                }
+                else
+                {
+                    giveWidgetItems[0].OnPointerClick();
+                }
             }
         }
 
@@ -455,6 +463,7 @@ namespace Fort23.Mono
         private async void OnClick(ItemWidgetBasic obj)
         {
             WidgetItem widgetItem = obj as WidgetItem;
+            currentSelectWidgetItem = widgetItem;
             if (widgetItem1 == null)
             {
                 widgetItem1 = await UIManager.Instance.CreateGComponent<WidgetItem>(null, WidgetItemRoot);

+ 14 - 2
Assets/Scripts/GameUI/UI/DaoYouPanel/DaoYouPanel.cs

@@ -32,11 +32,25 @@ namespace Fort23.Mono
         {
             TitlePanel.ClosePanel();
             AppBarPanel.OpenPanel(this);
+            CustomInit();
             return base.GetFocus();
         }
 
         public async override CTask<bool> AsyncInit(object[] uiData)
         {
+            await CustomInit();
+            return await base.AsyncInit(uiData);
+        }
+
+        public async CTask CustomInit()
+        {
+            foreach (var daoYouWidget in daoYouWidgets)
+            {
+                UIManager.Instance.DormancyGComponent(daoYouWidget);
+            }
+
+            daoYouWidgets.Clear();
+
             DaoyouModelConfig[] daoyouModelConfigs = ConfigComponent.Instance.GetAll<DaoyouModelConfig>();
             foreach (var daoyouModelConfig in daoyouModelConfigs)
             {
@@ -45,8 +59,6 @@ namespace Fort23.Mono
                 daoYouWidget.OnClick = OnClick;
                 daoYouWidgets.Add(daoYouWidget);
             }
-
-            return await base.AsyncInit(uiData);
         }
 
         private void OnClick(ItemWidgetBasic obj)

+ 1 - 1
Assets/Scripts/GameUI/UI/DaoYouPanel/DaoYouWidget.cs

@@ -52,7 +52,7 @@ namespace Fort23.Mono
             }
             else
             {
-                Slider_Emotion.fillAmount = _daoYouData.emotionValue / 100;
+                Slider_Emotion.fillAmount = _daoYouData.emotionValue / 100f;
             }
 
 

+ 3 - 4
Assets/Scripts/GameUI/UI/GongFaUpgradePanel/GongFaUpgradePanel.cs

@@ -78,16 +78,14 @@ namespace Fort23.Mono
 
             Btn_UpGradeOkLongPress.longPress = () => { UpgradeClick(); };
 
-            Btn_Rest.onClick.AddListener(async() =>
+            Btn_Rest.onClick.AddListener(async () =>
             {
-
-
                 bool relust = await TipsPanle.OpenPnael(10799);
                 if (!relust)
                 {
                     return;
                 }
-                
+
                 Dictionary<int, ItemInfo> itemInfo = new Dictionary<int, ItemInfo>();
 
                 for (int i = 1; i < _skillInfo.SkillPowerupConfig.ID; i++)
@@ -268,6 +266,7 @@ namespace Fort23.Mono
                 UIManager.Instance.DormancyGComponent(gongFaUpgradeInfoWidget);
             }
 
+            Btn_Rest.gameObject.SetActive(_skillInfo.SkillPowerupConfig.ID > 1);
             _gongFaUpgradeInfoWidgets.Clear();
             _skillInfo = skillInfo;
             RedDotComType02.CustomInit(13, _skillInfo);