From 10e8cef102d6c384f6239883d0ab5ce62b24abe6 Mon Sep 17 00:00:00 2001 From: Sokomine Date: Sat, 10 Feb 2024 19:11:26 +0100 Subject: [PATCH] provide basic show_precondition/action/effect for debug mode when editor/ is not available --- init.lua | 12 ------------ npc_talk_debug.lua | 15 +++++++++++++++ 2 files changed, 15 insertions(+), 12 deletions(-) diff --git a/init.lua b/init.lua index 1d6893c..f70d884 100644 --- a/init.lua +++ b/init.lua @@ -270,18 +270,6 @@ yl_speak_up.reload = function(modpath, log_entry) -- only gets loaded if mobs_redo (mobs) exists as mod dofile(modpath .. "interface_mobs_api.lua") --- TODO: just temporal here; needed for debugging --- TODO: see dummy_functions.lua for this! TODO - -- functions and overrides for edit mode - yl_speak_up.show_precondition = function(p, pname) - return "Only implemented in editor mod." - end - yl_speak_up.show_action = function(a, pname) - return "Only implemented in editor mod." - end - yl_speak_up.show_effect = function(r, pname) - return "Only implemented in editor mod." - end dofile(modpath .. "editor/edit_mode.lua") -- initialize and load all registered generic dialogs diff --git a/npc_talk_debug.lua b/npc_talk_debug.lua index 62c3f9b..5db13ac 100644 --- a/npc_talk_debug.lua +++ b/npc_talk_debug.lua @@ -1,4 +1,19 @@ +-- full version found in fs_edit_preconditions.lua: +yl_speak_up.show_precondition = function(p, pname) + return "P: "..minetest.serialize(p or {}).."." +end + +-- full version found in fs_edit_actions.lua: +yl_speak_up.show_action = function(a) + return "A: "..minetest.serialize(a or {}).."." +end + +-- full version found in fs_edit_effects.lua: +yl_speak_up.show_effect = function(r, pname) + return "E: "..minetest.serialize(r or {}).."." +end + -- store which player is monitoring the NPC (for preconditions and -- effects)