整理代码,修复应用语言加载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)
WIDGET.setLang(text.WidgetText)
for k,v in next,TEXTOBJ do
if text[k]then
if rawget(text,k)then
v:set(text[k])
end
end

View File

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