1
0
mirror of https://github.com/sehugg/8bitworkshop.git synced 2025-07-18 19:24:06 +00:00

scripting: working on notebook, functions, files, setItem(), fixed tests

This commit is contained in:
Steven Hugg
2021-08-15 10:10:01 -05:00
parent 7f86ed0cb6
commit 6134a8c89c
22 changed files with 1005 additions and 285 deletions

View File

@@ -0,0 +1,30 @@
import * as io from "./io";
export class ScriptUISliderType {
readonly uitype = 'slider';
value: number;
constructor(
readonly min: number,
readonly max: number
) {
}
}
export class ScriptUISlider extends ScriptUISliderType implements io.Loadable {
initvalue: number;
initial(value: number) {
this.initvalue = value;
return this;
}
reset() {
this.value = this.initvalue != null ? this.initvalue : this.min;
}
$$getstate() {
return { value: this.value };
}
}
export function slider(min: number, max: number) {
return new ScriptUISlider(min, max);
}