|
@@ -1,4 +1,5 @@
|
|
|
using System.Collections.Generic;
|
|
using System.Collections.Generic;
|
|
|
|
|
+using System.Linq;
|
|
|
using Core.Language;
|
|
using Core.Language;
|
|
|
using Excel2Json;
|
|
using Excel2Json;
|
|
|
using Fort23.Core;
|
|
using Fort23.Core;
|
|
@@ -14,6 +15,7 @@ namespace Fort23.Mono
|
|
|
List<SkipToWidget> skipToWidgets = new List<SkipToWidget>();
|
|
List<SkipToWidget> skipToWidgets = new List<SkipToWidget>();
|
|
|
private CTask<bool> callBack;
|
|
private CTask<bool> callBack;
|
|
|
private bool isSkipto = false;
|
|
private bool isSkipto = false;
|
|
|
|
|
+ private bool isMainPanel;
|
|
|
|
|
|
|
|
private void Init()
|
|
private void Init()
|
|
|
{
|
|
{
|
|
@@ -35,23 +37,23 @@ namespace Fort23.Mono
|
|
|
|
|
|
|
|
public async override CTask<bool> AsyncInit(object[] uiData)
|
|
public async override CTask<bool> AsyncInit(object[] uiData)
|
|
|
{
|
|
{
|
|
|
-
|
|
|
|
|
foreach (var skipToWidget in skipToWidgets)
|
|
foreach (var skipToWidget in skipToWidgets)
|
|
|
{
|
|
{
|
|
|
UIManager.Instance.DormancyGComponent(skipToWidget);
|
|
UIManager.Instance.DormancyGComponent(skipToWidget);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
skipToWidgets.Clear();
|
|
skipToWidgets.Clear();
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
int itemId = (int)uiData[0];
|
|
int itemId = (int)uiData[0];
|
|
|
callBack = uiData[1] as CTask<bool>;
|
|
callBack = uiData[1] as CTask<bool>;
|
|
|
|
|
+ isMainPanel = (bool)uiData[2];
|
|
|
ItemConfig itemConfig = ConfigComponent.Instance.Get<ItemConfig>(itemId);
|
|
ItemConfig itemConfig = ConfigComponent.Instance.Get<ItemConfig>(itemId);
|
|
|
Text_ItemName.text = LanguageManager.Instance.Text(itemConfig.itemName);
|
|
Text_ItemName.text = LanguageManager.Instance.Text(itemConfig.itemName);
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
WidgetItem widgetItem =
|
|
WidgetItem widgetItem =
|
|
|
await UIManager.Instance.CreateGComponentForObject<WidgetItem>(WidgetItemGam, null);
|
|
await UIManager.Instance.CreateGComponentForObject<WidgetItem>(WidgetItemGam, null);
|
|
|
- widgetItem.InitWidget(new ItemInfo(itemId),false);
|
|
|
|
|
-
|
|
|
|
|
|
|
+ widgetItem.InitWidget(new ItemInfo(itemId), false);
|
|
|
|
|
+
|
|
|
Text_ItemCount.text = PlayerManager.Instance.BagController.GetItemCount(itemId).ToString();
|
|
Text_ItemCount.text = PlayerManager.Instance.BagController.GetItemCount(itemId).ToString();
|
|
|
if (itemConfig.SkiptoID != null)
|
|
if (itemConfig.SkiptoID != null)
|
|
|
{
|
|
{
|
|
@@ -76,17 +78,22 @@ namespace Fort23.Mono
|
|
|
TipMessagePanel.OpenTipMessagePanel(SkiptoHelper.SkiptoTips(skipToWidget.SkiptoConfig.ID));
|
|
TipMessagePanel.OpenTipMessagePanel(SkiptoHelper.SkiptoTips(skipToWidget.SkiptoConfig.ID));
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
isSkipto = true;
|
|
isSkipto = true;
|
|
|
- await UIManager.Instance.HideUIUIPanel(this);
|
|
|
|
|
-
|
|
|
|
|
- SkiptoHelper.Skipto(skipToWidget.SkiptoConfig.ID);
|
|
|
|
|
|
|
+ await UIManager.Instance.HideUIUIPanel(this);
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ await SkiptoHelper.Skipto(skipToWidget.SkiptoConfig.ID,isMainPanel);
|
|
|
|
|
+ callBack?.SetResult(isSkipto);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- public static async CTask<bool> OpenPanel(int itemId)
|
|
|
|
|
|
|
+ public static async CTask<bool> OpenPanel(int itemId, bool isMainPanel = false)
|
|
|
{
|
|
{
|
|
|
CTask<bool> callBack = CTask<bool>.Create();
|
|
CTask<bool> callBack = CTask<bool>.Create();
|
|
|
await UIManager.Instance.LoadAndOpenPanel<ItemSourcePanel>(null, UILayer.Top,
|
|
await UIManager.Instance.LoadAndOpenPanel<ItemSourcePanel>(null, UILayer.Top,
|
|
|
- uiData: new object[] { itemId, callBack }, isShowBG: true);
|
|
|
|
|
|
|
+ uiData: new object[] { itemId, callBack, isMainPanel }, isShowBG: true);
|
|
|
return await callBack;
|
|
return await callBack;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -98,9 +105,11 @@ namespace Fort23.Mono
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
skipToWidgets.Clear();
|
|
skipToWidgets.Clear();
|
|
|
|
|
+
|
|
|
callBack?.SetResult(isSkipto);
|
|
callBack?.SetResult(isSkipto);
|
|
|
isSkipto = false;
|
|
isSkipto = false;
|
|
|
|
|
|
|
|
|
|
+
|
|
|
await base.Close();
|
|
await base.Close();
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|