|
@@ -61,24 +61,19 @@ namespace GFGGame
|
|
|
protected async override void OnShown()
|
|
|
{
|
|
|
base.OnShown();
|
|
|
- _valueBarController.OnShown();
|
|
|
- _valueBarController.UpdateList(new List<int>() { ConstItemID .YUANXIAO_REWARD, ConstItemID.YUANXIAO_GAME_CONSUME});
|
|
|
|
|
|
_ui.m_list.visible = false;
|
|
|
+ _valueBarController.OnShown();
|
|
|
+ _valueBarController.UpdateList(new List<int>());
|
|
|
var result = await ActivityGetYuanXiaoProxy.ReqGetActivityGameInfos();
|
|
|
|
|
|
- if (!isShowing)
|
|
|
+ if (!isShowing || !result)
|
|
|
{
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
- if (!result)
|
|
|
- {
|
|
|
- OnBtnBackClick();
|
|
|
- return;
|
|
|
- }
|
|
|
-
|
|
|
_ui.m_list.visible = true;
|
|
|
+ _valueBarController.UpdateList(new List<int>() { ConstItemID.YUANXIAO_REWARD, ConstItemID.YUANXIAO_GAME_CONSUME });
|
|
|
_ui.m_listShow.Play();
|
|
|
_curLevel = ActivityGetYuanXiaoDataManager.Instance.GetCurLevel();
|
|
|
_ui.m_list.numItems = ActivityGetYuanXiaoDataManager.Instance.gameinfoList.Count;
|
|
@@ -137,6 +132,13 @@ namespace GFGGame
|
|
|
|
|
|
private void OnBtnStartClick()
|
|
|
{
|
|
|
+ int activityID = ActivityDataManager.Instance.GetCurOpenActiveByType(ActivityType.YuanXiao);
|
|
|
+ if (activityID == 0)
|
|
|
+ {
|
|
|
+ PromptController.Instance.ShowFloatTextPrompt("活动已结束");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
if (_ui.m_list.selectedIndex > _curLevel)
|
|
|
{
|
|
|
PromptController.Instance.ShowFloatTextPrompt("请先通关前置关卡");
|
|
@@ -161,10 +163,6 @@ namespace GFGGame
|
|
|
private async void StartGame()
|
|
|
{
|
|
|
int activityID = ActivityDataManager.Instance.GetCurOpenActiveByType(ActivityType.YuanXiao);
|
|
|
- if (activityID == 0)
|
|
|
- {
|
|
|
- return;
|
|
|
- }
|
|
|
|
|
|
PickUpGame cfg = PickUpGameArray.Instance.dataArray[_ui.m_list.selectedIndex];
|
|
|
var result = await MiniGameProxy.ReqMiniGameStart(cfg.id, cfg.type, activityID);
|
|
@@ -175,6 +173,13 @@ namespace GFGGame
|
|
|
|
|
|
private void OnBtnShopClick()
|
|
|
{
|
|
|
+ int activityID = ActivityDataManager.Instance.GetCurOpenActiveByType(ActivityType.YuanXiao);
|
|
|
+ if (activityID == 0)
|
|
|
+ {
|
|
|
+ PromptController.Instance.ShowFloatTextPrompt("活动已结束");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
ViewManager.Show<StoreView>(new object[] { ConstStoreTabId.STORE_EXCHANGE, ConstStoreSubId.STORE_ACTIVITY_EXCHANGE });
|
|
|
}
|
|
|
|
|
@@ -183,8 +188,10 @@ namespace GFGGame
|
|
|
int activityID = ActivityDataManager.Instance.GetCurOpenActiveByType(ActivityType.YuanXiao);
|
|
|
if (activityID == 0)
|
|
|
{
|
|
|
+ PromptController.Instance.ShowFloatTextPrompt("活动已结束");
|
|
|
return;
|
|
|
}
|
|
|
+
|
|
|
ViewManager.Show<ActivityGetYuanXiaoTaskView>();
|
|
|
}
|
|
|
|
|
@@ -228,12 +235,6 @@ namespace GFGGame
|
|
|
{
|
|
|
long curTime = TimeHelper.ServerNow();
|
|
|
int activityID = ActivityDataManager.Instance.GetCurOpenActiveByType(ActivityType.YuanXiao);
|
|
|
- if (activityID == 0)
|
|
|
- {
|
|
|
- OnBtnBackClick();
|
|
|
- return;
|
|
|
- }
|
|
|
-
|
|
|
var activityInfo = ActivityGlobalDataManager.Instance.GetActivityInfo(activityID);
|
|
|
if (activityInfo != null)
|
|
|
{
|