moved edit_mode.lua to editor/fs/* and added new edit_mode.lua as future init.lua file for editor mod

This commit is contained in:
Sokomine 2024-02-07 06:19:20 +01:00
parent b6f5cd9029
commit aa707c40ac
3 changed files with 11 additions and 9 deletions

10
editor/edit_mode.lua Normal file
View File

@ -0,0 +1,10 @@
-- is the player in edit mode?
yl_speak_up.in_edit_mode = function(pname)
return pname
and yl_speak_up.edit_mode[pname]
and (yl_speak_up.edit_mode[pname] == yl_speak_up.speak_to[pname].n_id)
end
-- overrides of functions fo fs/fs_talkdialog.lua when in edit_mode (or for entering/leaving it)
dofile(minetest.get_modpath("yl_speak_up")..DIR_DELIM.."editor/fs/fs_talkdialog_edit_mode.lua")

View File

@ -1,12 +1,4 @@
-- is the player in edit mode?
yl_speak_up.in_edit_mode = function(pname)
return pname
and yl_speak_up.edit_mode[pname]
and (yl_speak_up.edit_mode[pname] == yl_speak_up.speak_to[pname].n_id)
end
-- This is the main talkdialog the NPC shows when right-clicked. (now in edit_mode)
local old_input_talk = yl_speak_up.input_talk
yl_speak_up.input_talk = function(player, formname, fields)

View File

@ -264,7 +264,7 @@ yl_speak_up.reload = function(modpath, log_entry)
dofile(modpath .. "interface_mobs_api.lua")
-- functions and overrides for edit mode
dofile(modpath .. "edit_mode.lua")
dofile(modpath .. "editor/edit_mode.lua")
-- initialize and load all registered generic dialogs
yl_speak_up.load_generic_dialogs()