aboutsummaryrefslogtreecommitdiff
path: root/webAO/dom/updatePlayerAreas.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/updatePlayerAreas.ts
parent84db1ce9a2eaf6670605104d2ede8683159b67df (diff)
hide out of area players
Diffstat (limited to 'webAO/dom/updatePlayerAreas.ts')
-rw-r--r--webAO/dom/updatePlayerAreas.ts16
1 files changed, 16 insertions, 0 deletions
diff --git a/webAO/dom/updatePlayerAreas.ts b/webAO/dom/updatePlayerAreas.ts
new file mode 100644
index 0000000..d2ec076
--- /dev/null
+++ b/webAO/dom/updatePlayerAreas.ts
@@ -0,0 +1,16 @@
+import { client } from '../client'
+import { area_click } from './areaClick';
+/**
+ * Triggered when someone switches areas
+ * @param {Number} ownarea
+ */
+export function updatePlayerAreas(ownarea: number) {
+ for (let i=0; i < client.areas.length; i++) {
+ if (i===ownarea)
+ for (let classelement of Array.from(document.getElementsByClassName(`area${i}`) as HTMLCollectionOf<HTMLElement>))
+ classelement.style.display = "";
+ else
+ for (let classelement of Array.from(document.getElementsByClassName(`area${i}`) as HTMLCollectionOf<HTMLElement>))
+ classelement.style.display = "none";
+ }
+} \ No newline at end of file