语言文件真正缺失文本时不会蓝屏了

This commit is contained in:
MrZ626
2021-10-26 20:54:41 +08:00
parent 00999426b9
commit 7847e72f63

View File

@@ -343,6 +343,13 @@ LANG.init('zh',
local tipMeta={__call=function(L)return L[math.random(#L)]end}
return function(L)
if type(rawget(L,'getTip'))=='table'then setmetatable(L.getTip,tipMeta)end
setmetatable(L,{__index=function(self,k)
local mes="No Text ("..SETTING.locale.."): "..k
LOG(mes)
MES.new('warn',mes)
self[k]=CHAR.zChan.thinking
return self[k]
end})
end
end)()
)
@@ -568,4 +575,4 @@ table.sort(REPLAY,function(a,b)return a.fileName>b.fileName end)
table.insert(_LOADTIMELIST_,("Initialize Data: %.3fs"):format(TIME()-_LOADTIME_))
for i=1,#_LOADTIMELIST_ do LOG(_LOADTIMELIST_[i])end
for i=1,#_LOADTIMELIST_ do LOG(_LOADTIMELIST_[i])end