Skip to content

Commit

Permalink
add button left/rightclick functions (#878)
Browse files Browse the repository at this point in the history
  • Loading branch information
jberg authored and captbaritone committed Aug 20, 2019
1 parent ceb85fa commit 533d7f3
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
2 changes: 0 additions & 2 deletions modern/src/maki-interpreter/objects.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,10 +92,8 @@ Array [
"Browser.refresh",
"Browser.settargetname",
"Browser.stop",
"Button.leftclick",
"Button.onleftclick",
"Button.onrightclick",
"Button.rightclick",
"Button.setactivatednocallback",
"CfgGroup.cfggetfloat",
"CfgGroup.cfggetguid",
Expand Down
8 changes: 8 additions & 0 deletions modern/src/runtime/Button.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,14 @@ class Button extends GuiObject {
return "Button";
}

leftclick() {
this.js_trigger("onLeftClick");
}

rightclick() {
this.js_trigger("onRightClick");
}

onactivate(activated) {
unimplementedWarning("onactivate");
}
Expand Down

0 comments on commit 533d7f3

Please sign in to comment.