forked from your-land-mirror/minetest-flow
Don't register /flow-example in multiplayer
This commit is contained in:
parent
f8af81b69a
commit
f4d40efe2e
@ -1,4 +1,4 @@
|
|||||||
-- Debugging
|
-- You can run /flow-example in singleplayer to open this form
|
||||||
local gui = flow.widgets
|
local gui = flow.widgets
|
||||||
|
|
||||||
local elements = {"box", "label", "image", "field", "checkbox", "list"}
|
local elements = {"box", "label", "image", "field", "checkbox", "list"}
|
||||||
|
13
init.lua
13
init.lua
@ -969,8 +969,9 @@ function gui_mt.__newindex()
|
|||||||
end
|
end
|
||||||
|
|
||||||
local modpath = minetest.get_modpath("flow")
|
local modpath = minetest.get_modpath("flow")
|
||||||
local example_form
|
if minetest.is_singleplayer() then
|
||||||
minetest.register_chatcommand("flow-example", {
|
local example_form
|
||||||
|
minetest.register_chatcommand("flow-example", {
|
||||||
privs = {server = true},
|
privs = {server = true},
|
||||||
help = "Shows an example formspec",
|
help = "Shows an example formspec",
|
||||||
func = function(name)
|
func = function(name)
|
||||||
@ -980,12 +981,14 @@ minetest.register_chatcommand("flow-example", {
|
|||||||
end
|
end
|
||||||
example_form:show(name)
|
example_form:show(name)
|
||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
|
end
|
||||||
|
|
||||||
if DEBUG_MODE then
|
if DEBUG_MODE then
|
||||||
local f, err = loadfile(modpath .. "/test-fs.lua")
|
local f, err = loadfile(modpath .. "/test-fs.lua")
|
||||||
if not f then
|
if f then
|
||||||
|
return f()
|
||||||
|
else
|
||||||
minetest.log("error", "[flow] " .. tostring(err))
|
minetest.log("error", "[flow] " .. tostring(err))
|
||||||
end
|
end
|
||||||
return f()
|
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user