aboutsummaryrefslogtreecommitdiffstats
path: root/src/client/Buttons.hx
diff options
context:
space:
mode:
authorRblSb <msrblsb@gmail.com>2020-06-06 14:31:43 +0300
committerRblSb <msrblsb@gmail.com>2020-06-06 14:31:43 +0300
commit80ec4ba1747d22ec136a95d6b35ba6289e15e8ad (patch)
treebb34c1871538085084ba3f703d4dc6e61661fb62 /src/client/Buttons.hx
parent41e8165d3d701562af4eb78d86816fd1f88766af (diff)
Once events api, improve pause hotkey
Diffstat (limited to 'src/client/Buttons.hx')
-rw-r--r--src/client/Buttons.hx5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/client/Buttons.hx b/src/client/Buttons.hx
index 771f827..5eb1baf 100644
--- a/src/client/Buttons.hx
+++ b/src/client/Buttons.hx
@@ -273,7 +273,10 @@ class Buttons {
case L: ge("#leader_btn").onclick();
case P:
if (!main.isLeader()) {
- Timer.delay(() -> player.pause(), 500);
+ JsApi.once(SetLeader, event -> {
+ final name = event.setLeader.clientName;
+ if (name == main.getName()) player.pause();
+ });
}
ge("#leader_btn").onclick();
default: return;
send patches to the email below
yukais@pinapelz.com
include the subject [PATCH repo_name]
pinapelz.com
homepage