From dc278123d6dcb84ce6fce2997abe96101f2bfcc7 Mon Sep 17 00:00:00 2001 From: Sokomine Date: Sun, 5 Nov 2023 18:10:49 +0100 Subject: [PATCH] added /npc_talk version command --- chat_commands.lua | 6 ++++++ init.lua | 3 +++ 2 files changed, 9 insertions(+) diff --git a/chat_commands.lua b/chat_commands.lua index 44baf05..4df8523 100644 --- a/chat_commands.lua +++ b/chat_commands.lua @@ -12,8 +12,13 @@ yl_speak_up.command_npc_talk = function(pname, param) if( cmd and cmd == "style") then -- implemented in fs_decorated.lua: return yl_speak_up.command_npc_talk_style(pname, rest) + -- show formspec with list of NPC controlled by the player elseif(cmd and cmd == "list") then return yl_speak_up.command_npc_talk_list(pname, rest) + -- show the version of the mod + elseif(cmd and cmd == "version") then + minetest.chat_send_player(pname, "Version of yl_speak_up: "..tostring(yl_speak_up.version)) + return -- debug mode only makes sense if the player can edit that NPC; the command checks for this elseif(cmd and cmd == "debug") then -- implemented in npc_talk_debug.lua: @@ -61,6 +66,7 @@ yl_speak_up.command_npc_talk = function(pname, param) "Usage: \"/npc_talk \" with beeing:\n".. " help this help here\n".. " style display talk menu in a way better suited for very old versions of MT\n".. + " version show human-readable version information\n".. " list shows a list of NPC that you can edit\n".. " debug debug a particular NPC\n".. " force_edit forces edit mode for any NPC you talk to\n".. diff --git a/init.lua b/init.lua index 04c064d..e293057 100644 --- a/init.lua +++ b/init.lua @@ -1,5 +1,8 @@ yl_speak_up = {} +-- human-readable version +yl_speak_up.version = "05.11.23 first publication" + -- some mods (i.e. yl_speak_up_addons) need to be called again when -- this mod is reloaded via chat command "/npc_talk_reload"; -- this is a list of such functions