|
@@ -157,6 +157,7 @@ namespace GFGGame
|
|
|
EventAgent.AddEventListener(ConstMessage.VIEW_CLOSED, CheckAutoShowViews);
|
|
|
EventAgent.AddEventListener(ConstMessage.AFTER_DATA_INITED, OnAfterDataInited);
|
|
|
EventAgent.AddEventListener(ConstMessage.NEW_YEAR_RED_ENVELOPE_INFO, RefreshBtnNewYearRedEnvelope);
|
|
|
+ EventAgent.AddEventListener(ConstMessage.ACTIVITY_RED_CHANGE, UpdateActivityRedDot);
|
|
|
}
|
|
|
|
|
|
protected override void RemoveEventListener()
|
|
@@ -170,6 +171,7 @@ namespace GFGGame
|
|
|
EventAgent.RemoveEventListener(ConstMessage.VIEW_CLOSED, CheckAutoShowViews);
|
|
|
EventAgent.RemoveEventListener(ConstMessage.AFTER_DATA_INITED, OnAfterDataInited);
|
|
|
EventAgent.RemoveEventListener(ConstMessage.NEW_YEAR_RED_ENVELOPE_INFO, RefreshBtnNewYearRedEnvelope);
|
|
|
+ EventAgent.RemoveEventListener(ConstMessage.ACTIVITY_RED_CHANGE, UpdateActivityRedDot);
|
|
|
}
|
|
|
|
|
|
protected override void OnShown()
|
|
@@ -258,15 +260,15 @@ namespace GFGGame
|
|
|
private void OnAfterDataInited()
|
|
|
{
|
|
|
GetAdIds();
|
|
|
+ UpdateButtons();
|
|
|
OnRedDotChanged();
|
|
|
CheckAutoShowViews();
|
|
|
- UpdateButtons();
|
|
|
}
|
|
|
|
|
|
private async void UpdateButtons()
|
|
|
{
|
|
|
// 刚进游戏请求数据
|
|
|
- if (!MainDataManager.Instance.needUpdateProxyData)
|
|
|
+ if (MainDataManager.Instance.needUpdateProxyData)
|
|
|
{
|
|
|
MainDataManager.Instance.needUpdateProxyData = false;
|
|
|
var result = await NewYearRedEnvelopeSProxy.ReqGetRedPacketInfo();
|
|
@@ -285,6 +287,11 @@ namespace GFGGame
|
|
|
if (result)
|
|
|
{
|
|
|
RefreshBtnActivityFYJY();
|
|
|
+ if (_ui.m_btnActivityFYJY.target.visible)
|
|
|
+ {
|
|
|
+ RedDotController.Instance.SetComRedDot(_ui.m_btnActivityFYJY.target
|
|
|
+ , RedDotDataManager.Instance.GetActivityFYJYRed(), "", -15, -1);
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
// 后续活动按钮的刷新检测
|
|
@@ -926,6 +933,7 @@ namespace GFGGame
|
|
|
//LogUtil.LogEditor($"MainUIView OnRedDotChanged GameGlobal.AfterDataInited {GameGlobal.AfterDataInited} AutoShowCompleted {GameGlobal.AutoShowCompleted}");
|
|
|
//暂时用这种方法优化下,红点的实现要重构!!!
|
|
|
//LogUtil.LogEditor("MainUIView UpdateRedDot OnRedDotChanged");
|
|
|
+
|
|
|
redPointUpdateFrame = 0;
|
|
|
}
|
|
|
|
|
@@ -1064,6 +1072,24 @@ namespace GFGGame
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ /// <summary>
|
|
|
+ /// 刷新指定活动的红点
|
|
|
+ /// </summary>
|
|
|
+ /// <param name="context"></param>
|
|
|
+ private void UpdateActivityRedDot(EventContext context)
|
|
|
+ {
|
|
|
+ int activityType = (int)context.data;
|
|
|
+ switch (activityType)
|
|
|
+ {
|
|
|
+ case ActivityType.AfternoonLeisure:
|
|
|
+ if (_ui.m_btnActivityFYJY.target.visible)
|
|
|
+ {
|
|
|
+ RedDotController.Instance.SetComRedDot(_ui.m_btnActivityFYJY.target, RedDotDataManager.Instance.GetActivityFYJYRed(), "", -15, -1);
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
private void CheckProbabilityUp()
|
|
|
{
|
|
|
//long curTime = TimeHelper.ServerNow();
|