【引导】副本前引导添加

dev_chengFeng
gaoxin 2021-11-12 15:55:53 +08:00
parent 075de29090
commit 93640449f3
3 changed files with 48 additions and 5 deletions

View File

@ -27,6 +27,7 @@ GameEvent = {
GuidePanelScrollViewPos = "Guide.GuidePanelScrollViewPos",
BattleGuideDone = "Guide.BattleGuideDone",
FuncGuideDone = "Guide.FuncGuideDone",
},
Player = {
--金币数量改变

View File

@ -694,8 +694,10 @@ function this.ExcuteBattle()
PopupTipPanel.ShowTip(tip)
return
end
this.SetInitAnim()
-- 检测是否有前置引导
GuideManager.BeforeFightCheck(curFightId, function()
this.SetInitAnim()
end)
end

View File

@ -118,10 +118,48 @@ function this.OnFightPass(fightId)
if not guideId or guideId == 0 then
return
end
-- if not funcDic[guideId] then
table.insert(_FuncGuideList, guideId)
-- end
if funcDic[guideId] then
-- funcDic[guideId] = nil
return
end
--
table.insert(_FuncGuideList, guideId)
this.CheckFuncGuide()
end
-- 通过关卡时判断
function this.BeforeFightCheck(fightId, func)
-- 引导完成
local function OnFuncGuideDone()
if func then
func()
end
Game.GlobalEvent:RemoveEvent(GameEvent.Guide.FuncGuideDone, OnFuncGuideDone)
end
Game.GlobalEvent:AddEvent(GameEvent.Guide.FuncGuideDone, OnFuncGuideDone)
-- 正确性检测
if not fightId then
OnFuncGuideDone()
return
end
-- 是否开启引导
if not AppConst.isGuide then
OnFuncGuideDone()
return
end
-- 判断是否需要引导
local guideId = MainLevelConfig[fightId].BeforeGuideId
if not guideId or guideId == 0 then
OnFuncGuideDone()
return
end
-- 引导过了
if funcDic[guideId] then
-- funcDic[guideId] = nil
OnFuncGuideDone()
return
end
-- 功能引导检测
table.insert(_FuncGuideList, guideId)
this.CheckFuncGuide()
end
@ -182,6 +220,8 @@ function GuideManager.CheckFuncGuide()
GuideManager.ShowGuide(guideId)
end
table.remove(_FuncGuideList, 1)
else
Game.GlobalEvent:DispatchEvent(GameEvent.Guide.FuncGuideDone)
end
end