-
-
Notifications
You must be signed in to change notification settings - Fork 11
API
Haoming edited this page Aug 27, 2024
·
2 revisions
For API usages, this Extension takes seven parameters:
enable: Boolean = true
mode: String = "Basic" | "Advanced" | "Mask"
separator: String = ""
direction: String = "Horizontal" | "Vertical" | null
background: String = "None" | "First Line" | "Last Line" | null
background_weight: Number = 0.1 ~ 1.5 | null
mapping: Array = Array[] | Object[] | null
To use the Extension with API, add the following example object to the
alwayson_scripts
entry of your payload, and adjust the parameters as needed
-
enable is always
true
(Otherwise why are you here) - mode is always required
-
separator is always required
- Can just pass in an empty string (
""
) to use the newline character
- Can just pass in an empty string (
- direction is always required
-
background is always required
-
background_weight is required if background is not set to
"None"
; otherwise can just benull
-
background_weight is required if background is not set to
-
mapping can just be
null
example payload
"forge couple": {
"args": [
true,
"Basic",
"",
"Horizontal",
"None",
null,
null
]
}
-
direction can just be
null
-
background can just be
null
-
background_weight can just be
null
-
mapping is an array of array
- Each array corresponds to a region, with five values: x1, x2, y1, y2, and weight.
- Refer to
README
for the rules of the values
example payload
"forge couple": {
"args": [
true,
"Advanced",
"",
null,
null,
null,
[
[
"0.0",
"0.5",
"0.0",
"1.0",
"1.0"
],
[
"0.5",
"1.0",
"0.0",
"1.0",
"1.0"
]
]
]
}
-
direction can just be
null
-
background is always required
-
background_weight is required if background is not set to
"None"
; otherwise can just benull
-
background_weight is required if background is not set to
-
mapping is an array of dictionary
- Each dictionary corresponds to a region, with two key-value pairs: mask and weight
- The mask is a grayscale image where white color is active, encoded in
base64
- The weight is a
float
example payload
"forge couple": {
"args": [
true,
"Mask",
"",
null,
"First Line",
0.5,
[
{
"mask": "<mask in base64>",
"weight": 1.0
},
{
"mask": "<mask in base64>",
"weight": 1.0
}
]
]
}
Buy me a coffee~ ☕