Use the members of the newly added KeyActionType object because static members were uninitialized. Handle PlayMacroAction in the KeyActionFactory.

This commit is contained in:
László Monda
2016-04-01 03:43:34 +02:00
parent fcd0d5b5b3
commit 1697d673f2
10 changed files with 45 additions and 41 deletions

View File

@@ -6,7 +6,6 @@ enum Layer {
class SwitchLayerAction extends KeyAction implements Serializable<SwitchLayerAction> {
static keyActionTypeString = 'switchLayer';
static toggleFlag = 0x80;
isLayerToggleable: boolean;
@@ -30,8 +29,8 @@ class SwitchLayerAction extends KeyAction implements Serializable<SwitchLayerAct
}
fromJsObject(jsObject: any): SwitchLayerAction {
this.assertKeyActionType(jsObject, SwitchLayerAction.keyActionTypeString, 'SwitchLayerAction');
this.layer = jsObject.layerId;
this.assertKeyActionType(jsObject, KeyActionType.SwitchLayerAction, 'SwitchLayerAction');
this.layer = jsObject.layer;
this.isLayerToggleable = jsObject.toggle;
return this;
}
@@ -46,7 +45,7 @@ class SwitchLayerAction extends KeyAction implements Serializable<SwitchLayerAct
toJsObject(): any {
return {
keyActionType: SwitchLayerAction.keyActionTypeString,
keyActionType: KeyActionType.SwitchLayerAction,
layer: this.layer,
toggle: this.isLayerToggleable
};