forked from Asnxthaony/Roco-Kingdom-World-Script
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathLuaText.lua
More file actions
32 lines (29 loc) · 731 Bytes
/
Copy pathLuaText.lua
File metadata and controls
32 lines (29 loc) · 731 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
local LuaText = {}
function LuaText:Init()
end
function LuaText:GetErrorDesc(Code)
local Key = string.format("Error_Code_%d", Code)
local Desc = self[Key]
if RocoEnv.IS_EDITOR then
if string.IsNilOrEmpty(Desc) then
local ErrorCodeDesc = require("Data.PB.ErrorCodeDesc")
Desc = ErrorCodeDesc[Code]
end
if string.IsNilOrEmpty(Desc) then
Desc = "无错误码描述"
end
Desc = string.format("%s(%d)", Desc, Code)
end
return Desc
end
setmetatable(LuaText, {
__index = function(t, k)
local raw = _G.DataConfigManager:GetLocalizationConf(k, true)
if raw then
return raw.msg
else
return string.format("%s未配置", tostring(k))
end
end
})
return LuaText