整理代码,修复应用语言加载TEXTOBJ时有个特殊的文本对象会弹出警告

This commit is contained in:
MrZ626
2021-10-27 01:21:15 +08:00
parent 840be65198
commit 4ea2cb18c7
2 changed files with 5 additions and 7 deletions

View File

@@ -34,7 +34,7 @@ function applyLanguage()
text=LANG.get(SETTING.locale) text=LANG.get(SETTING.locale)
WIDGET.setLang(text.WidgetText) WIDGET.setLang(text.WidgetText)
for k,v in next,TEXTOBJ do for k,v in next,TEXTOBJ do
if text[k]then if rawget(text,k)then
v:set(text[k]) v:set(text[k])
end end
end end

View File

@@ -359,13 +359,11 @@ function scene.draw()
gc_setColor(1,1,1,.82) gc_setColor(1,1,1,.82)
gc_draw(TEXTOBJ.modeName,modeTextPos,10) gc_draw(TEXTOBJ.modeName,modeTextPos,10)
local M=GAME.curMode local M=GAME.curMode
if M then if M and M.score and M.records[1]then
if M.score and M.records[1]then
setFont(15) setFont(15)
gc_setColor(1,1,1,.6) gc_setColor(1,1,1,.6)
gc_print(M.scoreDisp(M.records[1]),modeTextPos,45) gc_print(M.scoreDisp(M.records[1]),modeTextPos,45)
end end
end
--Replaying --Replaying
if replaying or tas then if replaying or tas then