public void UpdataTimeFun() { long ts = _timeFinal - EB.Time.Now; string colorStr = ""; if (ts < 0) { activityOver = true; ts = 0; colorStr = "[ff6699]"; } int day = (int)(ts / (24 * 60 * 60)); if (nextDayIndex != 7 - day) { nextDayIndex = 7 - day; InitDayList(); if (LTWelfareEvent.WelfareDiamondReset != null) { LTWelfareEvent.WelfareDiamondReset(); } } _dayLabel.text = string.Format("{0}{1}", colorStr, day); string timeStr = ""; timeStr = (ts > 0) ? (string.Format("{0:D2}:{1:D2}:{2:D2}", (ts % (24 * 60 * 60)) / (60 * 60), (ts % (60 * 60)) / 60, ts % 60)) : "00:00:00"; _timeLabel.text = string.Format(EB.Localizer.GetString("ID_DAY_FORMAT"), colorStr, timeStr); }
public void UpdataTimeFun() { long ts = timeFinal - EB.Time.Now;// Data.ZoneTimeDiff.GetServerTimeNow(); string colorStr = ""; if (ts < 0) { ActivityOver = true; ts = 0; colorStr = "[ff6699]"; } int day = (int)(ts / (24 * 60 * 60)); if (GrowUpDayNum != 7 - day) { GrowUpDayNum = 7 - day; if (LTWelfareEvent.WelfareGrowUpReset != null) { LTWelfareEvent.WelfareGrowUpReset(); } } DayLabel.text = string.Format("{0}{1}", colorStr, day); string timeStr = ""; timeStr = (ts > 0) ? (string.Format("{0:D2}:{1:D2}:{2:D2}", (ts % (24 * 60 * 60)) / (60 * 60), (ts % (60 * 60)) / 60, ts % 60)) : "00:00:00"; TimeLabel.text = string.Format(EB.Localizer.GetString("ID_DAY_FORMAT"), colorStr, timeStr); }
private void OnCompleteBtnClick() { if (!sTaskOver) { return; } sTaskOver = false; InputBlockerManager.Instance.Block(InputBlockReason.FUSION_BLOCK_UI_INTERACTION, 0.5f); LTWelfareModel.Instance.RequestComplete(Data.TaskId.ToString(), delegate(bool success) { if (success) { if (LTWelfareEvent.WelfareGrowUpUpdata != null) { LTWelfareEvent.WelfareGrowUpUpdata(); } { var ht = Johny.HashtablePool.Claim(); ht.Add("0", TitleLabel.text); MessageTemplateManager.ShowMessage(901036, ht, null); Johny.HashtablePool.Release(ht); } System.Action callback = delegate() { if (EB.Sparx.Hub.Instance.LevelRewardsManager.IsLevelUp) { LTMainHudManager.Instance.CheckLevelUp(delegate() { sTaskOver = true; }); } else { sTaskOver = true; } }; List <LTShowItemData> ItemDatas = TaskStaticData.GetItemRewardList(Data.TaskId); for (int i = 0; i < ItemDatas.Count; i++) { if (ItemDatas[i].id == "hc") { FusionTelemetry.CurrencyChangeData.PostEvent(FusionTelemetry.CurrencyChangeData.hc, ItemDatas[i].count, "福利成长目标"); } if (ItemDatas[i].id == "gold") { FusionTelemetry.CurrencyChangeData.PostEvent(FusionTelemetry.CurrencyChangeData.gold, ItemDatas[i].count, "福利成长目标"); } } { var ht = Johny.HashtablePool.Claim(); ht.Add("reward", ItemDatas); ht.Add("callback", callback); GlobalMenuManager.Instance.Open("LTShowRewardView", ht); } } sTaskOver = true; }); }
private void CallBack() { if (LTWelfareEvent.WelfareSignInUpdata != null) { LTWelfareEvent.WelfareSignInUpdata(); } }
private void OnTabClick() { if (isLock) { MessageTemplateManager.ShowMessage(eMessageUIType.FloatingText, EB.Localizer.GetString("ID_TARGET_LOCKED")); return; } if (LTWelfareEvent.WelfareGrowUpTabClick != null) { LTWelfareEvent.WelfareGrowUpTabClick(index); } }
private void OnClick() { if (_isLock) { MessageTemplateManager.ShowMessage(eMessageUIType.FloatingText, EB.Localizer.GetString("ID_TARGET_LOCKED")); return; } if (LTWelfareEvent.WelfareDiamondDayItemClicked != null) { LTWelfareEvent.WelfareDiamondDayItemClicked(_index); } }
private void OnBattlePassBtnClick() { if (!sTaskOver || LTWelfareGrowUpController.ActivityOver) { return; } sTaskOver = false; InputBlockerManager.Instance.Block(InputBlockReason.FUSION_BLOCK_UI_INTERACTION, 0.5f); if (!LTWelfareModel.Instance.HasBattlePass)//需要购买密令 { EB.IAP.Item GiftItem = null; EB.Sparx.Hub.Instance.WalletManager.GetGiftItem(6001, out GiftItem); //GlobalMenuManager.Instance.Open("LTChargeStoreGiftUI", GiftItem); GlobalMenuManager.Instance.Open("LTBattlePassTipsView", GiftItem); } else//领奖 { LTWelfareModel.Instance.RequestBattlePassComplete(Data.TaskId.ToString(), delegate(bool success) { if (success) { if (LTWelfareEvent.WelfareGrowUpUpdata != null) { LTWelfareEvent.WelfareGrowUpUpdata(); } { var ht = Johny.HashtablePool.Claim(); ht.Add("0", TitleLabel.text); MessageTemplateManager.ShowMessage(901036, ht, null); Johny.HashtablePool.Release(ht); } System.Action callback = delegate() { if (EB.Sparx.Hub.Instance.LevelRewardsManager.IsLevelUp) { LTMainHudManager.Instance.CheckLevelUp(delegate() { sTaskOver = true; }); } else { sTaskOver = true; } }; List <LTShowItemData> ItemDatas = Hotfix_LT.Data.TaskTemplateManager.Instance.GetBattlePassByTaskId(Data.TaskId); for (int i = 0; i < ItemDatas.Count; i++) { if (ItemDatas[i].id == "hc") { FusionTelemetry.CurrencyChangeData.PostEvent(FusionTelemetry.CurrencyChangeData.hc, ItemDatas[i].count, "福利成长获得"); } if (ItemDatas[i].id == "gold") { FusionTelemetry.CurrencyChangeData.PostEvent(FusionTelemetry.CurrencyChangeData.gold, ItemDatas[i].count, "福利成长获得"); } } { var ht = Johny.HashtablePool.Claim(); ht.Add("reward", ItemDatas); ht.Add("callback", callback); GlobalMenuManager.Instance.Open("LTShowRewardView", ht); } } sTaskOver = true; }); } sTaskOver = true; }
public void OnBtnClick() { if (LTWelfareModel.Instance.Welfare_FirstCharge() && !LTWelfareDataManager.Instance.EverydayAwardData.IsHaveReceiveFirstChargeGift) { int day = 0; if (!LTWelfareDataManager.Instance.EverydayAwardData.IsHaveReceiveFirstChargeGift1) { LTWelfareDataManager.Instance.EverydayAwardData.IsHaveReceiveFirstChargeGift1 = true; day = 1; } else if (!LTWelfareDataManager.Instance.EverydayAwardData.IsHaveReceiveFirstChargeGift2) { LTWelfareDataManager.Instance.EverydayAwardData.IsHaveReceiveFirstChargeGift2 = true; day = 2; } else if (!LTWelfareDataManager.Instance.EverydayAwardData.IsHaveReceiveFirstChargeGift3) { LTWelfareDataManager.Instance.EverydayAwardData.IsHaveReceiveFirstChargeGift3 = true; day = 3; } LTWelfareModel.Instance.ReceiveFirstChargeGift(day, delegate(bool successful) { if (successful) { if (LTWelfareEvent.WelfareHadFirstCharge != null) { LTWelfareEvent.WelfareHadFirstCharge(); } List <LTShowItemData> ItemDatas; if (day == 1) { ItemDatas = WelfareTemplateManager.Instance.FirstChargeAward1Data.AwardItemList; } else if (day == 2) { ItemDatas = WelfareTemplateManager.Instance.FirstChargeAward2Data.AwardItemList; } else if (day == 3) { ItemDatas = WelfareTemplateManager.Instance.FirstChargeAward3Data.AwardItemList; } else { ItemDatas = WelfareTemplateManager.Instance.FirstChargeAwardData.AwardItemList; } for (int i = 0; i < ItemDatas.Count; i++) { if (ItemDatas[i].id == "hc") { FusionTelemetry.CurrencyChangeData.PostEvent(FusionTelemetry.CurrencyChangeData.hc, ItemDatas[i].count, "福利首充获得"); } if (ItemDatas[i].id == "gold") { FusionTelemetry.CurrencyChangeData.PostEvent(FusionTelemetry.CurrencyChangeData.gold, ItemDatas[i].count, "福利首充获得"); } } GlobalMenuManager.Instance.Open("LTShowRewardView", ItemDatas);//GameUtils.ShowAwardMsg(WelfareTemplateManager.Instance.FirstChargeAwardData.AwardItemList); UpdateInfo(); } }); } else { InputBlockerManager.Instance.Block(InputBlockReason.FUSION_BLOCK_UI_INTERACTION, 0.5f); GlobalMenuManager.Instance.Open("LTChargeStoreHud"); } }
public override void OnFocus() { base.OnFocus(); //LTWelfareModel.Instance.UpdataTasks(); if (!hadSendRq) { //图鉴任务需要客户端先计算,再决定是否拉代码 List <LTWelfareGrowUpTaskData> levelList = LTWelfareModel.Instance.GetHandBookTasks(); if (LTWelfareGrowUpController.DayJudge()) { bool needResetHandBookData = false; if (levelList.Count > 0) { for (int i = 0; i < levelList.Count; i++) { if (!levelList[i].Finished) { Hotfix_LT.Data.TaskTemplate TaskTpl = levelList[i].TaskTpl; List <int> levels = LTPartnerHandbookManager.Instance.GetHandbookLevelList(); int id = int.Parse(TaskTpl.target_parameter_2); int count = int.Parse(TaskTpl.target_parameter_3); int curCount = 0; for (int j = 0; j < levels.Count; j++) { if (levels[j] >= id) { curCount++; } if (count == curCount) { needResetHandBookData = true; break; } } } } } if (needResetHandBookData) { LTWelfareModel.Instance.ResetHandBookData(delegate(bool success) { if (success) { hadSendRq = true; LTWelfareModel.Instance.UpdataTasks(); } }); } } } if (LTWelfareEvent.WelfareGrowUpUpdata != null) { LTWelfareEvent.WelfareGrowUpUpdata(); } if (LTWelfareEvent.WelfareOnfocus != null) { LTWelfareEvent.WelfareOnfocus(); } InitRedPoint(); }