|
@@ -53,7 +53,7 @@ namespace GFGGame
|
|
|
_ui.m_btnStart.onClick.Add(OnBtnStartClick);
|
|
|
_ui.m_btnTask.onClick.Add(OnBtnTaskClick);
|
|
|
_ui.m_btnShop.onClick.Add(OnBtnShopClick);
|
|
|
- _ui.m_btnBack.onClick.Add(Hide);
|
|
|
+ _ui.m_btnBack.onClick.Add(OnBtnBackClick);
|
|
|
|
|
|
AddEffect();
|
|
|
}
|
|
@@ -61,18 +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 || !result)
|
|
|
{
|
|
|
- Hide();
|
|
|
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;
|
|
@@ -131,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("请先通关前置关卡");
|
|
@@ -155,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);
|
|
@@ -169,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 });
|
|
|
}
|
|
|
|
|
@@ -177,8 +188,10 @@ namespace GFGGame
|
|
|
int activityID = ActivityDataManager.Instance.GetCurOpenActiveByType(ActivityType.YuanXiao);
|
|
|
if (activityID == 0)
|
|
|
{
|
|
|
+ PromptController.Instance.ShowFloatTextPrompt("活动已结束");
|
|
|
return;
|
|
|
}
|
|
|
+
|
|
|
ViewManager.Show<ActivityGetYuanXiaoTaskView>();
|
|
|
}
|
|
|
|
|
@@ -222,12 +235,6 @@ namespace GFGGame
|
|
|
{
|
|
|
long curTime = TimeHelper.ServerNow();
|
|
|
int activityID = ActivityDataManager.Instance.GetCurOpenActiveByType(ActivityType.YuanXiao);
|
|
|
- if (activityID == 0)
|
|
|
- {
|
|
|
- Hide();
|
|
|
- return;
|
|
|
- }
|
|
|
-
|
|
|
var activityInfo = ActivityGlobalDataManager.Instance.GetActivityInfo(activityID);
|
|
|
if (activityInfo != null)
|
|
|
{
|
|
@@ -235,5 +242,12 @@ namespace GFGGame
|
|
|
_ui.m_txtTime.text = TimeUtil.FormattingTimeTo_DDHHmm(endTime - curTime);
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ private void OnBtnBackClick()
|
|
|
+ {
|
|
|
+ ViewManager.Show<MainUIView>(null, true);
|
|
|
+ ViewManager.DeleteViewStackCountDown("MainUIView");
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
}
|