From 8dbaaf21d5cdcdaa7dd73655106b4dced012ec71 Mon Sep 17 00:00:00 2001 From: Sokomine Date: Wed, 7 Feb 2024 18:34:33 +0100 Subject: [PATCH] moved etitor parts into edtior/ folder --- {api => editor/api}/api_alternate_text.lua | 0 {api => editor/api}/fs_edit_general.lua | 0 editor/edit_mode.lua | 145 +++++++++++++++++- .../edit_mode_apply_changes.lua | 0 {fs => editor/fs}/fs_add_quest_steps.lua | 0 {fs => editor/fs}/fs_assign_quest_step.lua | 0 {fs => editor/fs}/fs_edit_actions.lua | 0 {fs => editor/fs}/fs_edit_effects.lua | 0 {fs => editor/fs}/fs_edit_options_dialog.lua | 0 {fs => editor/fs}/fs_edit_preconditions.lua | 0 {fs => editor/fs}/fs_export.lua | 0 {fs => editor/fs}/fs_fashion.lua | 0 {fs => editor/fs}/fs_fashion_extended.lua | 0 .../fs}/fs_get_list_of_usage_of_variable.lua | 0 {fs => editor/fs}/fs_manage_quest_steps.lua | 0 {fs => editor/fs}/fs_manage_quests.lua | 0 {fs => editor/fs}/fs_manage_variables.lua | 0 {fs => editor/fs}/fs_notes.lua | 0 {fs => editor/fs}/fs_properties.lua | 0 {fs => editor/fs}/fs_quest_gui.lua | 0 .../fs}/fs_save_or_discard_or_back.lua | 0 {fs => editor/fs}/fs_show_all_var_values.lua | 0 .../fs_show_what_points_to_this_dialog.lua | 0 .../print_as_table.lua | 0 init.lua | 83 +++++----- 25 files changed, 190 insertions(+), 38 deletions(-) rename {api => editor/api}/api_alternate_text.lua (100%) rename {api => editor/api}/fs_edit_general.lua (100%) rename edit_mode_apply_changes.lua => editor/edit_mode_apply_changes.lua (100%) rename {fs => editor/fs}/fs_add_quest_steps.lua (100%) rename {fs => editor/fs}/fs_assign_quest_step.lua (100%) rename {fs => editor/fs}/fs_edit_actions.lua (100%) rename {fs => editor/fs}/fs_edit_effects.lua (100%) rename {fs => editor/fs}/fs_edit_options_dialog.lua (100%) rename {fs => editor/fs}/fs_edit_preconditions.lua (100%) rename {fs => editor/fs}/fs_export.lua (100%) rename {fs => editor/fs}/fs_fashion.lua (100%) rename {fs => editor/fs}/fs_fashion_extended.lua (100%) rename {fs => editor/fs}/fs_get_list_of_usage_of_variable.lua (100%) rename {fs => editor/fs}/fs_manage_quest_steps.lua (100%) rename {fs => editor/fs}/fs_manage_quests.lua (100%) rename {fs => editor/fs}/fs_manage_variables.lua (100%) rename {fs => editor/fs}/fs_notes.lua (100%) rename {fs => editor/fs}/fs_properties.lua (100%) rename {fs => editor/fs}/fs_quest_gui.lua (100%) rename {fs => editor/fs}/fs_save_or_discard_or_back.lua (100%) rename {fs => editor/fs}/fs_show_all_var_values.lua (100%) rename {fs => editor/fs}/fs_show_what_points_to_this_dialog.lua (100%) rename print_as_table.lua => editor/print_as_table.lua (100%) diff --git a/api/api_alternate_text.lua b/editor/api/api_alternate_text.lua similarity index 100% rename from api/api_alternate_text.lua rename to editor/api/api_alternate_text.lua diff --git a/api/fs_edit_general.lua b/editor/api/fs_edit_general.lua similarity index 100% rename from api/fs_edit_general.lua rename to editor/api/fs_edit_general.lua diff --git a/editor/edit_mode.lua b/editor/edit_mode.lua index 941c5d8..afe8561 100644 --- a/editor/edit_mode.lua +++ b/editor/edit_mode.lua @@ -6,5 +6,146 @@ yl_speak_up.in_edit_mode = function(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") + +local modpath = minetest.get_modpath("yl_speak_up")..DIR_DELIM.."editor"..DIR_DELIM + + -- overrides of functions fo fs/fs_talkdialog.lua when in edit_mode (or for entering/leaving it) + dofile(modpath .. "fs/fs_talkdialog_edit_mode.lua") + + -- edit preconditions (can be reached through edit options dialog) + dofile(modpath .. "fs/fs_edit_preconditions.lua") + -- edit actions (can be reached through edit options dialog) + dofile(modpath .. "fs/fs_edit_actions.lua") + -- edit effects (can be reached through edit options dialog) + dofile(modpath .. "fs/fs_edit_effects.lua") + -- edit options dialog (detailed configuration of options in edit mode) + dofile(modpath .. "fs/fs_edit_options_dialog.lua") + + -- the player wants to change something regarding the dialog + dofile(modpath .. "edit_mode_apply_changes.lua") + + + +-- -- logging and showing the log +-- dofile(modpath .. "api/api_logging.lua") +-- dofile(modpath .. "fs/fs_show_log.lua") +-- -- players *and* npc need privs for certain things; this here handles the NPC side of things +-- dofile(modpath .. "npc_privs.lua") +-- -- add generic dialogs +-- dofile(modpath .. "add_generic_dialogs.lua") +-- -- handle on_player_receive_fields and showing of formspecs +-- dofile(modpath .. "show_fs.lua") +-- -- general decoration part for main formspec, trade window etc. +-- dofile(modpath .. "api/api_decorated.lua") +-- -- the formspec and input handling for the main dialog +-- dofile(modpath .. "api/api_talk.lua") +-- dofile(modpath .. "fs/fs_talkdialog.lua") + -- ask if the player wants to save, discard or go back in edit mode + dofile(modpath .. "fs/fs_save_or_discard_or_back.lua") + -- the player wants to change something regarding the dialog + dofile(modpath .. "edit_mode_apply_changes.lua") +-- +-- -- As the name says: a collection of custom functions that you can +-- -- override on your server or in your game to suit your needs; +-- -- Note: No special privs are needed to call custom functions. But... +-- -- of course you can change them only if you have access to +-- -- the server's file system or can execute lua code. +-- -- Note: Please do not edit this file. Instead, create and edit the +-- -- file "local_server_do_on_reload.lua"! +-- dofile(modpath .. "api/custom_functions_you_can_override.lua") +-- + -- assign a quest step to a dialog option/answer + dofile(modpath .. "fs/fs_assign_quest_step.lua") +-- +-- -- execute preconditions, actions and effects +-- dofile(modpath .. "exec_eval_preconditions.lua") +-- dofile(modpath .. "exec_actions.lua") +-- dofile(modpath .. "exec_apply_effects.lua") + -- some helper functions for formatting text for a formspec talbe + dofile(modpath .. "print_as_table.lua") +-- -- create i.e. a dropdown list of player names +-- dofile(modpath .. "api/formspec_helpers.lua") + -- handle alternate text for dialogs + dofile(modpath .. "api/api_alternate_text.lua") + -- helpful for debugging the content of the created dialog structure + dofile(modpath .. "fs/fs_show_what_points_to_this_dialog.lua") +-- -- debugging - extended information about what (your own) NPC does +-- dofile(modpath .. "npc_talk_debug.lua") +-- -- execute lua code directly (preconditions and effects) - requires priv +-- dofile(modpath .. "eval_and_execute_function.lua") + -- common functions for editing preconditions and effects + dofile(modpath .. "api/fs_edit_general.lua") + -- edit preconditions (can be reached through edit options dialog) + dofile(modpath .. "fs/fs_edit_preconditions.lua") + -- edit actions (can be reached through edit options dialog) + dofile(modpath .. "fs/fs_edit_actions.lua") + -- edit effects (can be reached through edit options dialog) + dofile(modpath .. "fs/fs_edit_effects.lua") + -- edit options dialog (detailed configuration of options in edit mode) + dofile(modpath .. "fs/fs_edit_options_dialog.lua") +-- -- set name, description and owner (owner only with npc_talk_master priv) +-- dofile(modpath .. "fs/fs_initial_config.lua") +-- -- inspect and accept items the player gave to the NPC +-- dofile(modpath .. "fs/fs_player_offers_item.lua") +-- -- inventory management, trading and handling of quest items: +-- dofile(modpath .. "api/api_inventory.lua") +-- dofile(modpath .. "fs/fs_inventory.lua") +-- -- limit how much the NPC shall buy and sell +-- dofile(modpath .. "api/api_trade.lua") +-- dofile(modpath .. "fs/fs_trade_limit.lua") +-- dofile(modpath .. "fs/fs_edit_trade_limit.lua") +-- -- trade one item(stack) against one other item(stack) +-- dofile(modpath .. "api/api_trade_inv.lua") +-- dofile(modpath .. "fs/fs_do_trade_simple.lua") +-- dofile(modpath .. "fs/fs_add_trade_simple.lua") +-- -- just click on a button to buy items from the trade list +-- dofile(modpath .. "fs/fs_trade_via_buy_button.lua") +-- -- easily accessible list of all trades the NPC offers +-- dofile(modpath .. "fs/fs_trade_list.lua") + -- as the name says: list which npc acesses a variable how and in which context + dofile(modpath .. "fs/fs_get_list_of_usage_of_variable.lua") + -- show which values are stored for which player in a quest variable + dofile(modpath .. "fs/fs_show_all_var_values.lua") + -- manage quest variables: add, delete, manage access rights etc. + dofile(modpath .. "fs/fs_manage_variables.lua") +-- -- handle variables for quests for player-owned NPC +-- dofile(modpath .. "quest_api.lua") + -- GUI for adding/editing quests + dofile(modpath .. "fs/fs_manage_quests.lua") +-- -- GUI for adding/editing quest steps for the quests +-- dofile(modpath .. "api/api_quest_steps.lua") + dofile(modpath .. "fs/fs_manage_quest_steps.lua") + -- used by the above + dofile(modpath .. "fs/fs_add_quest_steps.lua") +-- -- setting skin, wielded item etc. +-- dofile(modpath .. "old_staff_tool_compatibility.lua") +-- dofile(modpath .. "api/api_fashion.lua") + dofile(modpath .. "fs/fs_fashion.lua") + dofile(modpath .. "fs/fs_fashion_extended.lua") +-- -- properties for NPC without specific dialogs that want to make use of +-- -- some generic dialogs +-- dofile(modpath .. "api/api_properties.lua") + dofile(modpath .. "fs/fs_properties.lua") +-- -- the main functionality of the mod +-- dofile(modpath .. "functions.lua") +-- -- implementation of the chat commands registered in register_once.lua: +-- dofile(modpath .. "chat_commands.lua") + -- creating and maintaining quests + dofile(modpath .. "fs/fs_quest_gui.lua") + -- export dialog for cut&paste in .json format + dofile(modpath .. "fs/fs_export.lua") + -- take notes regarding what the NPC is for + dofile(modpath .. "fs/fs_notes.lua") +-- +-- -- show a list of all NPC the player can edit +-- dofile(modpath .. "api/api_npc_list.lua") +-- dofile(modpath .. "fs/fs_npc_list.lua") +-- +-- -- some general functions that are useful for mobs_redo +-- -- (react to right-click, nametag color etc.) +-- -- only gets loaded if mobs_redo (mobs) exists as mod +-- dofile(modpath .. "interface_mobs_api.lua") +-- +-- -- functions and overrides for edit mode +-- dofile(modpath .. "edit_mode.lua") +-- diff --git a/edit_mode_apply_changes.lua b/editor/edit_mode_apply_changes.lua similarity index 100% rename from edit_mode_apply_changes.lua rename to editor/edit_mode_apply_changes.lua diff --git a/fs/fs_add_quest_steps.lua b/editor/fs/fs_add_quest_steps.lua similarity index 100% rename from fs/fs_add_quest_steps.lua rename to editor/fs/fs_add_quest_steps.lua diff --git a/fs/fs_assign_quest_step.lua b/editor/fs/fs_assign_quest_step.lua similarity index 100% rename from fs/fs_assign_quest_step.lua rename to editor/fs/fs_assign_quest_step.lua diff --git a/fs/fs_edit_actions.lua b/editor/fs/fs_edit_actions.lua similarity index 100% rename from fs/fs_edit_actions.lua rename to editor/fs/fs_edit_actions.lua diff --git a/fs/fs_edit_effects.lua b/editor/fs/fs_edit_effects.lua similarity index 100% rename from fs/fs_edit_effects.lua rename to editor/fs/fs_edit_effects.lua diff --git a/fs/fs_edit_options_dialog.lua b/editor/fs/fs_edit_options_dialog.lua similarity index 100% rename from fs/fs_edit_options_dialog.lua rename to editor/fs/fs_edit_options_dialog.lua diff --git a/fs/fs_edit_preconditions.lua b/editor/fs/fs_edit_preconditions.lua similarity index 100% rename from fs/fs_edit_preconditions.lua rename to editor/fs/fs_edit_preconditions.lua diff --git a/fs/fs_export.lua b/editor/fs/fs_export.lua similarity index 100% rename from fs/fs_export.lua rename to editor/fs/fs_export.lua diff --git a/fs/fs_fashion.lua b/editor/fs/fs_fashion.lua similarity index 100% rename from fs/fs_fashion.lua rename to editor/fs/fs_fashion.lua diff --git a/fs/fs_fashion_extended.lua b/editor/fs/fs_fashion_extended.lua similarity index 100% rename from fs/fs_fashion_extended.lua rename to editor/fs/fs_fashion_extended.lua diff --git a/fs/fs_get_list_of_usage_of_variable.lua b/editor/fs/fs_get_list_of_usage_of_variable.lua similarity index 100% rename from fs/fs_get_list_of_usage_of_variable.lua rename to editor/fs/fs_get_list_of_usage_of_variable.lua diff --git a/fs/fs_manage_quest_steps.lua b/editor/fs/fs_manage_quest_steps.lua similarity index 100% rename from fs/fs_manage_quest_steps.lua rename to editor/fs/fs_manage_quest_steps.lua diff --git a/fs/fs_manage_quests.lua b/editor/fs/fs_manage_quests.lua similarity index 100% rename from fs/fs_manage_quests.lua rename to editor/fs/fs_manage_quests.lua diff --git a/fs/fs_manage_variables.lua b/editor/fs/fs_manage_variables.lua similarity index 100% rename from fs/fs_manage_variables.lua rename to editor/fs/fs_manage_variables.lua diff --git a/fs/fs_notes.lua b/editor/fs/fs_notes.lua similarity index 100% rename from fs/fs_notes.lua rename to editor/fs/fs_notes.lua diff --git a/fs/fs_properties.lua b/editor/fs/fs_properties.lua similarity index 100% rename from fs/fs_properties.lua rename to editor/fs/fs_properties.lua diff --git a/fs/fs_quest_gui.lua b/editor/fs/fs_quest_gui.lua similarity index 100% rename from fs/fs_quest_gui.lua rename to editor/fs/fs_quest_gui.lua diff --git a/fs/fs_save_or_discard_or_back.lua b/editor/fs/fs_save_or_discard_or_back.lua similarity index 100% rename from fs/fs_save_or_discard_or_back.lua rename to editor/fs/fs_save_or_discard_or_back.lua diff --git a/fs/fs_show_all_var_values.lua b/editor/fs/fs_show_all_var_values.lua similarity index 100% rename from fs/fs_show_all_var_values.lua rename to editor/fs/fs_show_all_var_values.lua diff --git a/fs/fs_show_what_points_to_this_dialog.lua b/editor/fs/fs_show_what_points_to_this_dialog.lua similarity index 100% rename from fs/fs_show_what_points_to_this_dialog.lua rename to editor/fs/fs_show_what_points_to_this_dialog.lua diff --git a/print_as_table.lua b/editor/print_as_table.lua similarity index 100% rename from print_as_table.lua rename to editor/print_as_table.lua diff --git a/init.lua b/init.lua index 7767a54..266e818 100644 --- a/init.lua +++ b/init.lua @@ -157,10 +157,10 @@ yl_speak_up.reload = function(modpath, log_entry) -- the formspec and input handling for the main dialog dofile(modpath .. "api/api_talk.lua") dofile(modpath .. "fs/fs_talkdialog.lua") - -- ask if the player wants to save, discard or go back in edit mode - dofile(modpath .. "fs/fs_save_or_discard_or_back.lua") +-- -- ask if the player wants to save, discard or go back in edit mode +-- TODO dofile(modpath .. "fs/fs_save_or_discard_or_back.lua") -- the player wants to change something regarding the dialog - dofile(modpath .. "edit_mode_apply_changes.lua") +-- TODO dofile(modpath .. "edit_mode_apply_changes.lua") -- As the name says: a collection of custom functions that you can -- override on your server or in your game to suit your needs; @@ -171,35 +171,35 @@ yl_speak_up.reload = function(modpath, log_entry) -- file "local_server_do_on_reload.lua"! dofile(modpath .. "api/custom_functions_you_can_override.lua") - -- assign a quest step to a dialog option/answer - dofile(modpath .. "fs/fs_assign_quest_step.lua") +-- -- assign a quest step to a dialog option/answer +-- TODO dofile(modpath .. "fs/fs_assign_quest_step.lua") -- execute preconditions, actions and effects dofile(modpath .. "exec_eval_preconditions.lua") dofile(modpath .. "exec_actions.lua") dofile(modpath .. "exec_apply_effects.lua") -- some helper functions for formatting text for a formspec talbe - dofile(modpath .. "print_as_table.lua") +-- TODO dofile(modpath .. "print_as_table.lua") -- create i.e. a dropdown list of player names dofile(modpath .. "api/formspec_helpers.lua") - -- handle alternate text for dialogs - dofile(modpath .. "api/api_alternate_text.lua") - -- helpful for debugging the content of the created dialog structure - dofile(modpath .. "fs/fs_show_what_points_to_this_dialog.lua") +-- -- handle alternate text for dialogs +-- TODO dofile(modpath .. "api/api_alternate_text.lua") +-- -- helpful for debugging the content of the created dialog structure +-- TODO dofile(modpath .. "fs/fs_show_what_points_to_this_dialog.lua") -- debugging - extended information about what (your own) NPC does dofile(modpath .. "npc_talk_debug.lua") -- execute lua code directly (preconditions and effects) - requires priv dofile(modpath .. "eval_and_execute_function.lua") - -- common functions for editing preconditions and effects - dofile(modpath .. "api/fs_edit_general.lua") +-- -- common functions for editing preconditions and effects +-- TODO dofile(modpath .. "api/fs_edit_general.lua") -- edit preconditions (can be reached through edit options dialog) - dofile(modpath .. "fs/fs_edit_preconditions.lua") +-- TODO dofile(modpath .. "fs/fs_edit_preconditions.lua") -- edit actions (can be reached through edit options dialog) - dofile(modpath .. "fs/fs_edit_actions.lua") +-- TODO dofile(modpath .. "fs/fs_edit_actions.lua") -- edit effects (can be reached through edit options dialog) - dofile(modpath .. "fs/fs_edit_effects.lua") +-- TODO dofile(modpath .. "fs/fs_edit_effects.lua") -- edit options dialog (detailed configuration of options in edit mode) - dofile(modpath .. "fs/fs_edit_options_dialog.lua") +-- TODO dofile(modpath .. "fs/fs_edit_options_dialog.lua") -- set name, description and owner (owner only with npc_talk_master priv) dofile(modpath .. "fs/fs_initial_config.lua") -- inspect and accept items the player gave to the NPC @@ -219,40 +219,40 @@ yl_speak_up.reload = function(modpath, log_entry) dofile(modpath .. "fs/fs_trade_via_buy_button.lua") -- easily accessible list of all trades the NPC offers dofile(modpath .. "fs/fs_trade_list.lua") - -- as the name says: list which npc acesses a variable how and in which context - dofile(modpath .. "fs/fs_get_list_of_usage_of_variable.lua") - -- show which values are stored for which player in a quest variable - dofile(modpath .. "fs/fs_show_all_var_values.lua") - -- manage quest variables: add, delete, manage access rights etc. - dofile(modpath .. "fs/fs_manage_variables.lua") +-- -- as the name says: list which npc acesses a variable how and in which context +-- TODO dofile(modpath .. "fs/fs_get_list_of_usage_of_variable.lua") +-- -- show which values are stored for which player in a quest variable +-- TODO dofile(modpath .. "fs/fs_show_all_var_values.lua") +-- -- manage quest variables: add, delete, manage access rights etc. +-- TODO dofile(modpath .. "fs/fs_manage_variables.lua") -- handle variables for quests for player-owned NPC dofile(modpath .. "quest_api.lua") - -- GUI for adding/editing quests - dofile(modpath .. "fs/fs_manage_quests.lua") +-- -- GUI for adding/editing quests +-- TODO dofile(modpath .. "fs/fs_manage_quests.lua") -- GUI for adding/editing quest steps for the quests dofile(modpath .. "api/api_quest_steps.lua") - dofile(modpath .. "fs/fs_manage_quest_steps.lua") - -- used by the above - dofile(modpath .. "fs/fs_add_quest_steps.lua") +-- TODO dofile(modpath .. "fs/fs_manage_quest_steps.lua") +-- -- used by the above +-- TODO dofile(modpath .. "fs/fs_add_quest_steps.lua") -- setting skin, wielded item etc. dofile(modpath .. "old_staff_tool_compatibility.lua") dofile(modpath .. "api/api_fashion.lua") - dofile(modpath .. "fs/fs_fashion.lua") - dofile(modpath .. "fs/fs_fashion_extended.lua") +-- TODO dofile(modpath .. "fs/fs_fashion.lua") +-- TODO dofile(modpath .. "fs/fs_fashion_extended.lua") -- properties for NPC without specific dialogs that want to make use of -- some generic dialogs dofile(modpath .. "api/api_properties.lua") - dofile(modpath .. "fs/fs_properties.lua") +-- TODO dofile(modpath .. "fs/fs_properties.lua") -- the main functionality of the mod dofile(modpath .. "functions.lua") -- implementation of the chat commands registered in register_once.lua: dofile(modpath .. "chat_commands.lua") - -- creating and maintaining quests - dofile(modpath .. "fs/fs_quest_gui.lua") - -- export dialog for cut&paste in .json format - dofile(modpath .. "fs/fs_export.lua") - -- take notes regarding what the NPC is for - dofile(modpath .. "fs/fs_notes.lua") +-- -- creating and maintaining quests +-- TODO dofile(modpath .. "fs/fs_quest_gui.lua") +-- -- export dialog for cut&paste in .json format +-- TODO dofile(modpath .. "fs/fs_export.lua") +-- -- take notes regarding what the NPC is for +-- TODO dofile(modpath .. "fs/fs_notes.lua") -- show a list of all NPC the player can edit dofile(modpath .. "api/api_npc_list.lua") @@ -263,7 +263,18 @@ 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