|
@@ -58,11 +58,6 @@ namespace GFGGame
|
|
|
|
|
|
_dressUpObjUI = new DressUpObjUI("SceneSuitFoster");
|
|
_dressUpObjUI = new DressUpObjUI("SceneSuitFoster");
|
|
|
|
|
|
- _ui.m_list.itemRenderer = ListItemRenderer;
|
|
|
|
- _ui.m_list.SetVirtual();
|
|
|
|
- //_ui.m_list.scrollPane.onScrollEnd.Add(UpdateSuitView);
|
|
|
|
- _ui.m_list.scrollPane.decelerationRate = 0.8f;
|
|
|
|
-
|
|
|
|
_ui.m_btnLeft.onClick.Add(OnBtnLeftClick);
|
|
_ui.m_btnLeft.onClick.Add(OnBtnLeftClick);
|
|
_ui.m_btnRight.onClick.Add(OnBtnRightClick);
|
|
_ui.m_btnRight.onClick.Add(OnBtnRightClick);
|
|
_ui.m_btnBack.onClick.Add(OnBtnBackClick);
|
|
_ui.m_btnBack.onClick.Add(OnBtnBackClick);
|
|
@@ -80,10 +75,6 @@ namespace GFGGame
|
|
|
|
|
|
|
|
|
|
_ui.m_loaBg.url = ResPathUtil.GetBgImgPath("bg_fhl");
|
|
_ui.m_loaBg.url = ResPathUtil.GetBgImgPath("bg_fhl");
|
|
- //_curSelectIndex = Math.Max(0, RoleDataManager.vipLv - 1);
|
|
|
|
- //_ui.m_list.selectedIndex = _curSelectIndex;
|
|
|
|
- //_ui.m_list.ScrollToView(_curSelectIndex);
|
|
|
|
- //_activityId = 501;
|
|
|
|
_activityId = (int)(this.viewData as object[])[0];
|
|
_activityId = (int)(this.viewData as object[])[0];
|
|
_rechargeCfgs = ActivityRechargeCfgArray.Instance.GetCfgsByactivityId(_activityId);
|
|
_rechargeCfgs = ActivityRechargeCfgArray.Instance.GetCfgsByactivityId(_activityId);
|
|
_activityInfo = ActivityGlobalDataManager.Instance.GetActivityInfo(_activityId);
|
|
_activityInfo = ActivityGlobalDataManager.Instance.GetActivityInfo(_activityId);
|
|
@@ -95,18 +86,18 @@ namespace GFGGame
|
|
_ui.m_packageName.text = name;
|
|
_ui.m_packageName.text = name;
|
|
|
|
|
|
_ui.m_btnLeft.visible = _curSelectIndex == 0 ? false : true;
|
|
_ui.m_btnLeft.visible = _curSelectIndex == 0 ? false : true;
|
|
- _ui.m_btnRight.visible = _curSelectIndex < _ui.m_list.numItems - 1 ? true : false;
|
|
|
|
|
|
+ _ui.m_btnRight.visible = _curSelectIndex < _rechargeCfgs.Count - 1 ? true : false;
|
|
|
|
|
|
- _ui.m_list.ScrollToView(_curSelectIndex);
|
|
|
|
_ui.m_packageName.text = SuitCfgArray.Instance.GetCfg(_rechargeCfgs[_curSelectIndex].suitId).name;
|
|
_ui.m_packageName.text = SuitCfgArray.Instance.GetCfg(_rechargeCfgs[_curSelectIndex].suitId).name;
|
|
|
|
|
|
|
|
+ ItemRenderer(_curSelectIndex);
|
|
|
|
+
|
|
Timers.inst.Add(1, 0, UpdateTime);
|
|
Timers.inst.Add(1, 0, UpdateTime);
|
|
}
|
|
}
|
|
|
|
|
|
protected override void OnHide()
|
|
protected override void OnHide()
|
|
{
|
|
{
|
|
base.OnHide();
|
|
base.OnHide();
|
|
- if (_ui.m_list.numItems > 0) _ui.m_list.ScrollToView(0);
|
|
|
|
Timers.inst.Remove(UpdateTime);
|
|
Timers.inst.Remove(UpdateTime);
|
|
}
|
|
}
|
|
protected override void RemoveEventListener()
|
|
protected override void RemoveEventListener()
|
|
@@ -118,17 +109,15 @@ namespace GFGGame
|
|
|
|
|
|
private void RefreshList()
|
|
private void RefreshList()
|
|
{
|
|
{
|
|
- _ui.m_list.numItems = _rechargeCfgs.Count;
|
|
|
|
|
|
+ ItemRenderer(_curSelectIndex);
|
|
}
|
|
}
|
|
- private void ListItemRenderer(int index, GObject obj)
|
|
|
|
|
|
+ private void ItemRenderer(int index)
|
|
{
|
|
{
|
|
|
|
|
|
ActivityRechargeCfg lastVipCfg = _rechargeCfgs[index];
|
|
ActivityRechargeCfg lastVipCfg = _rechargeCfgs[index];
|
|
- ActivityRechargeCfg vipCfg = _rechargeCfgs[index];
|
|
|
|
-
|
|
|
|
|
|
+ ActivityRechargeCfg vipCfg = _rechargeCfgs[index];
|
|
|
|
|
|
-
|
|
|
|
- UI_ListShowItem item = UI_ListShowItem.Proxy(obj);
|
|
|
|
|
|
+ UI_ListShowItem item = _ui.m_showItem;
|
|
string name = SuitCfgArray.Instance.GetCfg(vipCfg.suitId).name;
|
|
string name = SuitCfgArray.Instance.GetCfg(vipCfg.suitId).name;
|
|
item.m_txtName0.text = name;
|
|
item.m_txtName0.text = name;
|
|
if (vipCfg.res != "")
|
|
if (vipCfg.res != "")
|
|
@@ -174,13 +163,7 @@ namespace GFGGame
|
|
bool isGet = MathUtil.isBitSet(GameGlobal.myNumericComponent.GetAsInt(NumericType.VipGetStatus), vipCfg.id);
|
|
bool isGet = MathUtil.isBitSet(GameGlobal.myNumericComponent.GetAsInt(NumericType.VipGetStatus), vipCfg.id);
|
|
long limitChargeExp = _activityInfo.CountValue;
|
|
long limitChargeExp = _activityInfo.CountValue;
|
|
item.m_btnGetGiftBag.grayed = limitChargeExp < _rechargeCfgs[index].value;
|
|
item.m_btnGetGiftBag.grayed = limitChargeExp < _rechargeCfgs[index].value;
|
|
- //RedDotController.Instance.SetComRedDot(item.m_btnGetGiftBag, !isGet && RoleDataManager.vipLv >= vipCfg.id);
|
|
|
|
- //bool canGet = GameGlobal.myNumericComponent.GetAsInt(NumericType.VipWeekGetStatus) == 0 && RoleDataManager.vipLv == vipCfg.id;
|
|
|
|
-
|
|
|
|
- //long limitChargeExp = _activityInfo.CountValue;// GameGlobal.myNumericComponent.GetAsInt(NumericType.TotalRechargeScore);
|
|
|
|
item.m_txtGiftBag.text = string.Format("活动期间累计获得{0}会员积分({1}/{2})", _rechargeCfgs[index].value, limitChargeExp, _rechargeCfgs[index].value);
|
|
item.m_txtGiftBag.text = string.Format("活动期间累计获得{0}会员积分({1}/{2})", _rechargeCfgs[index].value, limitChargeExp, _rechargeCfgs[index].value);
|
|
-
|
|
|
|
- UI_ListVipItem.ProxyEnd();
|
|
|
|
}
|
|
}
|
|
|
|
|
|
private void ListRewardItemRender(int index, GObject obj)
|
|
private void ListRewardItemRender(int index, GObject obj)
|
|
@@ -225,7 +208,6 @@ namespace GFGGame
|
|
|
|
|
|
if (_curSelectIndex == 0) return;
|
|
if (_curSelectIndex == 0) return;
|
|
_curSelectIndex = _curSelectIndex - 1;
|
|
_curSelectIndex = _curSelectIndex - 1;
|
|
- _ui.m_list.ScrollToView(_curSelectIndex);
|
|
|
|
string name = SuitCfgArray.Instance.GetCfg(_rechargeCfgs[_curSelectIndex].suitId).name;
|
|
string name = SuitCfgArray.Instance.GetCfg(_rechargeCfgs[_curSelectIndex].suitId).name;
|
|
_ui.m_packageName.text = name;
|
|
_ui.m_packageName.text = name;
|
|
UpdateSuitView();
|
|
UpdateSuitView();
|
|
@@ -233,9 +215,8 @@ namespace GFGGame
|
|
}
|
|
}
|
|
private void OnBtnRightClick()
|
|
private void OnBtnRightClick()
|
|
{
|
|
{
|
|
- if (_curSelectIndex == _ui.m_list.numItems - 1) return;
|
|
|
|
|
|
+ if (_curSelectIndex == _rechargeCfgs.Count - 1) return;
|
|
_curSelectIndex = _curSelectIndex + 1;
|
|
_curSelectIndex = _curSelectIndex + 1;
|
|
- _ui.m_list.ScrollToView(_curSelectIndex);
|
|
|
|
string name = SuitCfgArray.Instance.GetCfg(_rechargeCfgs[_curSelectIndex].suitId).name;
|
|
string name = SuitCfgArray.Instance.GetCfg(_rechargeCfgs[_curSelectIndex].suitId).name;
|
|
_ui.m_packageName.text = name;
|
|
_ui.m_packageName.text = name;
|
|
UpdateSuitView();
|
|
UpdateSuitView();
|
|
@@ -248,10 +229,9 @@ namespace GFGGame
|
|
}
|
|
}
|
|
private void UpdateSuitView()
|
|
private void UpdateSuitView()
|
|
{
|
|
{
|
|
- _curSelectIndex = _ui.m_list.GetFirstChildInView();
|
|
|
|
- _ui.m_list.selectedIndex = _curSelectIndex;
|
|
|
|
_ui.m_btnLeft.visible = _curSelectIndex == 0 ? false : true;
|
|
_ui.m_btnLeft.visible = _curSelectIndex == 0 ? false : true;
|
|
- _ui.m_btnRight.visible = _curSelectIndex < _ui.m_list.numItems - 1 ? true : false;
|
|
|
|
|
|
+ _ui.m_btnRight.visible = _curSelectIndex < _rechargeCfgs.Count - 1 ? true : false;
|
|
|
|
+ ItemRenderer(_curSelectIndex);
|
|
}
|
|
}
|
|
|
|
|
|
private void UpdateTime(object param)
|
|
private void UpdateTime(object param)
|
|
@@ -261,36 +241,6 @@ namespace GFGGame
|
|
_ui.m_txtTime.text = TimeUtil.FormattingTimeTo_DDHHmm(endTime - curTime);
|
|
_ui.m_txtTime.text = TimeUtil.FormattingTimeTo_DDHHmm(endTime - curTime);
|
|
}
|
|
}
|
|
|
|
|
|
- //private void UpdateRedDot()
|
|
|
|
- //{
|
|
|
|
-
|
|
|
|
- // bool leftRed = false;
|
|
|
|
- // bool rightRed = false;
|
|
|
|
- // VipCfg[] vipCfgs = VipCfgArray.Instance.dataArray;
|
|
|
|
- // for (int i = 1; i < vipCfgs.Length; i++)
|
|
|
|
- // {
|
|
|
|
- // bool isGet = MathUtil.isBitSet(GameGlobal.myNumericComponent.GetAsInt(NumericType.VipGetStatus), vipCfgs[i].id);
|
|
|
|
- // bool red = !isGet && RoleDataManager.vipLv >= vipCfgs[i].id;
|
|
|
|
-
|
|
|
|
- // if (red && _curSelectIndex > i - 1)
|
|
|
|
- // {
|
|
|
|
- // leftRed = true;
|
|
|
|
- // break;
|
|
|
|
- // }
|
|
|
|
- // if (red && _curSelectIndex + 1 < i)
|
|
|
|
- // {
|
|
|
|
- // rightRed = true;
|
|
|
|
- // break;
|
|
|
|
- // }
|
|
|
|
- // }
|
|
|
|
-
|
|
|
|
- // if (GameGlobal.myNumericComponent.GetAsInt(NumericType.VipWeekGetStatus) == 0 && RoleDataManager.vipLv > 0 && _curSelectIndex > RoleDataManager.vipLv - 1) { leftRed = true; }
|
|
|
|
- // if (GameGlobal.myNumericComponent.GetAsInt(NumericType.VipWeekGetStatus) == 0 && RoleDataManager.vipLv > 0 && _curSelectIndex + 1 < RoleDataManager.vipLv) { rightRed = true; }
|
|
|
|
- // RedDotController.Instance.SetComRedDot(_ui.m_btnLeft, leftRed);
|
|
|
|
- // RedDotController.Instance.SetComRedDot(_ui.m_btnRight, rightRed);
|
|
|
|
-
|
|
|
|
- //}
|
|
|
|
-
|
|
|
|
private void OnListItemClick(EventContext context)
|
|
private void OnListItemClick(EventContext context)
|
|
{
|
|
{
|
|
GComponent comItem = (context.data as GComponent);
|
|
GComponent comItem = (context.data as GComponent);
|