|
@@ -42,7 +42,6 @@ namespace Fort23.Mono
|
|
|
|
|
|
public override CTask GetFocus()
|
|
|
{
|
|
|
-
|
|
|
AppBarPanel.OpenPanel(this);
|
|
|
|
|
|
return base.GetFocus();
|
|
@@ -62,6 +61,7 @@ namespace Fort23.Mono
|
|
|
|
|
|
public async override CTask<bool> AsyncInit(object[] uiData)
|
|
|
{
|
|
|
+ int shopId = int.Parse(uiData[0].ToString());
|
|
|
List<ShopGroupConfig> shopGroupConfigs = ConfigComponent.Instance.GetAll<ShopGroupConfig>().ToList();
|
|
|
shopGroupConfigs.Sort(Sort);
|
|
|
foreach (var shopGroupConfig in shopGroupConfigs)
|
|
@@ -73,14 +73,22 @@ namespace Fort23.Mono
|
|
|
shopBtnWidget.CustomInit(shopGroupConfig);
|
|
|
shopBtnWidget.OnClick = OnClick;
|
|
|
_shopBtnWidgets.Add(shopBtnWidget);
|
|
|
- if (currentSelectedShopBtnWidget == null)
|
|
|
+ if (shopGroupConfig.ID == shopId)
|
|
|
{
|
|
|
currentSelectedShopBtnWidget = shopBtnWidget;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
ShopBtnContent.GetComponent<UIToggleList>().GetChildObj();
|
|
|
- currentSelectedShopBtnWidget.OnPointerClick();
|
|
|
+ if (currentSelectedShopBtnWidget == null)
|
|
|
+ {
|
|
|
+ _shopBtnWidgets[0]?.OnPointerClick();
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ currentSelectedShopBtnWidget.OnPointerClick();
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
// isPauseCombat = uiData[0] as bool? == true;
|
|
|
return await base.AsyncInit(uiData);
|
|
@@ -201,10 +209,10 @@ namespace Fort23.Mono
|
|
|
await base.Close();
|
|
|
}
|
|
|
|
|
|
- public static async CTask<ShopPanel> OpenPanel(bool isPauseCombat = false)
|
|
|
+ public static async CTask<ShopPanel> OpenPanel(int shopId)
|
|
|
{
|
|
|
ShopPanel shopPanel =
|
|
|
- await UIManager.Instance.LoadAndOpenPanel<ShopPanel>(null, uiData: new object[] { isPauseCombat },
|
|
|
+ await UIManager.Instance.LoadAndOpenPanel<ShopPanel>(null, uiData: new object[] { shopId },
|
|
|
isFullUI: true);
|
|
|
|
|
|
AudioManager.Instance.PlayAudio("ui_shangdian.wav");
|