Vendetta/API/require
From Quasar-RCE
Definition
lib.require (requirements, callback) :: nil
Description
Delays a function from executing until the requirements are met.
Arguments
- table requirements: A list of {mod_IDs, mod_versions} that must be met; these must be loaded and activated, not just present.
- function callback: The function to be executed if/when all requirements are fulfilled.
Returns
- nil
Other notes
- Added in LME 2.x (Neoloader indev)
- This function provides a method to introduce "soft dependencies" - extended functionality for mods that your plugin can utilize but aren't neccesary for its load state.
- The function lib.check_queue is called every time a mod is activated; it is this function that tests if the dependency table provided has been met or not, utilizing lib.resolve_dep_table
- If you need to make a range of versions valid, add a key ver_max="version" to the table. the previous version="version" will become a minimum requirement.