yl_speak_up/fs
2024-02-12 02:10:46 +01:00
..
fs_action_evaluate.lua moved formspecs out of exec_actions.lua and into fs/fs_action_*.lua 2024-02-10 00:23:35 +01:00
fs_action_npc_gives.lua moved formspecs out of exec_actions.lua and into fs/fs_action_*.lua 2024-02-10 00:23:35 +01:00
fs_action_npc_wants.lua moved formspecs out of exec_actions.lua and into fs/fs_action_*.lua 2024-02-10 00:23:35 +01:00
fs_action_text_input.lua moved formspecs out of exec_actions.lua and into fs/fs_action_*.lua 2024-02-10 00:23:35 +01:00
fs_add_trade_simple.lua show_fs: add/do_trade_simple 2024-02-09 21:43:48 +01:00
fs_do_trade_simple.lua show_fs: add/do_trade_simple 2024-02-09 21:43:48 +01:00
fs_edit_trade_limit.lua show_fs: edit_trade_limit 2024-02-09 21:03:22 +01:00
fs_initial_config.lua made initial_config work better in edit_mode 2024-02-11 13:26:44 +01:00
fs_inventory.lua show_fs: inventory 2024-02-09 20:53:33 +01:00
fs_npc_list.lua show_fs: npc_list 2024-02-09 21:31:30 +01:00
fs_player_offers_item.lua show_fs: player_offers_item 2024-02-09 21:47:11 +01:00
fs_show_log.lua adding missing postfix for _wrapper in show_log 2024-02-10 00:33:48 +01:00
fs_talkdialog.lua allow to edit name, description and owner even without editor installed 2024-02-12 02:10:46 +01:00
fs_trade_limit.lua show_fs: trade_limit 2024-02-09 21:01:00 +01:00
fs_trade_list.lua show_fs: trade_list 2024-02-09 21:29:24 +01:00
fs_trade_via_buy_button.lua fixed typo in fs_trade_via_buy_button 2024-02-10 18:55:11 +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.