aboutsummaryrefslogtreecommitdiff
path: root/webAO/dom/updatePlayerAreas.ts
blob: 99eccf12cea958c0d13bf1736a6a109db22151d0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
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";
  }
}