advanced syntaxes: VAR{} not updating when the default value is edited

This commit is contained in:
jean-emmanuel 2021-05-06 14:27:31 +02:00
parent 16442b664f
commit 60621203e5
3 changed files with 19 additions and 1 deletions

View file

@ -1,11 +1,17 @@
# Changelog
## 1.9.6
- bug fixes
- advanced syntaxes: `VAR{}` not updating when the default value is edited
- editor: fix "Bring to front" and "Send to back" context menu actions
## 1.9.5
- bug fixes
- advanced syntaxes: various isses and regressions
- editor: preserve advanced syntaxes in `left` and `top` when pasting a widget
- editor: fix "Bring to front" and "Send to back" context menu actions
- editor
- tree: update widget visibility when it changes dynamically

View file

@ -649,6 +649,16 @@ class Widget extends EventEmitter {
}
// update value if default changed
if (
value !== undefined &&
!this.variables[name].updated && // only true on edit
value !== this.variables[name].default
) {
this.variables[name].default = value
this.variables[name].value = value
}
var r = this.variables[name].value
var varname = 'VAR_' + varnumber

View file

@ -111,7 +111,9 @@ class ScriptVm extends Vm {
if (widgets[i].variables[name]) {
widgets[i].variables[name].value = value
widgets[i].variables[name].updated = 1
widgets[i].updateProps(widgets[i].variables[name].propNames)
widgets[i].variables[name].updated = 0
} else {