Top Level Statements
Patch Manager supports other top level statements than just the selection block construct described in Rulesets, Selectors, and Selection Blocks. This page will list how to use all of them.
Importing Libraries
Libraries are described in Libraries.
To reiterate how to import them though, you use @use
followed by the library name as a string, or if it is a builtin library/a library from another mod, you prefix the library name with builtin:
or other-mod-id:
respectively.
For example:
Declare Variables
You can declare variables at the top level much like you can in selection blocks, with the $variableName: [value];
construct
Define Stages
Stages are explained in Stages, which is an advanced topic.
But for an example of a stage definition to put here:
Define Functions
Functions are explained in Functions and Closures, which is an advanced topic.
But for an example of a function to put here:
Define Mixins
Mixins are explained in Mixins, which is an advanced topic.
But for an example of a mixin to put here:
Conditionals
Conditionals are essentially the same as in selection blocks, but rather than selection actions going inside them, top level statements do.
Selection Block
This is described in the aforementioned Rulesets, Selectors, and Selection Blocks page, but there are a few other things that can be done with them that are described in Selection Block Attributes
But for reiterate here, this top level statement looks similar to the following:
Declare Labels to be Patched
Patch Manager by default only patches a subset of Addressables labels, that being every label it has a ruleset for, as of writing this documentation, that is parts_data
and resources
. If you wish to use the generic :json
ruleset for a value of a separate label, then you need to tell patch manager that you want to patch that label as well. You can do this by writing @patch
followed by a comma separated list of strings and a semicolon.
Declare Configs
You can declare configs as a top level statement, configs are described in Configs, which is an advanced tutorial.
For an example config declaration:
Update configs
You can also update configs as a top level statement.
For an example of this: