Skip to content

Commit

Permalink
feat: add m_bEnabled property (defaults to true)
Browse files Browse the repository at this point in the history
  • Loading branch information
Notexe committed Mar 13, 2024
1 parent 132b7d7 commit 9263dad
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 4 deletions.
2 changes: 2 additions & 0 deletions content/chunk0/SimpleKeyEventHelper.entity.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
"inputCopying": { "Enable": { "Enable": ["cafe457f1b485c64"] }, "Disable": { "Disable": ["cafe457f1b485c64"] } },
"propertyAliases": {
"m_pDataProvider": [{ "originalProperty": "m_pDataProvider", "originalEntity": "cafe457f1b485c64" }],
"m_bEnabled": [{ "originalProperty": "m_bEnabled", "originalEntity": "cafe457f1b485c64" }],
"m_sModifierKeyName": [{ "originalProperty": "m_sModifierKeyName", "originalEntity": "cafe457f1b485c64" }],
"m_sKeyName": [{ "originalProperty": "m_sKeyName", "originalEntity": "cafe457f1b485c64" }]
},
Expand All @@ -32,6 +33,7 @@
},
"m_sClassName": { "type": "ZString", "value": "simplekeyeventhelper.SimpleKeyEventHelper" },
"m_pDataProvider": { "type": "SEntityTemplateReference", "value": null },
"m_bEnabled": { "type": "bool", "value": true },
"m_sModifierKeyName": { "type": "ZString", "value": "None" },
"m_sKeyName": { "type": "ZString", "value": "" }
},
Expand Down
Binary file modified content/chunk0/scaleform/001598DB8D4DC9DB.GFXF
Binary file not shown.
Binary file modified content/chunk0/scaleform/00FDD03F03A3CAB7.UICB
Binary file not shown.
Binary file modified source/bin/SimpleKeyEventHelper.swf
Binary file not shown.
17 changes: 13 additions & 4 deletions source/src/simplekeyeventhelper/SimpleKeyEventHelper.as
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,17 @@ public class SimpleKeyEventHelper extends BaseControl {
}
}

public function set m_bEnabled(bool:Boolean):void {
if (bool) {
m_enabled = true;
addKeyListeners();

} else {
m_enabled = false;
removeKeyListeners();
}
}

public function set m_sModifierKeyName(string:String):void {
m_modifierKeyName = string.toLowerCase();
}
Expand All @@ -88,13 +99,11 @@ public class SimpleKeyEventHelper extends BaseControl {
}

public function Enable():void {
m_enabled = true;
addKeyListeners();
m_bEnabled = true;
}

public function Disable():void {
m_enabled = false;
removeKeyListeners();
m_bEnabled = false;
}

private function GetKeyCodeFromString(keyName:String):uint {
Expand Down

0 comments on commit 9263dad

Please sign in to comment.