aboutsummaryrefslogtreecommitdiff
path: root/webAO/dom/pickChar.ts
blob: 577312529af223326b12eb5e25c71ae8f98256c1 (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.sendCharacter(ccharacter);
}
window.pickChar = pickChar;