浏览代码

修改bug

lzx 19 小时之前
父节点
当前提交
882dc5be0e

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

@@ -11,6 +11,7 @@ namespace Fort23.Mono
     [UIBinding(prefab = "DialogueOptionWidget")]
     public partial class DialogueOptionWidget : UIComponent
     {
+        public AccountFileInfo.EventLinkData eventLinkData;
         public EventLinkConfig eventConditionConfig;
         private Action<DialogueOptionWidget> callback;
         public int type;
@@ -37,7 +38,7 @@ namespace Fort23.Mono
         {
             type = 1;
             eventConditionConfig = ConfigComponent.Instance.Get<EventLinkConfig>(id);
-            var eventLinkData = CurrentEventList.eventLinks.FirstOrDefault(l => l.eventLinkId == id);
+            eventLinkData = CurrentEventList.eventLinks.FirstOrDefault(l => l.eventLinkId == id);
             var mainEventConditionConfig = ConfigComponent.Instance.Get<EventLinkConfig>(mainOpid);
             // int index = mainEventConditionConfig.optionPara1.ToList().IndexOf(eventConditionConfig.ID);
             Text_desc.text = LanguageManager.Instance.Text(mainEventConditionConfig.optionPara2[selectIndex]);

+ 9 - 12
Assets/Scripts/GameUI/UI/DialoguePanel/DialoguePanel.cs

@@ -189,8 +189,6 @@ namespace Fort23.Mono
 
         private void StartShowMassge()
         {
-            
-            
             if (index >= dialogueMessaga.Length)
             {
                 if (eventConditionConfig.ID != 0 && !_isShowingOptions)
@@ -267,9 +265,9 @@ namespace Fort23.Mono
                 {
                     DialogueOptionWidget dialogueOptionWidget =
                         await UIManager.Instance.CreateGComponent<DialogueOptionWidget>(null, OptionRoot);
-                    dialogueOptionWidget.CustomInit(i,CurrentEventList, eventConditionConfig.optionPara1[i], eventConditionConfig.ID, SelectOption);
+                    dialogueOptionWidget.CustomInit(i, CurrentEventList, eventConditionConfig.optionPara1[i], eventConditionConfig.ID, SelectOption);
                 }
-     
+
 
                 LayoutRebuilder.ForceRebuildLayoutImmediate(Dialgue);
 
@@ -279,16 +277,15 @@ namespace Fort23.Mono
 
         private void SelectOption(DialogueOptionWidget obj)
         {
+            if (!EventSystemManager.Instance.CeekEventGroupComplete(obj.eventLinkData.eventConditions))
+            {
+                // TipMessagePanel.OpenTipMessagePanel(EventHelper.GetTaskMessage(selectedOptionID));
+                return;
+            }
+
             OptionMarsk.SetActive(false);
             int selectedOptionID = obj.eventConditionConfig.ID;
-            // if (obj.eventConditionConfig.ID != 0 && obj.eventConditionConfig.ConditionType != 0)
-            // {
-            //     if (!EventSystemManager.Instance.IsEvenkLinkComplete(selectedOptionID))
-            //     {
-            //         TipMessagePanel.OpenTipMessagePanel(EventHelper.GetTaskMessage(selectedOptionID));
-            //         return;
-            //     }
-            // }
+
 
             UIManager.Instance.HideUIUIPanel(this);
             finish?.Invoke(selectedOptionID);