aboutsummaryrefslogtreecommitdiff
path: root/webAO/dom/pickChar.ts
blob: 05f1c700fce9d88747409066fc94430f7156a82e (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;