|
@@ -92,7 +92,8 @@ namespace GFGGame
|
|
|
EventAgent.AddEventListener(ConstMessage.ITEM_CHANGED, UpdateListItemData);
|
|
|
EventAgent.AddEventListener(ConstMessage.NUMERIC_CHANGE, UpdateListItemData);
|
|
|
EventAgent.AddEventListener(ConstMessage.LUCKY_BOX_FREE_TIME_CHANGED, UpdateFreeInfo);
|
|
|
-
|
|
|
+ EventAgent.AddEventListener(ConstMessage.LUCKY_BOX_ACTIVITY_REWARD, UpdateBtnReward);
|
|
|
+ EventAgent.AddEventListener(ConstMessage.ACTIVITY_LUCKY_BOX, UpdateBtnReward);
|
|
|
}
|
|
|
protected override void OnShown()
|
|
|
{
|
|
@@ -104,7 +105,7 @@ namespace GFGGame
|
|
|
_activeBoxId = 0;
|
|
|
int activityId = ActivityDataManager.Instance.GetCurOpenActiveByType(ConstLimitTimeActivityType.ActLimitTsy);
|
|
|
if (activityId > 0)
|
|
|
- GetWishingPoolInfo();
|
|
|
+ GetWishingPoolInfo(activityId);
|
|
|
|
|
|
if (LuckyBoxDataManager.Instance.RotatingId > 0)
|
|
|
{
|
|
@@ -138,16 +139,15 @@ namespace GFGGame
|
|
|
updateBoxEffect();
|
|
|
|
|
|
Timers.inst.AddUpdate(CheckGuide);
|
|
|
-
|
|
|
Timers.inst.Add(1f, 0, OnTimerUpdate, 1);
|
|
|
}
|
|
|
|
|
|
- private async void GetWishingPoolInfo()
|
|
|
+ private async void GetWishingPoolInfo(int activityId)
|
|
|
{
|
|
|
bool result = await LuckyBoxSProxy.ReqGetWishingPoolInfo();
|
|
|
if (result)
|
|
|
{
|
|
|
- int index = LuckyBoxDataManager.Instance.KsActivityId.IndexOf(5001);
|
|
|
+ int index = LuckyBoxDataManager.Instance.KsActivityId.IndexOf(activityId);
|
|
|
if (index < 0 || !LuckyBoxDataManager.Instance.VsStatus[index])
|
|
|
ViewManager.Show<LuckyBoxWishView>(ConstLimitTimeActivityType.ActLimitTsy);
|
|
|
}
|
|
@@ -162,7 +162,7 @@ namespace GFGGame
|
|
|
if (freeTime > 0)
|
|
|
{
|
|
|
long timeDifference = freeTime - TimeHelper.ServerNow();
|
|
|
- if (timeDifference> 0)
|
|
|
+ if (timeDifference > 0)
|
|
|
{
|
|
|
comBox.m_comLuckBoxBtn.m_comCostOne.m_c1.selectedIndex = 0;
|
|
|
comBox.m_comLuckBoxBtn.m_txtFreeTime.visible = true;
|
|
@@ -174,8 +174,11 @@ namespace GFGGame
|
|
|
comBox.m_comLuckBoxBtn.m_comCostOne.m_c1.selectedIndex = 1;
|
|
|
comBox.m_comLuckBoxBtn.m_txtFreeTime.visible = false;
|
|
|
}
|
|
|
+ RedDotController.Instance.SetComRedDot(comBox.m_comLuckBoxBtn.m_btnBuyOne, comBox.m_comLuckBoxBtn.m_comCostOne.m_c1.selectedIndex == 1);
|
|
|
}
|
|
|
|
|
|
+ RedDotController.Instance.SetComRedDot(_ui.m_btnLeft, LuckyBoxDataManager.Instance.RedBtnLeft(_curIndex));
|
|
|
+ RedDotController.Instance.SetComRedDot(_ui.m_btnRight, LuckyBoxDataManager.Instance.RedBtnRight(_curIndex),"",-60,70);
|
|
|
UI_ComBox1.ProxyEnd();
|
|
|
}
|
|
|
|
|
@@ -220,6 +223,7 @@ namespace GFGGame
|
|
|
LuckyBoxDataManager.Instance.luckyBoxIndex = _curIndex;
|
|
|
}
|
|
|
|
|
|
+ List<GObject> _listActivityBtnObj = new List<GObject>();
|
|
|
private void UpdateListItem()
|
|
|
{
|
|
|
int boxId = LuckyBoxDataManager.Instance.luckyBoxIds[_curIndex];
|
|
@@ -228,11 +232,16 @@ namespace GFGGame
|
|
|
|
|
|
GObject obj = _ui.m_listBg.GetChildAt(_curIndex);
|
|
|
UI_ComBox1 comBox = UI_ComBox1.Proxy(obj);
|
|
|
-
|
|
|
+ _listActivityBtnObj.Add(obj);
|
|
|
int activityId = ActivityDataManager.Instance.GetCurOpenActiveByType(ConstLimitTimeActivityType.ActLimitTsy);
|
|
|
if (activityId > 0 && boxId == LuckyBoxDataManager.BOX_ID_2) {
|
|
|
comBox.m_showActivityType.selectedIndex = 1;
|
|
|
UpGiftBox(comBox);
|
|
|
+ if (comBox.m_btnRule.data == null)
|
|
|
+ {
|
|
|
+ comBox.m_btnRule.onClick.Add(RuleController.ShowRuleView);
|
|
|
+ comBox.m_btnRule.data = 300024;
|
|
|
+ }
|
|
|
}
|
|
|
else
|
|
|
comBox.m_showActivityType.selectedIndex = 0;
|
|
@@ -285,7 +294,7 @@ namespace GFGGame
|
|
|
|
|
|
obj.data = boxId;
|
|
|
|
|
|
- comBox.m_grpTime.visible = (boxId == _activeBoxId || boxId == LuckyBoxDataManager.BOX_ID_2);
|
|
|
+ comBox.m_grpTime.visible = (boxId == _activeBoxId);
|
|
|
if (boxId == _activeBoxId)
|
|
|
{
|
|
|
long endTime = LuckyBoxDataManager.Instance.endTime;
|
|
@@ -305,9 +314,20 @@ namespace GFGGame
|
|
|
UpdateFreeInfo();
|
|
|
}
|
|
|
|
|
|
+ private void UpdateBtnReward()
|
|
|
+ {
|
|
|
+ if (_curIndex == 1) {
|
|
|
+ GObject obj = _ui.m_listBg.GetChildAt(_curIndex);
|
|
|
+ UI_ComBox1 comBox = UI_ComBox1.Proxy(obj);
|
|
|
+ RedDotController.Instance.SetComRedDot(comBox.m_btnReward, RedDotDataManager.Instance.GetActLuckyBoxRewardRed(ConstLimitTimeActivityType.ActLimitTsy));
|
|
|
+
|
|
|
+ comBox.m_txtCount.SetVar("value", ActivityDataManager.Instance.lastTsyDrawCount.ToString()).FlushVars();
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
private void OnClikcBtnReward()
|
|
|
{
|
|
|
- ViewManager.Show<ActivityThemeLuckyBoxBonusView>();
|
|
|
+ ViewManager.Show<ActivityThemeLuckyBoxBonusView>(ConstLimitTimeActivityType.ActLimitTsy);
|
|
|
}
|
|
|
|
|
|
private void OnClikcBtnShop()
|
|
@@ -320,7 +340,7 @@ namespace GFGGame
|
|
|
{
|
|
|
int boxId = LuckyBoxDataManager.Instance.luckyBoxIds[_curIndex];
|
|
|
LuckyBoxCfg cfg = LuckyBoxCfgArray.Instance.GetCfg(boxId);
|
|
|
- comBox.m_txtCount.SetVar("value", ActivityDataManager.Instance.lastDrawCount.ToString()).FlushVars();
|
|
|
+ comBox.m_txtCount.SetVar("value", ActivityDataManager.Instance.lastTsyDrawCount.ToString()).FlushVars();
|
|
|
comBox.m_txtCount.SetVar("name", cfg.name).FlushVars();
|
|
|
|
|
|
var activityInfoByTypeList = ActivityGlobalDataManager.Instance.GetActivityInfoByType(ActivityType.XSLB3);
|
|
@@ -362,6 +382,7 @@ namespace GFGGame
|
|
|
comBox.m_btnGiftBag.visible = true;
|
|
|
}
|
|
|
}
|
|
|
+ UpdateBtnReward();
|
|
|
}
|
|
|
|
|
|
//限时礼包按钮点击执行方法
|
|
@@ -418,14 +439,35 @@ namespace GFGGame
|
|
|
{
|
|
|
GObject item = _ui.m_listBg.GetChildAt(1);
|
|
|
if (item == null) return;
|
|
|
- GObject textField = item.asCom.GetChild("txtTime");
|
|
|
+ GObject textField = item.asCom.GetChild("txtTsyTime");
|
|
|
if (textField == null) return;
|
|
|
- long time = 100;
|
|
|
- string strTime = time > TimeUtil.SECOND_PER_DAY * 100 ? TimeUtil.FormattingTimeTo_DDHHmm(time) : TimeUtil.FormattingTimeTo_HHmmss(time);
|
|
|
- textField.asTextField.text = string.Format("概率提升剩余:{0}", strTime);
|
|
|
+ int activityId = ActivityDataManager.Instance.GetCurOpenActiveByType(ConstLimitTimeActivityType.ActLimitTsy);
|
|
|
+ var activityCfg = ActivityOpenCfgArray.Instance.GetCfg(activityId);
|
|
|
+ long endTime = TimeUtil.DateTimeToTimestamp(activityCfg.endTime);
|
|
|
+ long curTime = TimeHelper.ServerNow();
|
|
|
+ if (endTime < curTime)
|
|
|
+ {
|
|
|
+ PromptController.Instance.ShowFloatTextPrompt("活动已结束");
|
|
|
+ Timers.inst.Remove(UpdateTime);
|
|
|
+ OnClickBtnBack();
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ TimeUtil.FormattingTime(curTime, endTime, out int num, out string str);
|
|
|
+ textField.asTextField.text = "概率提升剩余: " + TimeUtil.FormattingTimeTo_DDHHmm(endTime - curTime);
|
|
|
+
|
|
|
+ //=====限时礼包倒计时
|
|
|
+ //UpGiftBox();
|
|
|
+ //EventAgent.DispatchEvent(ConstMessage.LUCKY_BOX_TIME);
|
|
|
+ //=====限时礼包倒计时END
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+ private void UpdateTime(object param = null)
|
|
|
+ {
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
private void updateBoxEffect()
|
|
|
{
|
|
|
if (isActiveBoxOpen)
|
|
@@ -456,11 +498,15 @@ namespace GFGGame
|
|
|
}
|
|
|
LuckyBoxDataManager.Instance.CheckItemEnough(boxId, LuckyBoxDataManager.ONCE_TIME, async () =>
|
|
|
{
|
|
|
+ int activityId = 0;
|
|
|
+ if (boxId == LuckyBoxDataManager.BOX_ID_2) {
|
|
|
+ activityId = ActivityDataManager.Instance.GetCurOpenActiveByType(ConstLimitTimeActivityType.ActLimitTsy);
|
|
|
+ }
|
|
|
bool result = false;
|
|
|
if (freeTime > 0 && freeTime < TimeHelper.ServerNow())
|
|
|
- result = await LuckyBoxSProxy.ReqGetBonus(boxId, LuckyBoxDataManager.ONCE_TIME, true);
|
|
|
+ result = await LuckyBoxSProxy.ReqGetBonus(boxId, LuckyBoxDataManager.ONCE_TIME, true, activityId);
|
|
|
else
|
|
|
- result = await LuckyBoxSProxy.ReqGetBonus(boxId, LuckyBoxDataManager.ONCE_TIME);
|
|
|
+ result = await LuckyBoxSProxy.ReqGetBonus(boxId, LuckyBoxDataManager.ONCE_TIME,false, activityId);
|
|
|
|
|
|
if (result)
|
|
|
{
|
|
@@ -490,13 +536,16 @@ namespace GFGGame
|
|
|
}
|
|
|
LuckyBoxDataManager.Instance.CheckItemEnough(boxId, LuckyBoxDataManager.TEN_TIME, async () =>
|
|
|
{
|
|
|
-
|
|
|
- bool result = await LuckyBoxSProxy.ReqGetBonus(boxId, LuckyBoxDataManager.TEN_TIME);
|
|
|
+ int activityId = 0;
|
|
|
+ if (boxId == LuckyBoxDataManager.BOX_ID_2)
|
|
|
+ {
|
|
|
+ activityId = ActivityDataManager.Instance.GetCurOpenActiveByType(ConstLimitTimeActivityType.ActLimitTsy);
|
|
|
+ }
|
|
|
+ bool result = await LuckyBoxSProxy.ReqGetBonus(boxId, LuckyBoxDataManager.TEN_TIME,false, activityId);
|
|
|
if (result)
|
|
|
{
|
|
|
ViewManager.Show<LuckyBoxStarView>(null, new object[] { typeof(LuckyBoxView).FullName, boxId });
|
|
|
LogServerHelper.SendPlayParticipationLog((int)PlayParticipationEnum.ZAI_XING, 2);
|
|
|
-
|
|
|
}
|
|
|
});
|
|
|
}
|
|
@@ -524,6 +573,8 @@ namespace GFGGame
|
|
|
EventAgent.RemoveEventListener(ConstMessage.ITEM_CHANGED, UpdateListItemData);
|
|
|
EventAgent.RemoveEventListener(ConstMessage.NUMERIC_CHANGE, UpdateListItemData);
|
|
|
EventAgent.RemoveEventListener(ConstMessage.LUCKY_BOX_FREE_TIME_CHANGED, UpdateFreeInfo);
|
|
|
+ EventAgent.RemoveEventListener(ConstMessage.LUCKY_BOX_ACTIVITY_REWARD, UpdateBtnReward);
|
|
|
+ EventAgent.RemoveEventListener(ConstMessage.ACTIVITY_LUCKY_BOX, UpdateBtnReward);
|
|
|
}
|
|
|
|
|
|
private void OnClickBtnBack()
|
|
@@ -596,6 +647,9 @@ namespace GFGGame
|
|
|
comBox.m_comLuckBoxBtn.m_comCostOne.m_c1.selectedIndex = 0;
|
|
|
comBox.m_comLuckBoxBtn.m_txtFreeTime.visible = false;
|
|
|
}
|
|
|
+ RedDotController.Instance.SetComRedDot(comBox.m_comLuckBoxBtn.m_btnBuyOne, comBox.m_comLuckBoxBtn.m_comCostOne.m_c1.selectedIndex == 1);
|
|
|
+
|
|
|
+ UI_ComBox1.ProxyEnd();
|
|
|
}
|
|
|
}
|
|
|
}
|