aboutsummaryrefslogtreecommitdiff
path: root/webAO/dom/areaClick.ts
diff options
context:
space:
mode:
authorstonedDiscord <Tukz@gmx.de>2024-08-31 15:14:48 +0200
committerstonedDiscord <Tukz@gmx.de>2024-08-31 15:14:48 +0200
commit705bb39fbe20c2b17788b4f2ab859674edc02de6 (patch)
tree614e829cdf7442d3acce59b5f27a5ea062fb18c0 /webAO/dom/areaClick.ts
parent84db1ce9a2eaf6670605104d2ede8683159b67df (diff)
hide out of area players
Diffstat (limited to 'webAO/dom/areaClick.ts')
-rw-r--r--webAO/dom/areaClick.ts5
1 files changed, 4 insertions, 1 deletions
diff --git a/webAO/dom/areaClick.ts b/webAO/dom/areaClick.ts
index 1b0fe52..e217c2c 100644
--- a/webAO/dom/areaClick.ts
+++ b/webAO/dom/areaClick.ts
@@ -1,15 +1,18 @@
import { client } from '../client'
+import { updatePlayerAreas } from './updatePlayerAreas'
/**
* Triggered when an item on the area list is clicked.
* @param {HTMLElement} el
*/
export function area_click(el: HTMLElement) {
- const area = client.areas[el.id.substr(4)].name;
+ const area = client.areas[el.id.substring(4)].name;
client.sender.sendMusicChange(area);
const areaHr = document.createElement("div");
areaHr.className = "hrtext";
areaHr.textContent = `switched to ${el.textContent}`;
document.getElementById("client_log")!.appendChild(areaHr);
+ client.area = Number(el.id.substring(4));
+ updatePlayerAreas(client.area);
}
window.area_click = area_click; \ No newline at end of file