From 89f201d8f989d0633635e859485eb80a08c307b1 Mon Sep 17 00:00:00 2001 From: gaoxin Date: Sun, 25 Apr 2021 11:41:15 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E5=BC=95=E5=AF=BC=E6=88=98=E6=96=97?= =?UTF-8?q?=E3=80=91=E6=B7=BB=E5=8A=A0=E8=B7=B3=E8=BF=87=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Modules/Battle/View/GuideBattlePanel.lua | 9 ++++- .../~Lua/Modules/Story/StoryDialoguePanel.lua | 39 ++++++++++--------- 2 files changed, 29 insertions(+), 19 deletions(-) diff --git a/Assets/ManagedResources/~Lua/Modules/Battle/View/GuideBattlePanel.lua b/Assets/ManagedResources/~Lua/Modules/Battle/View/GuideBattlePanel.lua index 95f40d0f52..830a2c3fbf 100644 --- a/Assets/ManagedResources/~Lua/Modules/Battle/View/GuideBattlePanel.lua +++ b/Assets/ManagedResources/~Lua/Modules/Battle/View/GuideBattlePanel.lua @@ -54,6 +54,13 @@ function this:BindEvent() BattleRecordManager.SubmitBattleRecord() end, 0.5) + Util.AddClick(this.BtnGM, function () + if BattleManager.IsCanOperate() and not BattleLogic.IsEnd then + BattleView.EndBattle() + BattleLogic.IsEnd = true + end + end) + end --添加事件监听(用于子类重写) @@ -81,7 +88,7 @@ function this:OnOpen(_fightData, _endFunc, guideType) fightType = BATTLE_TYPE.Test --判定战斗类型 this.BG:GetComponent("Image").sprite = Util.LoadSprite(BattleManager.GetBattleBg(fightType)) - this.BtnGM:SetActive(false) + this.BtnGM:SetActive(true) this.BtnExit:SetActive(false) this.ButtonLock:SetActive(false) this.BtnTimeScale:SetActive(false) diff --git a/Assets/ManagedResources/~Lua/Modules/Story/StoryDialoguePanel.lua b/Assets/ManagedResources/~Lua/Modules/Story/StoryDialoguePanel.lua index 7c701606b0..1a042dd910 100644 --- a/Assets/ManagedResources/~Lua/Modules/Story/StoryDialoguePanel.lua +++ b/Assets/ManagedResources/~Lua/Modules/Story/StoryDialoguePanel.lua @@ -53,27 +53,29 @@ end --绑定事件(用于子类重写) function StoryDialoguePanel:BindEvent() Util.AddClick(this.btnNext, function () - local isEnd = OpConfig[optionID].JumpType == 4 - if isEnd and static_callBack then - static_callBack() - static_callBack = nil - end - - -- 点击下一步关闭配音音效关闭 - SoundManager.StopSoundByChannel(10) - - StoryManager.StoryJumpType(optionID, self) + self:GoNext(optionID) end) Util.AddClick(this.btnJump, function () if jumpId == 0 then self:ClosePanel() else - StoryManager.StoryJumpType(jumpId, self) + self:GoNext(jumpId) end end) end +function StoryDialoguePanel:GoNext(optionID) + local isEnd = OpConfig[optionID].JumpType == 4 + if isEnd and static_callBack then + static_callBack() + static_callBack = nil + end + -- 点击下一步关闭配音音效关闭 + SoundManager.StopSoundByChannel(10) + StoryManager.StoryJumpType(optionID, self) +end + --添加事件监听(用于子类重写) function StoryDialoguePanel:AddListener() @@ -158,13 +160,14 @@ function this.RefreshPanel(eventId, isFirstOpen) -- 跳转值 optionID = options[1] - jumpId = chapterEventPointData[eventId].NextOptPanelId - if jumpId and jumpId ~= 0 then - -- jumpId = chapterEventPointData[jumpId].Option[1] - jumpId = options[2] - else - jumpId = 0 - end + jumpId = options[2] or 0 + -- jumpId = chapterEventPointData[eventId].NextOptPanelId + -- if jumpId and jumpId ~= 0 then + -- -- jumpId = chapterEventPointData[jumpId].Option[1] + -- jumpId = options[2] + -- else + -- jumpId = 0 + -- end -- 角色信息 local contents = string.split(showValues, "|") local resId = tonumber(contents[1])