From 069d42bacab4a8fa8d5cd8e5707c263bc31bafdc Mon Sep 17 00:00:00 2001 From: jiaoyangna <3046463818@qq.com> Date: Sat, 14 Nov 2020 14:16:10 +0800 Subject: [PATCH] =?UTF-8?q?=E7=9A=AE=E8=82=A4=E5=88=B0=E6=9C=9F=E5=88=B7?= =?UTF-8?q?=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../~Lua/Modules/RoleInfo/RoleInfoPanel.lua | 8 ++++++++ .../~Lua/Modules/RoleInfo/RoleSkinPanel.lua | 7 ++++--- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/Assets/ManagedResources/~Lua/Modules/RoleInfo/RoleInfoPanel.lua b/Assets/ManagedResources/~Lua/Modules/RoleInfo/RoleInfoPanel.lua index 522a387431..4de3c575c8 100644 --- a/Assets/ManagedResources/~Lua/Modules/RoleInfo/RoleInfoPanel.lua +++ b/Assets/ManagedResources/~Lua/Modules/RoleInfo/RoleInfoPanel.lua @@ -191,6 +191,7 @@ end --添加事件监听(用于子类重写) function RoleInfoPanel:AddListener() + Game.GlobalEvent:AddEvent(GameEvent.Role.UpdateSkin, this.UpdateSkinShow) for i = 1, #this.PageList do if this.PageList[i] then this.PageList[i]:AddListener() @@ -200,6 +201,7 @@ end --移除事件监听(用于子类重写) function RoleInfoPanel:RemoveListener() + Game.GlobalEvent:RemoveEvent(GameEvent.Role.UpdateSkin,this.UpdateSkinShow) for i = 1, #this.PageList do if this.PageList[i] then this.PageList[i]:RemoveListener() @@ -207,6 +209,12 @@ function RoleInfoPanel:RemoveListener() end end +this.UpdateSkinShow = function() + if _CurPageIndex == 4 then + this:OnPageTabChange(_CurPageIndex) + end +end + --界面打开时调用(用于子类重写) function RoleInfoPanel:OnOpen(_curHeroData, _heroDatas,_isUpZhen,_index) curHeroData, heroDatas,isUpZhen = _curHeroData, _heroDatas,_isUpZhen diff --git a/Assets/ManagedResources/~Lua/Modules/RoleInfo/RoleSkinPanel.lua b/Assets/ManagedResources/~Lua/Modules/RoleInfo/RoleSkinPanel.lua index f1891cc078..e9cf89653d 100644 --- a/Assets/ManagedResources/~Lua/Modules/RoleInfo/RoleSkinPanel.lua +++ b/Assets/ManagedResources/~Lua/Modules/RoleInfo/RoleSkinPanel.lua @@ -25,11 +25,11 @@ function RoleSkinPanel:BindEvent() end --添加事件监听(用于子类重写) function RoleSkinPanel:AddListener() - Game.GlobalEvent:AddEvent(GameEvent.Role.UpdateSkin, this.UpdateShow) + end --移除事件监听(用于子类重写) function RoleSkinPanel:RemoveListener() - Game.GlobalEvent:RemoveEvent(GameEvent.Role.UpdateSkin,this.UpdateShow) + end this.UpdateShow = this:OnShow(0,parent,curHeroData) @@ -187,6 +187,7 @@ function RoleSkinPanel:TimeToFormat(time) local day = math.floor(time / (24 * 3600)) local minute = math.floor(time / 60) % 60 local sec = time % 60 + LogGreen("sec:"..sec) local hour = math.floor(math.floor(time - day * 24 * 3600 - sec - minute * 60) / 3600) if day > 0 then return string.format("%d天",day) @@ -195,7 +196,7 @@ function RoleSkinPanel:TimeToFormat(time) elseif minute > 0 then return string.format("%0d分",minute) else - return string.format("分",1) + return string.format("%0d分",1) end end