调整场景/控件模块

This commit is contained in:
MrZ626
2021-01-19 23:13:52 +08:00
parent 44cfddf601
commit 674a48133a
2 changed files with 7 additions and 4 deletions

View File

@@ -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()

View File

@@ -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