diff options
| author | stonedDiscord <stonedDiscord@users.noreply.github.com> | 2024-11-20 13:31:50 +0000 |
|---|---|---|
| committer | GitHub Action <actions@github.com> | 2024-11-20 13:31:50 +0000 |
| commit | 6684f3fce6e90fd0574d7bab63b629554ab03ef6 (patch) | |
| tree | b2a62247d17e23a77af57aea355ba621666817c2 /webAO/dom/updatePlayerAreas.ts | |
| parent | 95a2d1361d84c61b454ebe506e6963b93f6d8dee (diff) | |
Prettified Code!
Diffstat (limited to 'webAO/dom/updatePlayerAreas.ts')
| -rw-r--r-- | webAO/dom/updatePlayerAreas.ts | 30 |
1 files changed, 19 insertions, 11 deletions
diff --git a/webAO/dom/updatePlayerAreas.ts b/webAO/dom/updatePlayerAreas.ts index d2ec076..99eccf1 100644 --- a/webAO/dom/updatePlayerAreas.ts +++ b/webAO/dom/updatePlayerAreas.ts @@ -1,16 +1,24 @@ -import { client } from '../client' -import { area_click } from './areaClick'; +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 + 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"; + } +} |
