From b89bb1c580e45c78bdb0afe0d989771bbd3d4afa Mon Sep 17 00:00:00 2001 From: stoned Date: Wed, 19 Jan 2022 14:18:49 +0100 Subject: add timers --- webAO/client.html | 24 ++++++++++++++++++++++++ webAO/client.js | 21 +++++++++++++++++++++ 2 files changed, 45 insertions(+) (limited to 'webAO') diff --git a/webAO/client.html b/webAO/client.html index 32cf107..d964fd0 100644 --- a/webAO/client.html +++ b/webAO/client.html @@ -374,6 +374,30 @@ onclick="changeBackgroundOOC()">Change +
+ Timers + 00:00:00 + 00:00:00 + 00:00:00 + 00:00:00 + 00:00:00 + 00:00:00 + 00:00:00 + 00:00:00 + 00:00:00 + 00:00:00 + 00:00:00 + 00:00:00 + 00:00:00 + 00:00:00 + 00:00:00 + 00:00:00 + 00:00:00 + 00:00:00 + 00:00:00 + 00:00:00 + 00:00:00 +
diff --git a/webAO/client.js b/webAO/client.js index a2d70fb..cfb0969 100644 --- a/webAO/client.js +++ b/webAO/client.js @@ -199,6 +199,7 @@ class Client extends EventEmitter { this.on("BN", this.handleBN.bind(this)); this.on("HP", this.handleHP.bind(this)); this.on("RT", this.handleRT.bind(this)); + this.on("TI", this.handleTI.bind(this)); this.on("ZZ", this.handleZZ.bind(this)); this.on("HI", this.handleHI.bind(this)); this.on("ID", this.handleID.bind(this)); @@ -1317,6 +1318,26 @@ class Client extends EventEmitter { viewport.initTestimonyUpdater(); } + /** + * Handles a timer update + * @param {Array} args packet arguments + */ + handleTI(args) { + const timerid = Number(args[1]); + const type = Number(args[2]); + const timer_value = Number(args[3]); + switch (type) { + case 0: + // + case 1: + document.getElementById("client_timer"+timerid).innerText = timer_value; + case 2: + document.getElementById("client_timer"+timerid).style.display = ""; + case 3: + document.getElementById("client_timer"+timerid).style.display = "none"; + } + } + /** * Handles a modcall * @param {Array} args packet arguments -- cgit