forked from your-land-mirror/yl_speak_up
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:
parent
b6f5cd9029
commit
aa707c40ac
10
editor/edit_mode.lua
Normal file
10
editor/edit_mode.lua
Normal 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")
|
@ -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)
|
2
init.lua
2
init.lua
@ -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()
|
||||
|
Loading…
Reference in New Issue
Block a user