|
@@ -146,7 +146,8 @@ namespace GFGGame
|
|
|
EventAgent.AddEventListener(ConstMessage.CHANGE_ROLE_HEAD, UpdateHead);
|
|
|
EventAgent.AddEventListener(ConstMessage.RESET_DAILY_DATA, ResetDailyData);
|
|
|
EventAgent.AddEventListener(ConstMessage.AFU_GIFT_CHANGED, ChangeAfuActivityState);
|
|
|
- EventAgent.AddEventListener(ConstMessage.SEVENDAY_LOGIN, SevenDayLoginShow);
|
|
|
+ EventAgent.AddEventListener(ConstMessage.SEVEN_DAY_LOGIN_VIEW_CLOSED, CheckAutoShowViews);
|
|
|
+ EventAgent.AddEventListener(ConstMessage.AFTER_DATA_INITED, OnFaterDataInited);
|
|
|
}
|
|
|
|
|
|
protected override void RemoveEventListener()
|
|
@@ -157,7 +158,8 @@ namespace GFGGame
|
|
|
EventAgent.RemoveEventListener(ConstMessage.RED_CHANGE, OnRedDotChanged);
|
|
|
EventAgent.RemoveEventListener(ConstMessage.CHANGE_ROLE_HEAD, UpdateHead);
|
|
|
EventAgent.RemoveEventListener(ConstMessage.AFU_GIFT_CHANGED, ChangeAfuActivityState);
|
|
|
- EventAgent.RemoveEventListener(ConstMessage.SEVENDAY_LOGIN, SevenDayLoginShow);
|
|
|
+ EventAgent.RemoveEventListener(ConstMessage.SEVEN_DAY_LOGIN_VIEW_CLOSED, CheckAutoShowViews);
|
|
|
+ EventAgent.RemoveEventListener(ConstMessage.AFTER_DATA_INITED, OnFaterDataInited);
|
|
|
}
|
|
|
|
|
|
protected override void OnShown()
|
|
@@ -180,6 +182,7 @@ namespace GFGGame
|
|
|
_valueBarController.OnShown();
|
|
|
|
|
|
CheckFunOpen();
|
|
|
+ UpdateBtnFirstRecharge();
|
|
|
|
|
|
Timers.inst.Remove(Update);
|
|
|
//Timers.inst.Remove(CheckGuide);
|
|
@@ -188,9 +191,7 @@ namespace GFGGame
|
|
|
Update(null);
|
|
|
|
|
|
Timers.inst.Remove(OnShowLater);
|
|
|
- Timers.inst.Add(1f, 1, OnShowLater);
|
|
|
-
|
|
|
- //UpdateRedDot();
|
|
|
+ Timers.inst.Add(0.1f, 1, OnShowLater);
|
|
|
|
|
|
// 刚进游戏不播放主界面入场动画
|
|
|
if (firstIn)
|
|
@@ -222,27 +223,17 @@ namespace GFGGame
|
|
|
|
|
|
private void OnShowLater(object param)
|
|
|
{
|
|
|
- GameController.AfterEnterGame();
|
|
|
- UpdateBtnFirstRecharge();
|
|
|
CheckProbabilityUp();
|
|
|
- CheckDailySign();
|
|
|
- GetAdIds();
|
|
|
+ if(!GameGlobal.AfterDataInited)
|
|
|
+ {
|
|
|
+ GameController.AfterShowMainUI();
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
- private void CheckDailySign()
|
|
|
+ private void OnFaterDataInited()
|
|
|
{
|
|
|
- if (GameGlobal.isLogon)
|
|
|
- {
|
|
|
- if (ActivityDataManager.Instance.CanGetSevenDayBonus() &&
|
|
|
- GuideDataManager.currentGuideId <= 0)
|
|
|
- {
|
|
|
- ViewManager.Show<SevenDayLoginView>();
|
|
|
- }
|
|
|
- else if (RedDotDataManager.Instance.DailySignRed())
|
|
|
- {
|
|
|
- ViewManager.Show<DailySignView>(new object[] { 1 });
|
|
|
- }
|
|
|
- }
|
|
|
+ GetAdIds();
|
|
|
+ CheckAutoShowViews();
|
|
|
}
|
|
|
|
|
|
private void AddEffect()
|
|
@@ -588,6 +579,19 @@ namespace GFGGame
|
|
|
{
|
|
|
ShowExitAlert();
|
|
|
|
|
|
+ UpdateActLuckyBox();
|
|
|
+
|
|
|
+ UpdateLimitedActvityState();
|
|
|
+ UpdateTime();
|
|
|
+
|
|
|
+ //特惠礼包/限时礼包窗口内的倒计时
|
|
|
+ UpGiftBox1();
|
|
|
+ UpGiftBox2();
|
|
|
+ EventAgent.DispatchEvent(ConstMessage.LUCKY_BOX_TIME);
|
|
|
+ }
|
|
|
+
|
|
|
+ private void UpdateActLuckyBox()
|
|
|
+ {
|
|
|
int actLuckyBoxId = ActivityDataManager.Instance.GetCurOpenActiveByType(ConstLimitTimeActivityType.ActLimitLuckyBox);
|
|
|
_ui.m_btnActivityLuckyBox.target.visible = actLuckyBoxId > 0;
|
|
|
if (actLuckyBoxId > 0)
|
|
@@ -603,7 +607,10 @@ namespace GFGGame
|
|
|
long time = TimeUtil.DateTimeToTimestamp(activityOpenCfg.endTime) - TimeHelper.ServerNow();
|
|
|
_ui.m_btnActivityLuckyBox.m_txtTime.text = time > TimeUtil.SECOND_PER_DAY * 1000 ? TimeUtil.FormattingTimeTo_DDHHmm(time) : TimeUtil.FormattingTimeTo_HHmmss(time);
|
|
|
}
|
|
|
+ }
|
|
|
|
|
|
+ private void UpdateLimitedActvityState()
|
|
|
+ {
|
|
|
int actLimitTsyId = ActivityDataManager.Instance.GetCurOpenActiveByType(ConstLimitTimeActivityType.ActLimitTsy);
|
|
|
if (actLimitTsyId > 0)
|
|
|
{
|
|
@@ -627,17 +634,6 @@ namespace GFGGame
|
|
|
ActivityDataManager.Instance.AllSevenDayBonusGot()));
|
|
|
}
|
|
|
|
|
|
- UpdateLimitedActvityState();
|
|
|
- UpdateTime();
|
|
|
-
|
|
|
- //特惠礼包/限时礼包窗口内的倒计时
|
|
|
- UpGiftBox1();
|
|
|
- UpGiftBox2();
|
|
|
- EventAgent.DispatchEvent(ConstMessage.LUCKY_BOX_TIME);
|
|
|
- }
|
|
|
-
|
|
|
- private void UpdateLimitedActvityState()
|
|
|
- {
|
|
|
_ui.m_btnActivityDay7.target.visible = ActivityDay7DataManager.Instance.CheckOpen();
|
|
|
_ui.m_btnWanShiLi.target.visible = ActivityWanShiLiDataManager.Instance.CheckOpen();
|
|
|
}
|
|
@@ -851,6 +847,7 @@ namespace GFGGame
|
|
|
private void UpdateRedDot()
|
|
|
{
|
|
|
return;
|
|
|
+ if (firstIn) return;
|
|
|
LogHelper.LogEditor("MainUIView UpdateRedDot");
|
|
|
_valueBarController.UpRead();
|
|
|
RedDotController.Instance.SetComRedDot(_btnGongGao, RedDotDataManager.Instance.GetNoticeRed(), "", -9, 12);
|
|
@@ -995,25 +992,36 @@ namespace GFGGame
|
|
|
UpdateRedDot();
|
|
|
UpdateHead();
|
|
|
UpdateBtnFirstRecharge();
|
|
|
+ CheckAutoShowViews();
|
|
|
}
|
|
|
- private void SevenDayLoginShow()
|
|
|
+ private void CheckAutoShowViews()
|
|
|
{
|
|
|
//if (!TimeUtil.CheckIsSameTime(lastTime * 1000, TimeHelper.ClientNow()))
|
|
|
- if (GameGlobal.isLogon)
|
|
|
+ if (GameGlobal.AutoSevenDayLoginView)
|
|
|
{
|
|
|
if (ActivityDataManager.Instance.CanGetSevenDayBonus() &&
|
|
|
GuideDataManager.currentGuideId <= 0)
|
|
|
{
|
|
|
ViewManager.Show<SevenDayLoginView>();
|
|
|
-
|
|
|
+ return;
|
|
|
}
|
|
|
- else if (RedDotDataManager.Instance.DailySignRed())
|
|
|
+
|
|
|
+ //GameGlobal.lastLoginTime = GameGlobal.myNumericComponent.GetAsInt(NumericType.OnlineTimeSecs);
|
|
|
+ }
|
|
|
+ if (GameGlobal.AutoDailySignView)
|
|
|
+ {
|
|
|
+ if (RedDotDataManager.Instance.DailySignRed())
|
|
|
{
|
|
|
ViewManager.Show<DailySignView>(new object[] { 1 });
|
|
|
+ return;
|
|
|
}
|
|
|
-
|
|
|
- //GameGlobal.lastLoginTime = GameGlobal.myNumericComponent.GetAsInt(NumericType.OnlineTimeSecs);
|
|
|
+ }
|
|
|
+ if (FieldDataManager.Instance.waitToShowFieldFightEndView)
|
|
|
+ {
|
|
|
+ ViewManager.Show<FieldFightEndView>();
|
|
|
+ return;
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
}
|
|
|
}
|