Visual Scripting Modules moved in from Foundations
This commit is contained in:
1 parent
cd44cc0d72
commit
1f4fee8904
19 files changed
+109
-100
No files matched your search
@@ -0,0 +1,27 @@
|
||||
function newVisualScriptingUtilitiesNodeConfig() {
|
||||
let thisObject = {
|
||||
saveConfigProperty: saveConfigProperty,
|
||||
loadConfigProperty: loadConfigProperty
|
||||
}
|
||||
|
||||
return thisObject
|
||||
|
||||
function saveConfigProperty(payload, propertyName, value) {
|
||||
try {
|
||||
let config = JSON.parse(payload.node.config)
|
||||
config[propertyName] = value
|
||||
payload.node.config = JSON.stringify(config, null, 4)
|
||||
} catch (err) {
|
||||
// we ignore errors here since most likely they will be parsing errors.
|
||||
}
|
||||
}
|
||||
|
||||
function loadConfigProperty(payload, propertyName) {
|
||||
try {
|
||||
let config = JSON.parse(payload.node.config)
|
||||
return config[propertyName]
|
||||
} catch (err) {
|
||||
// we ignore errors here since most likely they will be parsing errors.
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user