Use setChangedState for touch and color sensors

This commit is contained in:
Sam El-Husseini 2017-12-19 17:01:45 -08:00
parent a7d002d949
commit d3dcb5de85
3 changed files with 10 additions and 6 deletions

View File

@ -29,11 +29,12 @@ namespace pxsim {
getDeviceType() { getDeviceType() {
return DAL.DEVICE_TYPE_COLOR; return DAL.DEVICE_TYPE_COLOR;
} }
setColor(color: number) { setColor(color: number) {
this.color = color; if (this.color != color) {
this.changed = true; this.color = color;
this.valueChanged = true; this.setChangedState();
}
} }
getValue() { getValue() {

View File

@ -14,8 +14,7 @@ namespace pxsim {
public setPressed(pressed: boolean) { public setPressed(pressed: boolean) {
this.pressed.push(pressed); this.pressed.push(pressed);
this.changed = true; this.setChangedState();
this.valueChanged = true;
} }
public isPressed() { public isPressed() {

View File

@ -12,5 +12,9 @@ namespace pxsim.visuals {
public getPaddingRatio() { public getPaddingRatio() {
return 1 / 8; return 1 / 8;
} }
public updateState() {
// TODO: show different color modes
}
} }
} }