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 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 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(); }