aboutsummaryrefslogtreecommitdiffstats
path: root/src/client/Buttons.hx
diff options
context:
space:
mode:
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