|
@@ -1,4 +1,3 @@
|
|
|
-
|
|
|
using System;
|
|
|
using System.Collections.Generic;
|
|
|
using ET;
|
|
@@ -25,11 +24,13 @@ namespace GFGGame
|
|
|
_valueBarController.Dispose();
|
|
|
_valueBarController = null;
|
|
|
}
|
|
|
+
|
|
|
if (_ui != null)
|
|
|
{
|
|
|
_ui.Dispose();
|
|
|
_ui = null;
|
|
|
}
|
|
|
+
|
|
|
base.Dispose();
|
|
|
}
|
|
|
|
|
@@ -53,8 +54,8 @@ namespace GFGGame
|
|
|
_ui.m_comList.m_btnSign.target.onClick.Add(OnBtnSignClick);
|
|
|
_ui.m_comList.m_btnSupply.target.onClick.Add(OnBtnSupplyClick);
|
|
|
_ui.m_comList.m_btnGrowthFund.target.onClick.Add(OnBtnGrowthFundClick);
|
|
|
-
|
|
|
}
|
|
|
+
|
|
|
protected override void AddEventListener()
|
|
|
{
|
|
|
base.AddEventListener();
|
|
@@ -68,15 +69,19 @@ namespace GFGGame
|
|
|
|
|
|
_valueBarController.OnShown();
|
|
|
|
|
|
- _ui.m_comList.m_btnSevenDayLogin.target.visible = !(!FunctionOpenDataManager.Instance.CheckIsFunOpenById(typeof(SevenDayLoginView).Name, false)
|
|
|
- || ActivityDataManager.Instance.AllSevenDayBonusGot());
|
|
|
- _ui.m_comList.m_btnGrowthFund.target.visible = false;//(RoleDataManager.lvl >=20 && ShopDataManager.Instance.GrowthFundRewardList.Count < GrowthFundCfgArray.Instance.dataArray.Length);
|
|
|
+ _ui.m_comList.m_btnSevenDayLogin.target.visible =
|
|
|
+ !(!FunctionOpenDataManager.Instance.CheckIsFunOpenById(typeof(SevenDayLoginView).Name, false)
|
|
|
+ || ActivityDataManager.Instance.AllSevenDayBonusGot());
|
|
|
+ _ui.m_comList.m_btnGrowthFund.target.visible =
|
|
|
+ false; //(RoleDataManager.lvl >=20 && ShopDataManager.Instance.GrowthFundRewardList.Count < GrowthFundCfgArray.Instance.dataArray.Length);
|
|
|
|
|
|
_limitChargeInfo = ActivityGlobalDataManager.Instance.GetActivityInfoByType(ActivityType.XSLC);
|
|
|
if (ActivityGlobalDataManager.Instance.GetActivityInfoByType(ActivityType.OpenServerCharge).Count > 0)
|
|
|
{
|
|
|
- _limitChargeInfo.Add(ActivityGlobalDataManager.Instance.GetActivityInfoByType(ActivityType.OpenServerCharge)[0]);
|
|
|
+ _limitChargeInfo.Add(
|
|
|
+ ActivityGlobalDataManager.Instance.GetActivityInfoByType(ActivityType.OpenServerCharge)[0]);
|
|
|
}
|
|
|
+
|
|
|
_ui.m_comList.m_listLimitCharge.numItems = _limitChargeInfo.Count;
|
|
|
_ui.m_comList.m_listLimitCharge.ResizeToFit();
|
|
|
|
|
@@ -84,6 +89,7 @@ namespace GFGGame
|
|
|
{
|
|
|
Timers.inst.Add(1, 0, UpdateTime);
|
|
|
}
|
|
|
+
|
|
|
UpdateRedDot();
|
|
|
}
|
|
|
|
|
@@ -93,31 +99,35 @@ namespace GFGGame
|
|
|
base.OnHide();
|
|
|
Timers.inst.Remove(UpdateTime);
|
|
|
}
|
|
|
+
|
|
|
protected override void RemoveEventListener()
|
|
|
{
|
|
|
base.RemoveEventListener();
|
|
|
EventAgent.RemoveEventListener(ConstMessage.RED_CHANGE, UpdateRedDot);
|
|
|
}
|
|
|
+
|
|
|
private void UpdateTime(object param)
|
|
|
{
|
|
|
if (ActivityDataManager.Instance.actLimitChargeId > 0 || _limitChargeInfo.Count > 0)
|
|
|
{
|
|
|
for (int i = 0; i < _limitChargeInfo.Count; i++)
|
|
|
{
|
|
|
- ActivityInfo activityInfo = ActivityGlobalDataManager.Instance.GetActivityInfo(_limitChargeInfo[i].ActivityId);
|
|
|
+ ActivityInfo activityInfo =
|
|
|
+ ActivityGlobalDataManager.Instance.GetActivityInfo(_limitChargeInfo[i].ActivityId);
|
|
|
long curTime = TimeHelper.ServerNow();
|
|
|
long endTime = activityInfo.EndTime;
|
|
|
if (curTime < endTime)
|
|
|
{
|
|
|
- GTextField txtTime = _ui.m_comList.m_listLimitCharge.GetChildAt(i).asCom.GetChild("txtTime").asTextField;
|
|
|
+ GTextField txtTime = _ui.m_comList.m_listLimitCharge.GetChildAt(i).asCom.GetChild("txtTime")
|
|
|
+ .asTextField;
|
|
|
txtTime.text = string.Format("剩余时间:{0}", TimeUtil.FormattingTimeTo_DDHHmm(endTime - curTime));
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
private void RenderListLimitChargeItem(int index, GObject obj)
|
|
|
{
|
|
|
-
|
|
|
// _ui.m_comList.m_btnLimitChargeAddUp.target.visible = ActivityDataManager.Instance.actLimitChargeId > 0;
|
|
|
UI_Button1 item = UI_Button1.Proxy(obj);
|
|
|
ActivityOpenCfg openCfg = ActivityOpenCfgArray.Instance.GetCfg(_limitChargeInfo[index].ActivityId);
|
|
@@ -127,26 +137,31 @@ namespace GFGGame
|
|
|
if (ActivityDataManager.Instance.actLimitChargeId > 0)
|
|
|
{
|
|
|
//string path = "xslc_" + openCfg.res;
|
|
|
- item.m_loaIcon.url = ResPathUtil.GetActivityPath(openCfg.res);//"ui://DailyWelfare/hdbn_xslc_" + openCfg.res;
|
|
|
+ item.m_loaIcon.url =
|
|
|
+ ResPathUtil.GetActivityPath(openCfg.res); //"ui://DailyWelfare/hdbn_xslc_" + openCfg.res;
|
|
|
//item.m_loaTitle.url = "ui://DailyWelfare/hdbn_wz_xslc_" + openCfg.res;
|
|
|
- if(openCfg.res == "")
|
|
|
+ if (openCfg.res == "")
|
|
|
{
|
|
|
if (openCfg.id == 509)
|
|
|
{
|
|
|
- item.m_loaIcon.url = ResPathUtil.GetActivityPath("hdbn_xslc_suxx", "png"); ;
|
|
|
+ item.m_loaIcon.url = ResPathUtil.GetActivityPath("hdbn_xslc_suxx", "png");
|
|
|
+ ;
|
|
|
item.m_loaTitle.visible = false;
|
|
|
}
|
|
|
}
|
|
|
else if (openCfg.id == 502)
|
|
|
{
|
|
|
- item.m_loaIcon.url = ResPathUtil.GetActivityPath("hd_xianshilc", "png");;
|
|
|
+ item.m_loaIcon.url = ResPathUtil.GetActivityPath("hd_xianshilc", "png");
|
|
|
+ ;
|
|
|
item.m_loaTitle.visible = false;
|
|
|
}
|
|
|
else if (openCfg.id == 511)
|
|
|
{
|
|
|
- item.m_loaIcon.url = ResPathUtil.GetActivityPath("gg_banner_lc_zfy", "png");;
|
|
|
+ item.m_loaIcon.url = ResPathUtil.GetActivityPath("gg_banner_lc_zfy", "png");
|
|
|
+ ;
|
|
|
item.m_loaTitle.visible = false;
|
|
|
}
|
|
|
+
|
|
|
item.m_loaTitle.visible = false;
|
|
|
}
|
|
|
else if (openCfg.id == 501)
|
|
@@ -155,46 +170,62 @@ namespace GFGGame
|
|
|
item.m_loaTitle.url = "ui://DailyWelfare/hdbn_wz_xslc_xslgt";
|
|
|
item.m_loaTitle.visible = false;
|
|
|
}
|
|
|
- else if(openCfg.id == 505)
|
|
|
+ else if (openCfg.id == 505)
|
|
|
{
|
|
|
- item.m_loaIcon.url = ResPathUtil.GetActivityPath("gg_banner_lc_bjh", "png");;
|
|
|
+ item.m_loaIcon.url = ResPathUtil.GetActivityPath("gg_banner_lc_bjh", "png");
|
|
|
+ ;
|
|
|
item.m_loaTitle.visible = false;
|
|
|
}
|
|
|
- else if(openCfg.id == 507)
|
|
|
+ else if (openCfg.id == 507)
|
|
|
{
|
|
|
- item.m_loaIcon.url = ResPathUtil.GetActivityPath("gg_banner_lc_aliz", "png"); ;
|
|
|
+ item.m_loaIcon.url = ResPathUtil.GetActivityPath("gg_banner_lc_aliz", "png");
|
|
|
+ ;
|
|
|
item.m_loaTitle.visible = false;
|
|
|
}
|
|
|
else if (openCfg.id == 508)
|
|
|
{
|
|
|
- item.m_loaIcon.url = ResPathUtil.GetActivityPath("hdbn_xslc_dmdhdwn", "png"); ;
|
|
|
+ item.m_loaIcon.url = ResPathUtil.GetActivityPath("hdbn_xslc_dmdhdwn", "png");
|
|
|
+ ;
|
|
|
item.m_loaTitle.visible = false;
|
|
|
}
|
|
|
else if (openCfg.id == 509)
|
|
|
{
|
|
|
- item.m_loaIcon.url = ResPathUtil.GetActivityPath("hdbn_xslc_suxx", "png"); ;
|
|
|
+ item.m_loaIcon.url = ResPathUtil.GetActivityPath("hdbn_xslc_suxx", "png");
|
|
|
+ ;
|
|
|
+ item.m_loaTitle.visible = false;
|
|
|
+ }
|
|
|
+ else if (openCfg.id == 506)
|
|
|
+ {
|
|
|
+ item.m_loaTitle.visible = false;
|
|
|
+ string path = "xslc_" + openCfg.res;
|
|
|
+ item.m_loaIcon.url = ResPathUtil.GetActivityPath(path);//"ui://DailyWelfare/hdbn_xslc_" + openCfg.res;
|
|
|
item.m_loaTitle.visible = false;
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
ActivityOpenCfg OpenCfg = ActivityOpenCfgArray.Instance.GetCfg(openCfg.id);
|
|
|
- item.m_loaIcon.url = ResPathUtil.GetActivityPath("gg_banner_lc_zfy", "png"); ;
|
|
|
+ item.m_loaIcon.url = ResPathUtil.GetActivityPath("gg_banner_lc_zfy", "png");
|
|
|
+ ;
|
|
|
item.m_loaTitle.visible = false;
|
|
|
//item.target.visible = false;
|
|
|
UI_Button1.ProxyEnd();
|
|
|
return;
|
|
|
}
|
|
|
+
|
|
|
if (item.target.data == null && openCfg != null)
|
|
|
{
|
|
|
item.target.onClick.Add(OnBtnLimitChargeAddUpClick);
|
|
|
}
|
|
|
+
|
|
|
item.target.data = _limitChargeInfo[index].ActivityId;
|
|
|
UI_Button1.ProxyEnd();
|
|
|
}
|
|
|
+
|
|
|
private void OnBtnBackClick()
|
|
|
{
|
|
|
ViewManager.GoBackFrom(typeof(DailyWelfareView).FullName);
|
|
|
}
|
|
|
+
|
|
|
private void OnBtnLimitChargeAddUpClick(EventContext context)
|
|
|
{
|
|
|
GObject gObject = context.sender as GObject;
|
|
@@ -205,34 +236,46 @@ namespace GFGGame
|
|
|
ViewManager.Show<NewLimitChargeView>(new object[] { gObject.data });
|
|
|
return;
|
|
|
}
|
|
|
+
|
|
|
ViewManager.Show<LimitChargeView>(new object[] { gObject.data });
|
|
|
}
|
|
|
+
|
|
|
private void OnBtnSevenDayLoginClick()
|
|
|
{
|
|
|
ViewManager.Show<SevenDayLoginView>();
|
|
|
}
|
|
|
+
|
|
|
private void OnBtnSignClick()
|
|
|
{
|
|
|
ViewManager.Show<DailySignView>();
|
|
|
}
|
|
|
+
|
|
|
private void OnBtnSupplyClick()
|
|
|
{
|
|
|
ViewManager.Show<DailySupplyView>();
|
|
|
}
|
|
|
+
|
|
|
private void OnBtnGrowthFundClick()
|
|
|
{
|
|
|
- ViewManager.Show<StoreView>(new object[] { ConstStoreTabId.STORE_MONTH_CARD, ConstStoreSubId.STORE_GROWTH_FUND });
|
|
|
+ ViewManager.Show<StoreView>(new object[]
|
|
|
+ { ConstStoreTabId.STORE_MONTH_CARD, ConstStoreSubId.STORE_GROWTH_FUND });
|
|
|
}
|
|
|
+
|
|
|
private void UpdateRedDot()
|
|
|
{
|
|
|
for (int i = 0; i < _limitChargeInfo.Count; i++)
|
|
|
{
|
|
|
GComponent item = _ui.m_comList.m_listLimitCharge.GetChildAt(i).asCom;
|
|
|
- RedDotController.Instance.SetComRedDot(item, RedDotDataManager.Instance.GetLimiteChargeRewardRed(_limitChargeInfo[i].ActivityId), "", -40);
|
|
|
+ RedDotController.Instance.SetComRedDot(item,
|
|
|
+ RedDotDataManager.Instance.GetLimiteChargeRewardRed(_limitChargeInfo[i].ActivityId), "", -40);
|
|
|
}
|
|
|
- RedDotController.Instance.SetComRedDot(_ui.m_comList.m_btnSevenDayLogin.target, RedDotDataManager.Instance.GetSevenDayLoginRed(), "", -40);
|
|
|
- RedDotController.Instance.SetComRedDot(_ui.m_comList.m_btnSign.target, RedDotDataManager.Instance.DailySignRed(), "", -40);
|
|
|
- RedDotController.Instance.SetComRedDot(_ui.m_comList.m_btnSupply.target, RedDotDataManager.Instance.DailySupplyRed(), "", -40);
|
|
|
+
|
|
|
+ RedDotController.Instance.SetComRedDot(_ui.m_comList.m_btnSevenDayLogin.target,
|
|
|
+ RedDotDataManager.Instance.GetSevenDayLoginRed(), "", -40);
|
|
|
+ RedDotController.Instance.SetComRedDot(_ui.m_comList.m_btnSign.target,
|
|
|
+ RedDotDataManager.Instance.DailySignRed(), "", -40);
|
|
|
+ RedDotController.Instance.SetComRedDot(_ui.m_comList.m_btnSupply.target,
|
|
|
+ RedDotDataManager.Instance.DailySupplyRed(), "", -40);
|
|
|
}
|
|
|
}
|
|
|
}
|