From b65581fe71c1d2fe94473e4158fc8da7df46437e Mon Sep 17 00:00:00 2001 From: gaoxin Date: Tue, 8 Sep 2020 11:58:34 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BC=95=E5=AF=BC=E6=88=98=E6=96=97=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../UI/Story/StoryDialoguePanel.prefab | 8 ++-- .../~Lua/Modules/Battle/BattleManager.lua | 9 ++++ .../Modules/Battle/Logic/SkillManager.lua | 5 +++ .../~Lua/Modules/Battle/View/BattleView.lua | 16 ++++++- .../Modules/Battle/View/GuideBattlePanel.lua | 45 +++++++++++++++++-- .../~Lua/Modules/Story/StoryDialoguePanel.lua | 8 +++- .../~Lua/Modules/Story/StoryManager.lua | 12 ++--- 7 files changed, 89 insertions(+), 14 deletions(-) diff --git a/Assets/ManagedResources/Prefabs/UI/Story/StoryDialoguePanel.prefab b/Assets/ManagedResources/Prefabs/UI/Story/StoryDialoguePanel.prefab index c0c622a706..b2ea42247e 100644 --- a/Assets/ManagedResources/Prefabs/UI/Story/StoryDialoguePanel.prefab +++ b/Assets/ManagedResources/Prefabs/UI/Story/StoryDialoguePanel.prefab @@ -643,7 +643,7 @@ RectTransform: m_LocalScale: {x: 1, y: 1, z: 1} m_Children: [] m_Father: {fileID: 224208791220860236} - m_RootOrder: 2 + m_RootOrder: 3 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0.5, y: 0.5} m_AnchorMax: {x: 0.5, y: 0.5} @@ -1059,7 +1059,7 @@ RectTransform: m_LocalScale: {x: 1, y: 1, z: 1} m_Children: [] m_Father: {fileID: 224208791220860236} - m_RootOrder: 3 + m_RootOrder: 1 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 1, y: 1} @@ -1210,9 +1210,9 @@ RectTransform: m_LocalScale: {x: 1, y: 1, z: 1} m_Children: - {fileID: 224207229500578536} + - {fileID: 224668597310509170} - {fileID: 224220640790156676} - {fileID: 224709729234618838} - - {fileID: 224668597310509170} - {fileID: 224067770939544360} - {fileID: 224348206395964596} - {fileID: 224518222973870546} @@ -1433,7 +1433,7 @@ RectTransform: m_LocalScale: {x: 1, y: 1, z: 1} m_Children: [] m_Father: {fileID: 224208791220860236} - m_RootOrder: 1 + m_RootOrder: 2 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0.5, y: 0.5} m_AnchorMax: {x: 0.5, y: 0.5} diff --git a/Assets/ManagedResources/~Lua/Modules/Battle/BattleManager.lua b/Assets/ManagedResources/~Lua/Modules/Battle/BattleManager.lua index a0de200dc9..7c23e5f667 100644 --- a/Assets/ManagedResources/~Lua/Modules/Battle/BattleManager.lua +++ b/Assets/ManagedResources/~Lua/Modules/Battle/BattleManager.lua @@ -687,4 +687,13 @@ function this.GetBattleBg(fightType) return "r_zhandou_changjing_"..tostring(index) end +-- 引导战斗暂停控制 +this.isGuidePause = false +function this.IsGuidePause() + return this.isGuidePause +end +function this.SetGuidePause(isPause) + this.isGuidePause = isPause +end + return this \ No newline at end of file diff --git a/Assets/ManagedResources/~Lua/Modules/Battle/Logic/SkillManager.lua b/Assets/ManagedResources/~Lua/Modules/Battle/Logic/SkillManager.lua index ec4f6fa5cd..f4674b73dd 100644 --- a/Assets/ManagedResources/~Lua/Modules/Battle/Logic/SkillManager.lua +++ b/Assets/ManagedResources/~Lua/Modules/Battle/Logic/SkillManager.lua @@ -43,6 +43,7 @@ function this.SetTurnRoundFunc(func) this.TurnRoundFunc = func end function this.CheckTurnRound() + -- 如果正在释放技能 if this.IsSkilling then return end @@ -60,6 +61,10 @@ end -- function this.Update() + -- 如果正在引导战斗 + if BattleManager and BattleManager.IsGuidePause() then + return + end -- if this.IsSkilling then return diff --git a/Assets/ManagedResources/~Lua/Modules/Battle/View/BattleView.lua b/Assets/ManagedResources/~Lua/Modules/Battle/View/BattleView.lua index e92bb9f8ad..81042b6e09 100644 --- a/Assets/ManagedResources/~Lua/Modules/Battle/View/BattleView.lua +++ b/Assets/ManagedResources/~Lua/Modules/Battle/View/BattleView.lua @@ -322,6 +322,7 @@ function this.InitBattleEvent() BattleLogic.Event:AddEvent(BattleEventName.BattleEnd, this.EndBattle) BattleLogic.Event:AddEvent(BattleEventName.BattleOrderChange, this.BattleOrderChange) BattleLogic.Event:AddEvent(BattleEventName.BattleRoundChange, this.BattleRoundChange) + BattleLogic.Event:AddEvent(BattleEventName.RoleTurnStart, this.RoleTurnChange) end -- 清除战斗数据 @@ -332,6 +333,7 @@ function this.ClearBattleEvent() BattleLogic.Event:RemoveEvent(BattleEventName.BattleEnd, this.EndBattle) BattleLogic.Event:RemoveEvent(BattleEventName.BattleOrderChange, this.BattleOrderChange) BattleLogic.Event:RemoveEvent(BattleEventName.BattleRoundChange, this.BattleRoundChange) + BattleLogic.Event:RemoveEvent(BattleEventName.RoleTurnStart, this.RoleTurnChange) end --敌军出现的表现 @@ -410,12 +412,19 @@ function this.EnemyAppear() end end +-- 角色轮转回调(不出手的位置不会回调) +function this.RoleTurnChange(role) + -- 回调UI层 + if this.root.RoleTurnChange then + this.root.RoleTurnChange(role) + end +end + -- 回合变化 function this.BattleRoundChange(Round) -- 回调UI层 this.root.OnRoundChanged(Round) - -- 异妖CD if this.DiffMonsterFlag then local slider = BattleLogic.GetTeamSkillCastSlider(0) @@ -636,6 +645,11 @@ function this.GuideCheckEnemyDead(role) end function this.OnUpdate() + -- 引导战斗暂停 + if BattleManager.IsGuidePause() then + return + end + -- 判断是否结束 if BattleLogic.IsEnd then -- 所有角色血条 for r, v in pairs(tbRoleDispose) do diff --git a/Assets/ManagedResources/~Lua/Modules/Battle/View/GuideBattlePanel.lua b/Assets/ManagedResources/~Lua/Modules/Battle/View/GuideBattlePanel.lua index a19d10c0b0..83998ad3ba 100644 --- a/Assets/ManagedResources/~Lua/Modules/Battle/View/GuideBattlePanel.lua +++ b/Assets/ManagedResources/~Lua/Modules/Battle/View/GuideBattlePanel.lua @@ -165,22 +165,61 @@ function this.ShowBattleResult(result, msg) end end --- 战斗波次变化回调 function this.OnOrderChanged(order) - -- body --显示波次 this.orderText.text = string.format("%d/%d", order, BattleLogic.TotalOrder) end -- 战斗回合变化回调 +this.curRound = 1 function this.OnRoundChanged(round) - -- body + -- 轮数变化 + this.curRound = round --显示波次 local curRound, maxRound = BattleLogic.GetCurRound() this.roundText.text = string.format(Language[10252], curRound, maxRound) end + +-- 引导节点配置 +local _GuideConfig = { + -- 轮数 = {阵营 = { 释放位置 = 对话id}}} + [1] = { + [0] = { + [1] = 300008, + [4] = 300010, + } + }, + [2] = { + [0] = { + [1] = 300012, + [2] = 300014, + [3] = 300016, + } + } +} +-- 角色轮转回调 +function this.RoleTurnChange(role) + local curCamp = role.camp + local curPos = role.position + + if not _GuideConfig[this.curRound] then + return + end + if not _GuideConfig[this.curRound][curCamp] then + return + end + if not _GuideConfig[this.curRound][curCamp][curPos] then + return + end + + BattleManager.SetGuidePause(true) + StoryManager.EventTrigger(_GuideConfig[this.curRound][curCamp][curPos], function() + BattleManager.SetGuidePause(false) + end) +end + -- 由BattleView驱动 function this.OnUpdate() diff --git a/Assets/ManagedResources/~Lua/Modules/Story/StoryDialoguePanel.lua b/Assets/ManagedResources/~Lua/Modules/Story/StoryDialoguePanel.lua index 5f644cb35b..51b02fa5bf 100644 --- a/Assets/ManagedResources/~Lua/Modules/Story/StoryDialoguePanel.lua +++ b/Assets/ManagedResources/~Lua/Modules/Story/StoryDialoguePanel.lua @@ -142,7 +142,13 @@ function this.RefreshPanel(eventId, isFirstOpen) this.mask:SetActive(showMask) -- 设置对话背景图 - this.Bg.sprite = Util.LoadSprite(chapterEventPointData[eventId].DialogueBg) + local bgName = chapterEventPointData[eventId].DialogueBg + if not bgName or bgName == "" then + this.Bg.gameObject:SetActive(false) + else + this.Bg.gameObject:SetActive(true) + this.Bg.sprite = Util.LoadSprite(chapterEventPointData[eventId].DialogueBg) + end StoryDialoguePanel:SetScenceEffect(eventId) -- 跳转值 diff --git a/Assets/ManagedResources/~Lua/Modules/Story/StoryManager.lua b/Assets/ManagedResources/~Lua/Modules/Story/StoryManager.lua index 98bc732ec8..1555f247ea 100644 --- a/Assets/ManagedResources/~Lua/Modules/Story/StoryManager.lua +++ b/Assets/ManagedResources/~Lua/Modules/Story/StoryManager.lua @@ -47,9 +47,9 @@ function this.EventTrigger(eventId, callBack) elseif showType == 12 then -- 选择界面 UIManager.OpenPanel(UIName.StoryDialoguePanel, eventId, false) --UIManager.OpenPanel(UIName.StoryOptionPopup, eventId) - elseif showType == 10 then -- 起名字界面 + elseif showType == 10 then -- 起名字界面 UIManager.OpenPanel(UIName.CreateNamePopup, showType, eventId, showValues, options) - elseif showType == 14 then -- 引导战斗 + elseif showType == 14 then -- 引导战斗 local fb = ConfigManager.GetConfigData(ConfigName.FakeBattle, 1004) local testFightData = { fightData = loadstring("return "..fb.FightData)(), @@ -58,7 +58,11 @@ function this.EventTrigger(eventId, callBack) maxRound = 20 } UIManager.OpenPanel(UIName.GuideBattlePanel, testFightData, function() - StoryManager.EventTrigger(300017, callBack) + StoryManager.EventTrigger(300017, function () + PatFaceManager.isLogin = true + UIManager.OpenPanel(UIName.FightPointPassMainPanel) + LoadingPanel.End() + end) end) end else @@ -91,8 +95,6 @@ end -- 剧情跳转 function this.StoryJumpType(optionId, panel) local jumpType = chapterOptionData[optionId].JumpType - - if jumpType then if jumpType == 4 then -- 关闭所有界面,结束对话 if panel then