From aecc6eb6929f50cbe8de3edf238aca7d6c69c604 Mon Sep 17 00:00:00 2001 From: gaoxin Date: Thu, 20 May 2021 21:00:29 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E7=89=B9=E6=9D=83=E4=BC=98=E5=8C=96?= =?UTF-8?q?=E3=80=91=E7=89=B9=E6=9D=83=E4=BB=BB=E5=8A=A1=E5=9C=A8=E5=85=B3?= =?UTF-8?q?=E5=8D=A1=E7=95=8C=E9=9D=A2=E5=A2=9E=E5=8A=A0=E5=BF=AB=E6=8D=B7?= =?UTF-8?q?=E5=85=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Modules/Fight/FightPointPassMainPanel.lua | 43 +++++++++++++++++-- .../~Lua/Modules/Player/JumpManager.lua | 12 ++++-- .../~Lua/Modules/Vip/VipManager.lua | 37 ++++++++++++++++ 3 files changed, 84 insertions(+), 8 deletions(-) diff --git a/Assets/ManagedResources/~Lua/Modules/Fight/FightPointPassMainPanel.lua b/Assets/ManagedResources/~Lua/Modules/Fight/FightPointPassMainPanel.lua index 86cf4cf442..03a8dfae95 100644 --- a/Assets/ManagedResources/~Lua/Modules/Fight/FightPointPassMainPanel.lua +++ b/Assets/ManagedResources/~Lua/Modules/Fight/FightPointPassMainPanel.lua @@ -127,7 +127,6 @@ function FightPointPassMainPanel:InitComponent() this.getRewardButton = Util.GetGameObject(self.gameObject, "Bg/RightDown/mainTask/getRewardButton") this.mainTaskGRewardImage = Util.GetGameObject(self.gameObject, "Bg/RightDown/mainTask/getRewardButton/getRewardImage") this.mainTaskJumpImage = Util.GetGameObject(self.gameObject, "Bg/RightDown/mainTask/getRewardButton/jumpImage") - this.mainTask:SetActive(false) this.GuideEffectGo = poolManager:LoadAsset("GuideEffect", PoolManager.AssetType.GameObject) this.GuideEffectGo.transform:SetParent(this.mainTaskGRewardImage.transform) @@ -300,6 +299,16 @@ function FightPointPassMainPanel:BindEvent() UIManager.OpenPanel(UIName.FightLevelChapterPanel) end) + Util.AddClick(this.getRewardButton, function() + local t, task = VipManager.GetVipTaskShowInFight() + if t == 1 and task.state == VipTaskStatusDef.NotFinished then + local taskConfigInfo = ConfigManager.GetConfigData(ConfigName.TaskConfig, task.missionId) + JumpManager.GoJump(taskConfigInfo.Jump[1]) + else + UIManager.OpenPanel(UIName.VipPanelV2) + end + end) + BindRedPointObject(RedPointType.DailyTaskMain, this.dailyRedPoint) BindRedPointObject(RedPointType.SecretTer_IsCanFight, this.fightRP) BindRedPointObject(RedPointType.XiaoYaoYouRedPoint, this.xiaoyaoRedPoint) @@ -338,6 +347,7 @@ function FightPointPassMainPanel:AddListener() Game.GlobalEvent:AddEvent(GameEvent.Mission.GetOpenServerRewardRefreshFightPoint, this.UpdateOpenSeverWelfare) Game.GlobalEvent:AddEvent(GameEvent.Player.OnShowBattleUpLvTip, this.RefreshBattleUpLvTip) Game.GlobalEvent:AddEvent(GameEvent.Player.OnPlayerLvChange, this.SetFightBtnText) + Game.GlobalEvent:AddEvent(GameEvent.Vip.OnVipTaskStatusChanged, this.refreshVipTask) end --移除事件监听(用于子类重写) @@ -351,6 +361,7 @@ function FightPointPassMainPanel:RemoveListener() Game.GlobalEvent:RemoveEvent(GameEvent.Mission.GetOpenServerRewardRefreshFightPoint, this.UpdateOpenSeverWelfare) Game.GlobalEvent:RemoveEvent(GameEvent.Player.OnShowBattleUpLvTip, this.RefreshBattleUpLvTip) Game.GlobalEvent:RemoveEvent(GameEvent.Player.OnPlayerLvChange, this.SetFightBtnText) + Game.GlobalEvent:RemoveEvent(GameEvent.Vip.OnVipTaskStatusChanged, this.refreshVipTask) end --界面打开时调用(用于子类重写) @@ -442,7 +453,31 @@ function FightPointPassMainPanel:OnShow() -- 刷新一次编队战斗力 FormationManager.RefreshMainFormationPower() PatFaceManager.RefreshPatface() + + -- 刷新任务显示 + this.refreshVipTask() end + + +-- 刷新任务显示 +function this.refreshVipTask() + local t, task = VipManager.GetVipTaskShowInFight() + -- 满级后不再显示 + this.mainTask:SetActive(t ~= -1) + if t == 0 then + -- 能激活时显示激活特权 + this.titleText.text = "前往升级特权" + this.progressText.text = "" + elseif t == 1 then + -- 不能激活时显示任务 + local taskConfigInfo = ConfigManager.GetConfigData(ConfigName.TaskConfig, task.missionId) + this.titleText.text = GetLanguageStrById(taskConfigInfo.Desc)..string.format("(%s/%s)", task.progress, taskConfigInfo.TaskValue[2][1]) + this.progressText.text = "" + this.mainTaskGRewardImage:SetActive(task.state ~= VipTaskStatusDef.NotFinished) + this.mainTaskJumpImage:SetActive(task.state == VipTaskStatusDef.NotFinished) + end +end + --寻宝显示 function this.UpdateFindTreasureMaterialNum() local mazeTreasureMax = ConfigManager.GetConfigData(ConfigName.PlayerLevelConfig,PlayerManager.level).MazeTreasureMax @@ -657,11 +692,11 @@ end --界面销毁时调用(用于子类重写) function FightPointPassMainPanel:OnDestroy() - + orginLayer=0 invadeMonster:OnDestroy() this.spLoader:Destroy() - poolManager:UnLoadAsset("GuideEffect", this.GuideEffectGo, PoolManager.AssetType.GameObject) - poolManager:UnLoadAsset("GuideEffect", this.GuideJumpEffectGo, PoolManager.AssetType.GameObject) + -- poolManager:UnLoadAsset("GuideEffect", this.GuideEffectGo, PoolManager.AssetType.GameObject) + -- poolManager:UnLoadAsset("GuideEffect", this.GuideJumpEffectGo, PoolManager.AssetType.GameObject) poolManager:UnLoadLive(fightAnimRes, this.animGo, PoolManager.AssetType.GameObject) SubUIManager.Close(this.UpView) SubUIManager.Close(this.BtView) diff --git a/Assets/ManagedResources/~Lua/Modules/Player/JumpManager.lua b/Assets/ManagedResources/~Lua/Modules/Player/JumpManager.lua index 451b9f81eb..4aa71b5442 100644 --- a/Assets/ManagedResources/~Lua/Modules/Player/JumpManager.lua +++ b/Assets/ManagedResources/~Lua/Modules/Player/JumpManager.lua @@ -1,4 +1,4 @@ -JumpManager = {}; +JumpManager = {}; local this = JumpManager local JumpConfig=ConfigManager.GetConfig(ConfigName.JumpConfig) function this.Initialize() @@ -242,10 +242,14 @@ local jumpDic = { UIManager.OpenPanel(UIName.GoodFriendMainPanel,nil,data[1]) end, [JumpType.Level] = function(data)--关卡 - - UIManager.CloseAllStack(true) local openPanle - openPanle = UIManager.OpenPanel(UIName.FightPointPassMainPanel) + if UIManager.IsTopShow(UIName.FightPointPassMainPanel) then + openPanle = UIManager.GetOpenPanel(UIName.FightPointPassMainPanel) + else + UIManager.CloseAllStack(true) + openPanle = UIManager.OpenPanel(UIName.FightPointPassMainPanel) + + end if openPanle then openPanle.ShowGuideGo(data[1]) end diff --git a/Assets/ManagedResources/~Lua/Modules/Vip/VipManager.lua b/Assets/ManagedResources/~Lua/Modules/Vip/VipManager.lua index e1593f5bbc..d34020a84c 100644 --- a/Assets/ManagedResources/~Lua/Modules/Vip/VipManager.lua +++ b/Assets/ManagedResources/~Lua/Modules/Vip/VipManager.lua @@ -505,4 +505,41 @@ function this.GetCurMinCanGetRewardLevel() end return math.min(VipManager.GetVipLevel() + 1, VipManager.GetMaxVipLevel()) end + + +-- 获取挂机界面显示内容 +function this.GetVipTaskShowInFight() + -- 满级 + if this.GetVipLevel() >= this.GetMaxVipLevel() then + return -1 + end + local taskListInfo = TaskManager.GetTypeTaskList(TaskTypeDef.VipTask) + local isfinish = true + local isGetReward = 0 + for i = 1, #taskListInfo do + -- 不是回收状态则未完成 + if taskListInfo[i].state ~= VipTaskStatusDef.Received then + isfinish = false + end + -- 找到第一个未领取的奖励 + if isGetReward == 0 then + if taskListInfo[i].state == VipTaskStatusDef.NotFinished then + isGetReward = i + end + end + -- 找到第一个可领取的奖励 + if taskListInfo[i].state == VipTaskStatusDef.CanReceive then + isGetReward = i + break + end + end + -- 激活 + if isfinish then + return 0 + else + return 1, taskListInfo[isGetReward] + end +end + + return this \ No newline at end of file