diff options
| author | Caleb <caleb.mabry.15@cnu.edu> | 2022-09-01 22:36:22 -0400 |
|---|---|---|
| committer | Caleb <caleb.mabry.15@cnu.edu> | 2022-09-01 22:36:22 -0400 |
| commit | 86b493b881bde4a11214929ebe4317289a7f1da3 (patch) | |
| tree | 9d1b03e1d67278a42796de8e2f4d6e4a3df5d78c /webAO/packets/handlers/handleCharsCheck.ts | |
| parent | cac2c72288572fe2e635b4e8f49b52fac5c8dd90 (diff) | |
Moved rest of the handlers
Diffstat (limited to 'webAO/packets/handlers/handleCharsCheck.ts')
| -rw-r--r-- | webAO/packets/handlers/handleCharsCheck.ts | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/webAO/packets/handlers/handleCharsCheck.ts b/webAO/packets/handlers/handleCharsCheck.ts new file mode 100644 index 0000000..2d891ef --- /dev/null +++ b/webAO/packets/handlers/handleCharsCheck.ts @@ -0,0 +1,17 @@ +import { client } from "../../client"; + +/** + * Handles the list of all used and vacant characters. + * @param {Array} args list of all characters represented as a 0 for free or a -1 for taken + */ +export const handleCharsCheck = (args: string[]) => { + for (let i = 0; i < client.char_list_length; i++) { + const img = document.getElementById(`demo_${i}`)!; + + if (args[i + 1] === "-1") { + img.style.opacity = "0.25"; + } else if (args[i + 1] === "0") { + img.style.opacity = "1"; + } + } +}
\ No newline at end of file |
