|
@@ -52,18 +52,17 @@ namespace GFGGame
|
|
|
base.AddEventListener();
|
|
|
EventAgent.AddEventListener(ConstMessage.NUMERIC_CHANGE, RefreshList);
|
|
|
EventAgent.AddEventListener(ConstMessage.NEWLIMITCHARGE_GET, OnBtnRightClick);
|
|
|
- //EventAgent.AddEventListener(ConstMessage.NUMERIC_CHANGE, UpdateRedDot);
|
|
|
+ EventAgent.AddEventListener(ConstMessage.NUMERIC_CHANGE, UpdateRedDot);
|
|
|
}
|
|
|
protected override void OnShown()
|
|
|
{
|
|
|
base.OnShown();
|
|
|
|
|
|
|
|
|
- _ui.m_loaBg.url = ResPathUtil.GetBgImgPath("zjm_bg1","jpg");
|
|
|
+ _ui.m_loaBg.url = ResPathUtil.GetBgImgPath("zjm_bg1", "jpg");
|
|
|
_activityId = (int)(this.viewData as object[])[0];
|
|
|
_rechargeCfgs = ActivityRechargeCfgArray.Instance.GetCfgsByactivityId(_activityId);
|
|
|
_activityInfo = ActivityGlobalDataManager.Instance.GetActivityInfo(_activityId);
|
|
|
- //UpdateRedDot();
|
|
|
//RefreshList();
|
|
|
//由于这个需要外部参数所以在onshown里面预加载
|
|
|
PreloadManager.Instance.PreloadSuitRes(_rechargeCfgs[0].suitId, ResType.Both, new int[] { ConstDressUpItemType.BEI_JING }, false);
|
|
@@ -88,8 +87,9 @@ namespace GFGGame
|
|
|
_ui.m_btnLeft.visible = _curSelectIndex == 0 ? false : true;
|
|
|
_ui.m_btnRight.visible = _curSelectIndex < _rechargeCfgs.Count - 1 ? true : false;
|
|
|
_ui.m_packageName.text = SuitCfgArray.Instance.GetCfg(_rechargeCfgs[_curSelectIndex].suitId).name;
|
|
|
+ UpdateRedDot();
|
|
|
//预加载套装,对于不同suitid
|
|
|
- for (int i = 1; i< _rechargeCfgs.Count; i++)
|
|
|
+ for (int i = 1; i < _rechargeCfgs.Count; i++)
|
|
|
{
|
|
|
if (_rechargeCfgs[i].suitId != _rechargeCfgs[i - 1].suitId)
|
|
|
{
|
|
@@ -105,7 +105,7 @@ namespace GFGGame
|
|
|
{
|
|
|
base.OnHide();
|
|
|
DressUpObjUI dressUpObjUI = _ui.m_showItem.m_holder.data as DressUpObjUI;
|
|
|
- if(dressUpObjUI != null)
|
|
|
+ if (dressUpObjUI != null)
|
|
|
{
|
|
|
dressUpObjUI.Dispose();
|
|
|
}
|
|
@@ -118,7 +118,7 @@ namespace GFGGame
|
|
|
base.RemoveEventListener();
|
|
|
EventAgent.RemoveEventListener(ConstMessage.NUMERIC_CHANGE, RefreshList);
|
|
|
EventAgent.RemoveEventListener(ConstMessage.NEWLIMITCHARGE_GET, OnBtnRightClick);
|
|
|
- //EventAgent.RemoveEventListener(ConstMessage.NUMERIC_CHANGE, UpdateRedDot);
|
|
|
+ EventAgent.RemoveEventListener(ConstMessage.NUMERIC_CHANGE, UpdateRedDot);
|
|
|
}
|
|
|
|
|
|
private void RefreshList()
|
|
@@ -163,7 +163,7 @@ namespace GFGGame
|
|
|
}
|
|
|
dressUpObjUI = item.m_holder.data as DressUpObjUI;
|
|
|
dressUpObjUI.ResetSceneObj(120, false, true, null, false);
|
|
|
- dressUpObjUI.dressUpObj.PutOnSuitCfg(vipCfg.suitId, true, new int[] { ConstDressUpItemType.BEI_JING }, false, false);
|
|
|
+ dressUpObjUI.dressUpObj.PutOnSuitCfg(vipCfg.suitId, true, new int[] { ConstDressUpItemType.BEI_JING }, false, false);
|
|
|
dressUpObjUI.UpdateWrapper(item.m_holder);
|
|
|
}
|
|
|
previousIndex = _rechargeCfgs[index].suitId;
|
|
@@ -184,7 +184,7 @@ namespace GFGGame
|
|
|
item.m_txtGiftBag.text = string.Format("活动期间累计获得{0}会员积分({1}/{2})", _rechargeCfgs[index].value, limitChargeExp, _rechargeCfgs[index].value);
|
|
|
if (limitChargeExp >= _rechargeCfgs[index].value)
|
|
|
{
|
|
|
- if(_activityInfo.GetRewards.IndexOf(_rechargeCfgs[index].id) >= 0)
|
|
|
+ if (_activityInfo.GetRewards.IndexOf(_rechargeCfgs[index].id) >= 0)
|
|
|
{
|
|
|
item.m_btnGetGiftBag.grayed = true;
|
|
|
item.m_btnGetGiftBag.title = "已领取";
|
|
@@ -248,7 +248,7 @@ namespace GFGGame
|
|
|
string name = SuitCfgArray.Instance.GetCfg(_rechargeCfgs[_curSelectIndex].suitId).name;
|
|
|
_ui.m_packageName.text = name;
|
|
|
UpdateSuitView();
|
|
|
- //UpdateRedDot();
|
|
|
+ UpdateRedDot();
|
|
|
}
|
|
|
private void OnBtnRightClick()
|
|
|
{
|
|
@@ -257,9 +257,57 @@ namespace GFGGame
|
|
|
string name = SuitCfgArray.Instance.GetCfg(_rechargeCfgs[_curSelectIndex].suitId).name;
|
|
|
_ui.m_packageName.text = name;
|
|
|
UpdateSuitView();
|
|
|
- //UpdateRedDot();
|
|
|
+ UpdateRedDot();
|
|
|
|
|
|
}
|
|
|
+ private void UpdateRedDot()
|
|
|
+ {
|
|
|
+ int indexPrior = Math.Max(0, _curSelectIndex - 1);
|
|
|
+ int indexNext = Math.Min(_rechargeCfgs.Count, _curSelectIndex + 1);
|
|
|
+ SetRedDot(indexPrior);
|
|
|
+ SetRedDot(indexNext);
|
|
|
+ }
|
|
|
+
|
|
|
+ private void SetRedDot(int index)
|
|
|
+ {
|
|
|
+ long limitChargeExp = _activityInfo.CountValue;
|
|
|
+ if (limitChargeExp >= _rechargeCfgs[index].value)
|
|
|
+ {
|
|
|
+ if (_activityInfo.GetRewards.IndexOf(_rechargeCfgs[index].id) >= 0)
|
|
|
+ {
|
|
|
+ if (index < _curSelectIndex)
|
|
|
+ {
|
|
|
+ RedDotController.Instance.SetComRedDot(_ui.m_btnLeft, false);
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ RedDotController.Instance.SetComRedDot(_ui.m_btnRight, false);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ if (index < _curSelectIndex)
|
|
|
+ {
|
|
|
+ RedDotController.Instance.SetComRedDot(_ui.m_btnLeft, true);
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ RedDotController.Instance.SetComRedDot(_ui.m_btnRight, true);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ if (index < _curSelectIndex)
|
|
|
+ {
|
|
|
+ RedDotController.Instance.SetComRedDot(_ui.m_btnLeft, false);
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ RedDotController.Instance.SetComRedDot(_ui.m_btnRight, false);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
private void OnBtnChargeClick()
|
|
|
{
|
|
|
ViewManager.Show<StoreView>(new object[] { ConstStoreTabId.STORE_CHARGE, ConstStoreSubId.STORE_CHARGE });
|