Package Manager
Updated for version 4.0.
To understand how some functions work here read about AddFilesModule
BeardLibPackageManager class
Used to be called CustomPackageManager.
Access it using BeardLib.Managers.Package
Variables
Function | Description |
---|---|
custom_packages | A table containing custom packages. Each table has a key being the the Idstring key of the ID and table value containing |
unload_on_restart | A table containing packages to unload after a restart. Each value in it just containing the config of the package to unload |
EXT_CONVERT | A table with keys of file names that should be converted into their in-game counterparts. Example, dds is "texture" "bik" is "movie" etc |
UNIT_SHORTCUTS | The table that holds the unit shortcuts. Each key being the meta of the shortcut and the value containing a table with data of what should be loaded. Inside each table you have types of files that should be loaded. Writing just {} will load by default unit, object, and model. Writing any type like "type=true" will load that type. If you need to load multiple files of the same type you write "type={"_thq"}" with the values inside being suffixes to the path |
TEXTURE_SHORTCUTS | Like |
Functions
Get
Function | Return Type | Description |
---|---|---|
RegisterPackage(String id, String directory, Table config) | Boolean | Registers a package to be loaded using |
LoadPackage(String id) | Boolean | Loads a custom package. |
UnloadPackage(String id) | Boolean | Unloads a custom package |
PackageLoaded(String id) | Boolean | Returns a boolean determining if the package is loaded |
HasPackage(String id) | Boolean | Returns a boolean if the custom package was registered |
Other
Function | Description |
---|---|
LoadPackageConfig(String directory, Table config, Boolean temp) | The function that goes through |
AddFileWithCheck(Idstring ext, Idstring path, String file) | Adds a file but checks if the file exists first. Calls |
Err(...) | Calls BeardLib:Err |
UnloadPackageConfig(Table config) | Called by |
Unload() | Unloads packages that unload on restart. Called by a PostHook in |
Last updated