diff --git a/light9/fade/Light9FadeUi.ts b/light9/fade/Light9FadeUi.ts --- a/light9/fade/Light9FadeUi.ts +++ b/light9/fade/Light9FadeUi.ts @@ -143,14 +143,15 @@ export class Light9Fader extends LitElem // console.timeEnd(`valueSync ${this.uri.value}`) return; } - - this.value = graph.floatValue(this.uri, graph.Uri(":value")); + const st = graph.uriValue(this.uri, U(":setting")); + this.value = graph.floatValue(st, graph.Uri(":value")); } onSliderInput(ev: CustomEvent) { if (this.graph === undefined) { return; } + const U = this.graph.U(); const prev = this.value; const v: number = (ev.target as any).valueAsNumber; this.value = parseFloat(v.toPrecision(3)); // rewrite pls @@ -158,7 +159,10 @@ export class Light9Fader extends LitElem return; } meter.tick(); - this.graph.patchObject(this.uri, this.graph.Uri(":value"), this.graph.LiteralRoundedFloat(this.value), this.ctx); + if (!this.setting) { + throw new Error("can't make new settings yet"); + } + this.graph.patchObject(this.setting, this.graph.Uri(":value"), this.graph.LiteralRoundedFloat(this.value), this.ctx); } onEffectChange(ev: CustomEvent) {