Codechange: [Script] rework how compat-scripts work and are loaded (#13504)
- compat_NNN.nut files now only defines what is needed to downgrade from API NNN + 1 to NNN. - Automatically load all required compatibility files based on the API version of the script, starting with the latest.
This commit is contained in:
@@ -261,11 +261,11 @@ protected:
|
||||
|
||||
/**
|
||||
* Load squirrel scripts to emulate an older API.
|
||||
* @param api_version: API version to load scripts for
|
||||
* @param dir Subdirectory to find the scripts in
|
||||
* @return true iff script loading should proceed
|
||||
* @param dir Subdirectory to find the scripts in.
|
||||
* @param api_versions List of available versions of the script type.
|
||||
* @return true iff script loading should proceed.
|
||||
*/
|
||||
bool LoadCompatibilityScripts(const std::string &api_version, Subdirectory dir);
|
||||
bool LoadCompatibilityScripts(Subdirectory dir, std::span<const std::string_view> api_versions);
|
||||
|
||||
/**
|
||||
* Tell the script it died.
|
||||
@@ -302,6 +302,14 @@ private:
|
||||
*/
|
||||
bool CallLoad();
|
||||
|
||||
/**
|
||||
* Load squirrel script for a specific version to emulate an older API.
|
||||
* @param api_version: API version to load scripts for.
|
||||
* @param dir Subdirectory to find the scripts in.
|
||||
* @return true iff script loading should proceed.
|
||||
*/
|
||||
bool LoadCompatibilityScript(std::string_view api_version, Subdirectory dir);
|
||||
|
||||
/**
|
||||
* Save one object (int / string / array / table) to the savegame.
|
||||
* @param vm The virtual machine to get all the data from.
|
||||
|
||||
Reference in New Issue
Block a user