|
@@ -17,6 +17,8 @@ namespace Fort23.Mono
|
|
public int type;
|
|
public int type;
|
|
|
|
|
|
public string message;
|
|
public string message;
|
|
|
|
+
|
|
|
|
+ public int id;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
@@ -31,7 +33,7 @@ namespace Fort23.Mono
|
|
|
|
|
|
List<UIComponent> components = new List<UIComponent>();
|
|
List<UIComponent> components = new List<UIComponent>();
|
|
|
|
|
|
- List<EventLogTitleWidget> titleWidgets = new List<EventLogTitleWidget>();
|
|
|
|
|
|
+ // List<EventLogTitleWidget> titleWidgets = new List<EventLogTitleWidget>();
|
|
|
|
|
|
private int type;
|
|
private int type;
|
|
|
|
|
|
@@ -50,9 +52,21 @@ namespace Fort23.Mono
|
|
public override void AddButtonEvent()
|
|
public override void AddButtonEvent()
|
|
{
|
|
{
|
|
Btn_Close.onClick.AddListener(() => { UIManager.Instance.HideUIUIPanel(this); });
|
|
Btn_Close.onClick.AddListener(() => { UIManager.Instance.HideUIUIPanel(this); });
|
|
|
|
+ Sr.onValueChanged.AddListener(OnValueChanged);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ private void OnValueChanged(Vector2 arg0)
|
|
|
|
+ {
|
|
|
|
+ UpdateTitleWidget();
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ public async override CTask<bool> AsyncInit(object[] uiData)
|
|
|
|
+ {
|
|
|
|
+ await CustomInit((int)uiData[0], (int)uiData[1]);
|
|
|
|
+ return await base.AsyncInit(uiData);
|
|
}
|
|
}
|
|
|
|
|
|
- public async void CustomInit(int type, int id)
|
|
|
|
|
|
+ public async CTask CustomInit(int type, int id)
|
|
{
|
|
{
|
|
this.type = type;
|
|
this.type = type;
|
|
eventLogTitleWidget = await UIManager.Instance.CreateGComponentForObject<EventLogTitleWidget>(EventLogTitleWidget, null);
|
|
eventLogTitleWidget = await UIManager.Instance.CreateGComponentForObject<EventLogTitleWidget>(EventLogTitleWidget, null);
|
|
@@ -82,6 +96,7 @@ namespace Fort23.Mono
|
|
PlacesConfig placesConfig = ConfigComponent.Instance.Get<PlacesConfig>(keyValuePair.Key);
|
|
PlacesConfig placesConfig = ConfigComponent.Instance.Get<PlacesConfig>(keyValuePair.Key);
|
|
XianTuLogInfoData xianTuLogInfoData3 = new XianTuLogInfoData();
|
|
XianTuLogInfoData xianTuLogInfoData3 = new XianTuLogInfoData();
|
|
xianTuLogInfoData3.type = 1;
|
|
xianTuLogInfoData3.type = 1;
|
|
|
|
+ xianTuLogInfoData3.id = keyValuePair.Value[0].ID;
|
|
xianTuLogInfoData3.message = LanguageManager.Instance.Text(placesConfig.placeName);
|
|
xianTuLogInfoData3.message = LanguageManager.Instance.Text(placesConfig.placeName);
|
|
showXianTuLogInfoData.Add(xianTuLogInfoData3);
|
|
showXianTuLogInfoData.Add(xianTuLogInfoData3);
|
|
}
|
|
}
|
|
@@ -96,10 +111,12 @@ namespace Fort23.Mono
|
|
{
|
|
{
|
|
XianTuLogInfoData xianTuLogInfoData = new XianTuLogInfoData();
|
|
XianTuLogInfoData xianTuLogInfoData = new XianTuLogInfoData();
|
|
xianTuLogInfoData.type = 2;
|
|
xianTuLogInfoData.type = 2;
|
|
|
|
+ xianTuLogInfoData.id = eventConfig.ID;
|
|
xianTuLogInfoData.message = "????????";
|
|
xianTuLogInfoData.message = "????????";
|
|
|
|
|
|
XianTuLogInfoData xianTuLogInfoData1 = new XianTuLogInfoData();
|
|
XianTuLogInfoData xianTuLogInfoData1 = new XianTuLogInfoData();
|
|
xianTuLogInfoData1.type = 3;
|
|
xianTuLogInfoData1.type = 3;
|
|
|
|
+ xianTuLogInfoData1.id = eventConfig.ID;
|
|
xianTuLogInfoData1.message = "?????????????????????????????????";
|
|
xianTuLogInfoData1.message = "?????????????????????????????????";
|
|
|
|
|
|
showXianTuLogInfoData.Add(xianTuLogInfoData);
|
|
showXianTuLogInfoData.Add(xianTuLogInfoData);
|
|
@@ -110,6 +127,7 @@ namespace Fort23.Mono
|
|
{
|
|
{
|
|
XianTuLogInfoData xianTuLogInfoData = new XianTuLogInfoData();
|
|
XianTuLogInfoData xianTuLogInfoData = new XianTuLogInfoData();
|
|
xianTuLogInfoData.type = 2;
|
|
xianTuLogInfoData.type = 2;
|
|
|
|
+ xianTuLogInfoData.id = eventConfig.ID;
|
|
xianTuLogInfoData.message = LanguageManager.Instance.Text(eventConfig.EventName);
|
|
xianTuLogInfoData.message = LanguageManager.Instance.Text(eventConfig.EventName);
|
|
showXianTuLogInfoData.Add(xianTuLogInfoData);
|
|
showXianTuLogInfoData.Add(xianTuLogInfoData);
|
|
foreach (var eventListSelectEventLinkId in eventList.selectEventLinkIds)
|
|
foreach (var eventListSelectEventLinkId in eventList.selectEventLinkIds)
|
|
@@ -121,6 +139,7 @@ namespace Fort23.Mono
|
|
{
|
|
{
|
|
XianTuLogInfoData xianTuLogInfoData1 = new XianTuLogInfoData();
|
|
XianTuLogInfoData xianTuLogInfoData1 = new XianTuLogInfoData();
|
|
xianTuLogInfoData1.type = 3;
|
|
xianTuLogInfoData1.type = 3;
|
|
|
|
+ xianTuLogInfoData1.id = eventConfig.ID;
|
|
if (eventLinkConfig.NPCID != 0)
|
|
if (eventLinkConfig.NPCID != 0)
|
|
{
|
|
{
|
|
xianTuLogInfoData1.message = $"<color=#A6A6A6>{LanguageManager.Instance.Text(i)}</color>";
|
|
xianTuLogInfoData1.message = $"<color=#A6A6A6>{LanguageManager.Instance.Text(i)}</color>";
|
|
@@ -129,8 +148,8 @@ namespace Fort23.Mono
|
|
{
|
|
{
|
|
xianTuLogInfoData1.message = $"<color=#867169>{LanguageManager.Instance.Text(i)}</color>";
|
|
xianTuLogInfoData1.message = $"<color=#867169>{LanguageManager.Instance.Text(i)}</color>";
|
|
}
|
|
}
|
|
-
|
|
|
|
-
|
|
|
|
|
|
+
|
|
|
|
+
|
|
showXianTuLogInfoData.Add(xianTuLogInfoData1);
|
|
showXianTuLogInfoData.Add(xianTuLogInfoData1);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -142,17 +161,17 @@ namespace Fort23.Mono
|
|
if (type == 1)
|
|
if (type == 1)
|
|
{
|
|
{
|
|
// eventLogTitleWidget.SetActive(true);
|
|
// eventLogTitleWidget.SetActive(true);
|
|
- Sv.SetParent(Marsk1,false);
|
|
|
|
|
|
+ Sv.SetParent(Marsk1, false);
|
|
eventLogTitleWidget.CustomInit(showXianTuLogInfoData[0].message);
|
|
eventLogTitleWidget.CustomInit(showXianTuLogInfoData[0].message);
|
|
eventLogTitleWidget.own.SetActive(true);
|
|
eventLogTitleWidget.own.SetActive(true);
|
|
}
|
|
}
|
|
else if (type == 2)
|
|
else if (type == 2)
|
|
{
|
|
{
|
|
- Sv.SetParent(Marsk2,false);
|
|
|
|
|
|
+ Sv.SetParent(Marsk2, false);
|
|
eventLogTitleWidget.own.SetActive(false);
|
|
eventLogTitleWidget.own.SetActive(false);
|
|
}
|
|
}
|
|
|
|
|
|
- Content.Init(this, showXianTuLogInfoData.Count);
|
|
|
|
|
|
+ await Content.Init(this, showXianTuLogInfoData.Count);
|
|
}
|
|
}
|
|
|
|
|
|
public async CTask<IScorllListWidget> GetIScorllListWidget(int index, RectTransform root)
|
|
public async CTask<IScorllListWidget> GetIScorllListWidget(int index, RectTransform root)
|
|
@@ -167,22 +186,22 @@ namespace Fort23.Mono
|
|
if (xianTuLogInfoData.type == 1)
|
|
if (xianTuLogInfoData.type == 1)
|
|
{
|
|
{
|
|
EventLogTitleWidget eventLogTitleWidget = await UIManager.Instance.CreateGComponent<EventLogTitleWidget>(null, ContentRoot);
|
|
EventLogTitleWidget eventLogTitleWidget = await UIManager.Instance.CreateGComponent<EventLogTitleWidget>(null, ContentRoot);
|
|
- eventLogTitleWidget.CustomInit(xianTuLogInfoData.message);
|
|
|
|
- titleWidgets.Add(eventLogTitleWidget);
|
|
|
|
|
|
+ eventLogTitleWidget.CustomInit(xianTuLogInfoData);
|
|
|
|
+ // titleWidgets.Add(eventLogTitleWidget);
|
|
components.Add(eventLogTitleWidget);
|
|
components.Add(eventLogTitleWidget);
|
|
return eventLogTitleWidget;
|
|
return eventLogTitleWidget;
|
|
}
|
|
}
|
|
else if (xianTuLogInfoData.type == 2)
|
|
else if (xianTuLogInfoData.type == 2)
|
|
{
|
|
{
|
|
EventLogInfoWidget eventLogInfoWidget = await UIManager.Instance.CreateGComponent<EventLogInfoWidget>(null, ContentRoot);
|
|
EventLogInfoWidget eventLogInfoWidget = await UIManager.Instance.CreateGComponent<EventLogInfoWidget>(null, ContentRoot);
|
|
- eventLogInfoWidget.CustomInit(xianTuLogInfoData.message);
|
|
|
|
|
|
+ eventLogInfoWidget.CustomInit(xianTuLogInfoData);
|
|
components.Add(eventLogInfoWidget);
|
|
components.Add(eventLogInfoWidget);
|
|
return eventLogInfoWidget;
|
|
return eventLogInfoWidget;
|
|
}
|
|
}
|
|
else if (xianTuLogInfoData.type == 3)
|
|
else if (xianTuLogInfoData.type == 3)
|
|
{
|
|
{
|
|
EventLogMessageWidget eventLogInfoWidget = await UIManager.Instance.CreateGComponent<EventLogMessageWidget>(null, ContentRoot);
|
|
EventLogMessageWidget eventLogInfoWidget = await UIManager.Instance.CreateGComponent<EventLogMessageWidget>(null, ContentRoot);
|
|
- eventLogInfoWidget.CustomInit(xianTuLogInfoData.message);
|
|
|
|
|
|
+ eventLogInfoWidget.CustomInit(xianTuLogInfoData);
|
|
components.Add(eventLogInfoWidget);
|
|
components.Add(eventLogInfoWidget);
|
|
return eventLogInfoWidget;
|
|
return eventLogInfoWidget;
|
|
}
|
|
}
|
|
@@ -198,10 +217,10 @@ namespace Fort23.Mono
|
|
components.Remove(widget as UIComponent);
|
|
components.Remove(widget as UIComponent);
|
|
}
|
|
}
|
|
|
|
|
|
- if (titleWidgets.Contains(widget as EventLogTitleWidget))
|
|
|
|
- {
|
|
|
|
- titleWidgets.Remove(widget as EventLogTitleWidget);
|
|
|
|
- }
|
|
|
|
|
|
+ // if (titleWidgets.Contains(widget as EventLogTitleWidget))
|
|
|
|
+ // {
|
|
|
|
+ // titleWidgets.Remove(widget as EventLogTitleWidget);
|
|
|
|
+ // }
|
|
}
|
|
}
|
|
|
|
|
|
public override void Close()
|
|
public override void Close()
|
|
@@ -213,44 +232,80 @@ namespace Fort23.Mono
|
|
}
|
|
}
|
|
|
|
|
|
components.Clear();
|
|
components.Clear();
|
|
- titleWidgets.Clear();
|
|
|
|
|
|
+ // titleWidgets.Clear();
|
|
|
|
|
|
base.Close();
|
|
base.Close();
|
|
}
|
|
}
|
|
|
|
|
|
- [CustomMethod(CustomMethodType.Update)]
|
|
|
|
- public void Update()
|
|
|
|
|
|
+ List<UIComponent> _components = new List<UIComponent>();
|
|
|
|
+ private float maxY;
|
|
|
|
+ private float minY;
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ public void UpdateTitleWidget()
|
|
{
|
|
{
|
|
if (type != 1)
|
|
if (type != 1)
|
|
return;
|
|
return;
|
|
- EventLogTitleWidget highestItem = null;
|
|
|
|
- float maxY = float.MinValue;
|
|
|
|
|
|
+ UIComponent highestItem = null;
|
|
|
|
+ maxY = float.MinValue;
|
|
|
|
+ minY = float.MaxValue;
|
|
|
|
+ _components.Clear();
|
|
|
|
|
|
|
|
|
|
- foreach (var xianTuTitleWidget in titleWidgets)
|
|
|
|
|
|
+ foreach (var xianTuTitleWidget in components)
|
|
{
|
|
{
|
|
float itemY = xianTuTitleWidget.own.transform.position.y; // 使用世界坐标的 Y 值
|
|
float itemY = xianTuTitleWidget.own.transform.position.y; // 使用世界坐标的 Y 值
|
|
- if (itemY > maxY)
|
|
|
|
|
|
+ if (itemY > eventLogTitleWidget.own.transform.position.y)
|
|
{
|
|
{
|
|
maxY = itemY;
|
|
maxY = itemY;
|
|
- highestItem = xianTuTitleWidget;
|
|
|
|
|
|
+ // highestItem = xianTuTitleWidget;
|
|
|
|
+ _components.Add(xianTuTitleWidget);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ foreach (var uiComponent in _components)
|
|
|
|
+ {
|
|
|
|
+ float itemY = uiComponent.own.transform.position.y; // 使用世界坐标的 Y 值
|
|
|
|
+ if (itemY < minY)
|
|
|
|
+ {
|
|
|
|
+ minY = itemY;
|
|
|
|
+ highestItem = uiComponent;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
if (highestItem != null)
|
|
if (highestItem != null)
|
|
{
|
|
{
|
|
float outsideY = eventLogTitleWidget.own.transform.position.y;
|
|
float outsideY = eventLogTitleWidget.own.transform.position.y;
|
|
- if (maxY > outsideY )
|
|
|
|
|
|
+ if (maxY > outsideY)
|
|
{
|
|
{
|
|
- eventLogTitleWidget.CustomInit(highestItem.Text_Name.text);
|
|
|
|
|
|
+ EventConfig eventConfig = default;
|
|
|
|
+ if (highestItem is EventLogTitleWidget)
|
|
|
|
+ {
|
|
|
|
+ EventLogTitleWidget eventLogTitleWidget = highestItem as EventLogTitleWidget;
|
|
|
|
+ eventConfig = ConfigComponent.Instance.Get<EventConfig>(eventLogTitleWidget.data.id);
|
|
|
|
+ }
|
|
|
|
+ else if (highestItem is EventLogInfoWidget)
|
|
|
|
+ {
|
|
|
|
+ EventLogInfoWidget eventLogTitleWidget = highestItem as EventLogInfoWidget;
|
|
|
|
+ eventConfig = ConfigComponent.Instance.Get<EventConfig>(eventLogTitleWidget.data.id);
|
|
|
|
+ }
|
|
|
|
+ else if (highestItem is EventLogMessageWidget)
|
|
|
|
+ {
|
|
|
|
+ EventLogMessageWidget eventLogTitleWidget = highestItem as EventLogMessageWidget;
|
|
|
|
+ eventConfig = ConfigComponent.Instance.Get<EventConfig>(eventLogTitleWidget.data.id);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ PlacesConfig placesConfig = ConfigComponent.Instance.Get<PlacesConfig>(eventConfig.placeID);
|
|
|
|
+ eventLogTitleWidget.CustomInit(LanguageManager.Instance.Text(placesConfig.placeName));
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
public async static CTask OpenPanel(int type, int id)
|
|
public async static CTask OpenPanel(int type, int id)
|
|
{
|
|
{
|
|
- XianTuLogInfoPanel xianTuLogInfoPanel = await UIManager.Instance.LoadAndOpenPanel<XianTuLogInfoPanel>(null);
|
|
|
|
- xianTuLogInfoPanel.CustomInit(type, id);
|
|
|
|
|
|
+ XianTuLogInfoPanel xianTuLogInfoPanel = await UIManager.Instance.LoadAndOpenPanel<XianTuLogInfoPanel>(null, uiData: new object[] { type, id });
|
|
|
|
+ // xianTuLogInfoPanel.CustomInit(type, id);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|