From 72e92d32338005cf8be306a690eab08bbdaec2e9 Mon Sep 17 00:00:00 2001 From: Nils Dagsson Moskopp Date: Sat, 21 May 2022 17:07:18 +0200 Subject: [PATCH] Activate main menu --- init.lua | 21 +++++++++++++++++++++ mod.conf | 2 ++ 2 files changed, 23 insertions(+) create mode 100644 init.lua create mode 100644 mod.conf diff --git a/init.lua b/init.lua new file mode 100644 index 0000000..4ad2b01 --- /dev/null +++ b/init.lua @@ -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 diff --git a/mod.conf b/mod.conf new file mode 100644 index 0000000..ed07ad9 --- /dev/null +++ b/mod.conf @@ -0,0 +1,2 @@ +name = mainmenu_csm +description = Adds a client-side mod (CSM) tab to the main menu