moved fs_edit_*.lua to fs/

This commit is contained in:
Sokomine 2023-12-11 19:24:19 +01:00
parent d57ac190eb
commit c368538c28
5 changed files with 17 additions and 9 deletions

View File

@ -15,15 +15,23 @@ and:
end
```
The actual displaying of the formspecs and calling of these functions happens
in `show_fs.lua`.
There may be no function for handling input if the formspec only displays
something and only offers a back button or buttons to other formspecs.
Additional (local) helper functions may be included if they are only used
by those two functions above and not used elsewhere in the mod.
That is not a technical requirement but mostly for keeping things clean.
These functions are usually *not* declared as local and may be overridden
from outside if needed.
There may be no function for handling input if the formspec only displays
something and only offers a back button or buttons to other formspecs.
The actual displaying of the formspecs and calling of these functions happens
in `show_fs.lua`.
An exception to the above rule are the functions
```
yl_speak_up.show_precondition
yl_speak_up.show_action
yl_speak_up.show_effect
```
because in those cases it was better for readability and context to have them
in their respective `fs/fs_edit_<precondition|action|effect>.lua` files.

View File

@ -192,11 +192,11 @@ yl_speak_up.reload = function(modpath, log_entry)
-- common functions for editing preconditions and effects
dofile(modpath .. "fs_edit_general.lua")
-- edit preconditions (can be reached through edit options dialog)
dofile(modpath .. "fs_edit_preconditions.lua")
dofile(modpath .. "fs/fs_edit_preconditions.lua")
-- edit actions (can be reached through edit options dialog)
dofile(modpath .. "fs_edit_actions.lua")
dofile(modpath .. "fs/fs_edit_actions.lua")
-- edit effects (can be reached through edit options dialog)
dofile(modpath .. "fs_edit_effects.lua")
dofile(modpath .. "fs/fs_edit_effects.lua")
-- edit options dialog (detailed configuration of options in edit mode)
dofile(modpath .. "fs_edit_options_dialog.lua")
-- set name, description and owner (owner only with npc_talk_master priv)