aboutsummaryrefslogtreecommitdiff
path: root/webAO/dom/pickChar.ts
blob: 82fb6af2199b9c2dbec2ade0f5e59b2d1d9273c6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
import { client } from "../client";

/**
 * Requests to play as a character.
 * @param {number} ccharacter the character ID; if this is a large number,
 * then spectator is chosen instead.
 */
export function pickChar(ccharacter: number) {
    if (ccharacter === -1) {
        // Spectator
        document.getElementById("client_waiting")!.style.display = "none";
        document.getElementById("client_charselect")!.style.display = "none";
    }
    client.sender.sendCharacter(ccharacter);
}
window.pickChar = pickChar;