From c368538c28d4f441938d4ec5c374fa1218b50bdf Mon Sep 17 00:00:00 2001 From: Sokomine Date: Mon, 11 Dec 2023 19:24:19 +0100 Subject: [PATCH] moved fs_edit_*.lua to fs/ --- fs/README.md | 20 +++++++++++++------ fs_edit_actions.lua => fs/fs_edit_actions.lua | 0 fs_edit_effects.lua => fs/fs_edit_effects.lua | 0 .../fs_edit_preconditions.lua | 0 init.lua | 6 +++--- 5 files changed, 17 insertions(+), 9 deletions(-) rename fs_edit_actions.lua => fs/fs_edit_actions.lua (100%) rename fs_edit_effects.lua => fs/fs_edit_effects.lua (100%) rename fs_edit_preconditions.lua => fs/fs_edit_preconditions.lua (100%) diff --git a/fs/README.md b/fs/README.md index 165b3e0..3d77b23 100644 --- a/fs/README.md +++ b/fs/README.md @@ -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_.lua` files. diff --git a/fs_edit_actions.lua b/fs/fs_edit_actions.lua similarity index 100% rename from fs_edit_actions.lua rename to fs/fs_edit_actions.lua diff --git a/fs_edit_effects.lua b/fs/fs_edit_effects.lua similarity index 100% rename from fs_edit_effects.lua rename to fs/fs_edit_effects.lua diff --git a/fs_edit_preconditions.lua b/fs/fs_edit_preconditions.lua similarity index 100% rename from fs_edit_preconditions.lua rename to fs/fs_edit_preconditions.lua diff --git a/init.lua b/init.lua index 612b45a..4a6e291 100644 --- a/init.lua +++ b/init.lua @@ -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)