yl_speak_up/fs
2024-02-09 06:20:18 +01:00
..
fs_add_trade_simple.lua log add_trade_simple in npc_was_changed as an exception without having to resort to edit_mode directly 2024-02-09 06:20:18 +01:00
fs_do_trade_simple.lua adjusted fs_do_trade_simple so that it works with edit_mode beeing only in editor/ 2024-02-07 23:36:12 +01:00
fs_edit_trade_limit.lua split fs_trade_via_buy_button.lua in fs/ and api/ 2023-12-10 05:13:11 +01:00
fs_initial_config.lua fixed exit button not working in initial config 2024-02-05 23:28:02 +01:00
fs_inventory.lua added missing fs_inventory.lua file 2024-01-20 22:01:21 +01:00
fs_npc_list.lua split fs_npc_list.lua into api/ and fs/ 2023-12-12 03:01:58 +01:00
fs_player_offers_item.lua added back item to error message when npc refuses an item 2024-02-02 18:25:29 +01:00
fs_show_log.lua moved some files into fs/ and api/ folders to clean up 2023-12-08 22:41:27 +01:00
fs_talkdialog.lua added some missing local variables in fs/fs_talkdialog.lua 2024-02-07 22:18:15 +01:00
fs_trade_limit.lua split fs_trade_limit.lua into fs/ and api/ part 2023-12-10 04:56:51 +01:00
fs_trade_list.lua moved some files into fs/ and api/ folders to clean up 2023-12-08 22:41:27 +01:00
fs_trade_via_buy_button.lua adjusted fs_do_trade_simple so that it works with edit_mode beeing only in editor/ 2024-02-07 23:36:12 +01:00
README.md moved formspec_helpers.lua into api folder 2023-12-18 05:58:39 +01:00

In general, files in here ought to provide exactly tow functions:

    yl_speak_up.input_fs_<FILE_NAME> = function(player, formname, fields)
        -- react to whatever input the player supplied;
        -- usually show another formspec
        return
    end

and:

    yl_speak_up.get_fs_<FILE_NAME> = function(player, param)
        -- return a formspec string
        return formspec_string
    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.

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. These functions are called in debug mode when excecuting the preconditions, actions and effects as well.

Another exception is exec_actions.lua as the respective get_fs_* and input_* functions there are only called when an action is executed and not via show_fs.lua at all.