feat: integrate ts2lua-unreal v0.2.1 and UnLua TypeScript (.d.ts) generator

This commit is contained in:
szy73711 committed 2026-11-29 03:08:03 +08:00
1 parent ebce41f347
commit ee2e62bb34
282 files changed
+141794 -261

No files matched your search

+19 -15
View File
@@ -1,26 +1,30 @@
---@class Framework.Log
local Log = {}
local ____exports = {}
---
-- @noSelfInFile
local TAG = "[UnrealLuaDemo]"
local function FormatMessage(level, fmt, ...)
local ok, msg = pcall(string.format, tostring(fmt), ...)
if not ok then
msg = tostring(fmt)
local args = {...}
local fmtStr = tostring(fmt)
local msg
if #args > 0 then
local ok, formatted = pcall(
string.format,
fmtStr,
table.unpack(args)
)
msg = ok and formatted or fmtStr
else
msg = fmtStr
end
return string.format("%s[%s] %s", TAG, level, msg)
end
function Log.Info(fmt, ...)
function ____exports.Info(fmt, ...)
print(FormatMessage("INFO", fmt, ...))
end
function Log.Warn(fmt, ...)
function ____exports.Warn(fmt, ...)
print(FormatMessage("WARN", fmt, ...))
end
function Log.Error(fmt, ...)
function ____exports.Error(fmt, ...)
print(FormatMessage("ERROR", fmt, ...))
end
return Log
return ____exports