From 8a960ece3b0dcaeaa3269643c228eddd2ef51f7e Mon Sep 17 00:00:00 2001 From: gaoxin Date: Thu, 2 Dec 2021 01:06:34 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E5=85=B3=E5=8D=A1=E3=80=91=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=E5=89=A7=E6=83=85=E5=85=B3=E5=8D=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Modules/Fight/FightPointPassMainPanel.lua | 54 ++++++++++++------- .../Modules/Fight/FightPointPassManager.lua | 11 ++++ 2 files changed, 45 insertions(+), 20 deletions(-) diff --git a/Assets/ManagedResources/~Lua/Modules/Fight/FightPointPassMainPanel.lua b/Assets/ManagedResources/~Lua/Modules/Fight/FightPointPassMainPanel.lua index 9931c5570c..b0a6dfe32a 100644 --- a/Assets/ManagedResources/~Lua/Modules/Fight/FightPointPassMainPanel.lua +++ b/Assets/ManagedResources/~Lua/Modules/Fight/FightPointPassMainPanel.lua @@ -419,25 +419,27 @@ function FightPointPassMainPanel:OnShow() -- 调用onshow invadeMonster:OnShow() + local curName = GetLanguageStrById(fightLevelConfig[FightPointPassManager.curOpenFight].Name) + local curDifficulty = fightLevelConfig[FightPointPassManager.curOpenFight].Difficulty + local chapterId = 0 + local str = "" + if not FightPointPassManager.IsChapterClossState() then + chapterId = math.floor(FightPointPassManager.lastPassFightId / 1000) + str = GetLanguageStrById(fightLevelConfig[FightPointPassManager.lastPassFightId].Name) + else + str = string.format("%s ", textColor[curDifficulty], curName) + chapterId = FightPointPassManager.GetCurChapterIndex() + end + this.areaName.text = str + if GetCurLanguage() ~= 0 then + this.areaName.gameObject.transform.localPosition = Vector2.New(0,0) + end + this.chapterName.text = GetLanguageStrById(fightLevelSetConfig[chapterId].Name) + + if not hasLoad then timePressStarted = Time.realtimeSinceStartup isAnimActive = false - local curName = GetLanguageStrById(fightLevelConfig[FightPointPassManager.curOpenFight].Name) - local curDifficulty = fightLevelConfig[FightPointPassManager.curOpenFight].Difficulty - local chapterId = 0 - local str = "" - if not FightPointPassManager.IsChapterClossState() then - chapterId = math.floor(FightPointPassManager.lastPassFightId / 1000) - str = GetLanguageStrById(fightLevelConfig[FightPointPassManager.lastPassFightId].Name) - else - str = string.format("%s ", textColor[curDifficulty], curName) - chapterId = FightPointPassManager.GetCurChapterIndex() - end - this.areaName.text = str - if GetCurLanguage() ~= 0 then - this.areaName.gameObject.transform.localPosition = Vector2.New(0,0) - end - this.chapterName.text = GetLanguageStrById(fightLevelSetConfig[chapterId].Name) -- 奖励预览 this.IntiReward() @@ -694,10 +696,22 @@ function this.ExcuteBattle() PopupTipPanel.ShowTip(tip) return end - -- 检测是否有前置引导 - GuideManager.BeforeFightCheck(curFightId, function() - this.SetInitAnim() - end) + -- 判断是否是剧情节点 + if fightLevelConfig[curFightId].StoryId > 0 then + StoryManager.EventTrigger(fightLevelConfig[curFightId].StoryId, function() + FightPointPassManager.ExecuteFightStory(curFightId, function(drop) + UIManager.OpenPanel(UIName.RewardItemPopup, drop, 1, function() + this:OnShow() + end) + end) + end) + else + -- 检测是否有前置引导 + GuideManager.BeforeFightCheck(curFightId, function() + this.SetInitAnim() + end) + end + end diff --git a/Assets/ManagedResources/~Lua/Modules/Fight/FightPointPassManager.lua b/Assets/ManagedResources/~Lua/Modules/Fight/FightPointPassManager.lua index 57ad86464e..8ba33f3307 100644 --- a/Assets/ManagedResources/~Lua/Modules/Fight/FightPointPassManager.lua +++ b/Assets/ManagedResources/~Lua/Modules/Fight/FightPointPassManager.lua @@ -352,6 +352,17 @@ function this.ExecuteFightBattle(monsterGroupId, fightId, callBack) UIManager.OpenPanel(UIName.BattlePanel, fightData, BATTLE_TYPE.STORY_FIGHT, callBack, fightId) end) end +-- 剧情关卡 +function this.ExecuteFightStory(fightId, func) + NetManager.LevelStarFightDataRequest("", fightId, function (msg) + NetManager.MapFightResultRequest(10000, "", fightId, BATTLE_TYPE.STORY_FIGHT, function (msg) + -- this.lastBattleResult.drop = msg.enventDrop + if func then + func(msg.enventDrop) + end + end) + end) +end -- 获取当前章节数 function this.GetCurChapterIndex()