1
0
mirror of https://github.com/luanti-org/luanti.git synced 2025-10-12 08:05:18 +02:00

In-game settings menu using separate Lua environment (#15614)

This commit is contained in:
grorp
2025-01-19 13:07:04 -05:00
committed by GitHub
parent 3cb07d5fb6
commit eeb6cab4c4
48 changed files with 652 additions and 290 deletions

View File

@@ -54,7 +54,8 @@ function builtin_shared.make_registration()
local registerfunc = function(func)
t[#t + 1] = func
core.callback_origins[func] = {
mod = core.get_current_modname() or "??",
-- may be nil or return nil
mod = core.get_current_modname and core.get_current_modname() or "??",
name = debug.getinfo(1, "n").name or "??"
}
end
@@ -66,7 +67,8 @@ function builtin_shared.make_registration_reverse()
local registerfunc = function(func)
table.insert(t, 1, func)
core.callback_origins[func] = {
mod = core.get_current_modname() or "??",
-- may be nil or return nil
mod = core.get_current_modname and core.get_current_modname() or "??",
name = debug.getinfo(1, "n").name or "??"
}
end