From d2e50a45f0ffb9f24ed2c5585693307436af4f58 Mon Sep 17 00:00:00 2001
From: hch <305670599@qq.com>
Date: 星期一, 13 十月 2025 12:23:35 +0800
Subject: [PATCH] 0312 优化引导重置引导组
---
Main/Config/PartialConfigs/GuideConfig.cs | 58 ++++++++++++++++++++++++++++
Main/System/NewBieGuidance/NewBieCenter.cs | 15 +++++--
2 files changed, 67 insertions(+), 6 deletions(-)
diff --git a/Main/Config/PartialConfigs/GuideConfig.cs b/Main/Config/PartialConfigs/GuideConfig.cs
index 7f78fa3..7afd274 100644
--- a/Main/Config/PartialConfigs/GuideConfig.cs
+++ b/Main/Config/PartialConfigs/GuideConfig.cs
@@ -1,3 +1,4 @@
+using System;
using System.Collections.Generic;
using UnityEngine;
@@ -7,6 +8,8 @@
public static Dictionary<int, List<int>> typeToGuidesDic = new Dictionary<int, List<int>>();
+ public static Dictionary<int, List<int>> guideGroupDict = new Dictionary<int, List<int>>();
+ static Dictionary<int, int> preGuideDict = new Dictionary<int, int>();
protected override void OnConfigParseCompleted()
{
base.OnConfigParseCompleted();
@@ -26,6 +29,8 @@
typeToGuidesDic.Add(TriggerType, list2);
}
list2.Add(ID);
+
+ preGuideDict[ID] = PreGuideId;
}
@@ -38,7 +43,7 @@
}
return null;
}
-
+
public static List<int> GetGuideListByType(int type)
{
List<int> list = null;
@@ -48,4 +53,55 @@
}
return null;
}
+
+
+
+
+ // 姹囨�诲紩瀵肩粍
+ public static List<int> GetGuideList(int guideID)
+ {
+ if (guideGroupDict.IsNullOrEmpty())
+ {
+ BuildGuideGroupDict();
+ }
+
+ if (guideGroupDict.ContainsKey(guideID))
+ {
+ return guideGroupDict[guideID];
+ }
+ else
+ {
+ Debug.LogError($"guideID:{guideID} 娌℃湁鎵惧埌寮曞缁�");
+ }
+ return null;
+ }
+
+ private static void BuildGuideGroupDict()
+ {
+ foreach (var id in preGuideDict.Keys)
+ {
+ int currentId = id;
+ int rootId = FindRootGuideId(currentId);
+
+ if (!guideGroupDict.ContainsKey(rootId))
+ {
+ guideGroupDict[rootId] = new List<int>();
+ }
+
+ if (!guideGroupDict[rootId].Contains(currentId))
+ {
+ guideGroupDict[rootId].Add(currentId);
+ }
+ }
+ }
+
+ private static int FindRootGuideId(int id)
+ {
+ int currentId = id;
+ while (preGuideDict.ContainsKey(currentId) && preGuideDict[currentId] != 0)
+ {
+ currentId = preGuideDict[currentId];
+ }
+ return currentId;
+ }
}
\ No newline at end of file
diff --git a/Main/System/NewBieGuidance/NewBieCenter.cs b/Main/System/NewBieGuidance/NewBieCenter.cs
index 63fd9a6..2d3bd0c 100644
--- a/Main/System/NewBieGuidance/NewBieCenter.cs
+++ b/Main/System/NewBieGuidance/NewBieCenter.cs
@@ -461,12 +461,17 @@
public void ResetGuide(int _guide)
{
- var send = new CA222_tagCMSetGuideOK();
- send.GuideIndex = (byte)_guide;
- send.IsOK = 0;
- GameNetSystem.Instance.SendInfo(send);
+ var _List = GuideConfig.GetGuideList(_guide);
+ if (_List == null) return;
+ foreach (var guideID in _List)
+ {
+ var send = new CA222_tagCMSetGuideOK();
+ send.GuideIndex = (byte)guideID;
+ send.IsOK = 0;
+ GameNetSystem.Instance.SendInfo(send);
- completeGuidesBuf.Remove(_guide);
+ completeGuidesBuf.Remove(guideID);
+ }
}
--
Gitblit v1.8.0