Activate main menu

This commit is contained in:
Nils Dagsson Moskopp 2022-05-21 17:07:18 +02:00
parent 479c595da3
commit 72e92d3233
Signed by: erlehmann
GPG Key ID: A3BC671C35191080
2 changed files with 23 additions and 0 deletions

21
init.lua Normal file
View File

@ -0,0 +1,21 @@
if not minetest.is_singleplayer() then
error("Main menu changes work only in singleplayer mode.")
end
local current_main_menu_path = minetest.settings:get("main_menu_path")
local main_menu_path = minetest.get_modpath("mainmenu_csm") .. '/builtin/mainmenu'
if current_main_menu_path ~= main_menu_path then
minetest.register_on_joinplayer(
function()
minetest.settings:set("main_menu_path", main_menu_path)
minetest.kick_player(
"singleplayer",
[[
CSM tab added to main menu.
Reconnect to play the game.
]]
)
end
)
end

2
mod.conf Normal file
View File

@ -0,0 +1,2 @@
name = mainmenu_csm
description = Adds a client-side mod (CSM) tab to the main menu