Difference between revisions of "Mod:Gobalconfig"
From Roll20 Wiki
Andreas J. (Talk | contribs) (move page here from old one.) |
Andreas J. (Talk | contribs) m (1223200 moved page API:Gobalconfig to Mod:Gobalconfig) |
||
(4 intermediate revisions by one user not shown) | |||
Line 1: | Line 1: | ||
− | == | + | {{revdate}}{{apibox}} |
+ | == Mod - globalconfig == | ||
+ | {{stub}} | ||
− | + | The {{c|globalconfig}} variable is available for use in Mod/API scripts and it is related to the {{c|state}} variable. Unlike {{c|state}}, {{c|globalconfig}} does not persist and gets reset anytime the [[Mod Sandbox|sandbox]] restarts. | |
− | + | {{c|globalconfig}} contains key/value properties of 1-click user options. | |
− | + | ||
− | + | ||
Here's a code example from the `StatusFx` script: | Here's a code example from the `StatusFx` script: | ||
− | + | <pre data-language="javascript" style="overflow:auto;"> // Get the FX configurations from the useroptions. | |
− | + | ||
var useroptions = (globalconfig && | var useroptions = (globalconfig && | ||
(globalconfig.StatusFX || globalconfig.statusfx)) || | (globalconfig.StatusFX || globalconfig.statusfx)) || | ||
{ 'red': 'splatter-blood [1,-1]', 'green': 'bubbling-acid', 'custom': 'sleep: glow-holy|stars: beam-fire [2,3]', 'interval': 500}; | { 'red': 'splatter-blood [1,-1]', 'green': 'bubbling-acid', 'custom': 'sleep: glow-holy|stars: beam-fire [2,3]', 'interval': 500}; | ||
− | + | </pre> | |
More info in the forums: | More info in the forums: | ||
− | + | * {{fpl|3162220 New API config system}} March 2016 | |
− | + | * {{fpl|3289777 API one-click useroptions}} April 2016 | |
− | [ | + | * {{fpl|4019465 [Help][Script] How do I test 'one click' scripts?}} Sep. 2017 |
− | [[Category:API]] | + | [[Category:API Development]] |
Latest revision as of 08:08, 9 June 2024
Page Updated: 2024-06-09 |
Roll20 Mod
Use Mods
- Use & Install
- Mod:Script Index & Suggestions
- Short Community Scripts
- Meta Scripts
- User Documentation
- Mod Scripts(Forum)
- Mod Update 2024🆕
- Macro Guide
Mod Development
Reference
- Objects
- Events
- Chat Events & Functions
- Utility Functions
- Function
- Roll20 object
- Token Markers
- Sandbox Model
- Debugging
Cookbook
[edit] Mod - globalconfig
This article is a stub. |
The globalconfig
variable is available for use in Mod/API scripts and it is related to the state
variable. Unlike state
, globalconfig
does not persist and gets reset anytime the sandbox restarts.
globalconfig
contains key/value properties of 1-click user options.
Here's a code example from the `StatusFx` script:
// Get the FX configurations from the useroptions. var useroptions = (globalconfig && (globalconfig.StatusFX || globalconfig.statusfx)) || { 'red': 'splatter-blood [1,-1]', 'green': 'bubbling-acid', 'custom': 'sleep: glow-holy|stars: beam-fire [2,3]', 'interval': 500};
More info in the forums:
- New API config system(Forum) March 2016
- API one-click useroptions(Forum) April 2016
- [Help[Script] How do I test 'one click' scripts?](Forum) Sep. 2017