From 674a48133ad7efdafa34edeeabf57b547fa9b04f Mon Sep 17 00:00:00 2001 From: MrZ626 <1046101471@qq.com> Date: Tue, 19 Jan 2021 23:13:52 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4=E5=9C=BA=E6=99=AF/=E6=8E=A7?= =?UTF-8?q?=E4=BB=B6=E6=A8=A1=E5=9D=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Zframework/scene.lua | 5 +++-- Zframework/widget.lua | 6 ++++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/Zframework/scene.lua b/Zframework/scene.lua index 6216ab68..5f46e08d 100644 --- a/Zframework/scene.lua +++ b/Zframework/scene.lua @@ -39,8 +39,9 @@ local SCN={ function SCN.add(name,scene) scenes[name]=scene - if not scene.widgetList then scene.widgetList={}end - setmetatable(scene.widgetList,WIDGET.indexMeta) + if scene.widgetList then + setmetatable(scene.widgetList,WIDGET.indexMeta) + end end function SCN.swapUpdate() diff --git a/Zframework/widget.lua b/Zframework/widget.lua index 1de6d89d..36d02785 100644 --- a/Zframework/widget.lua +++ b/Zframework/widget.lua @@ -837,8 +837,10 @@ function WIDGET.set(list) end function WIDGET.setLang(widgetText) for S,L in next,SCN.scenes do - for _,W in next,L.widgetList do - W.text=W.fText or widgetText[S][W.name] + if L.widgetList then + for _,W in next,L.widgetList do + W.text=W.fText or widgetText[S][W.name] + end end end end