aboutsummaryrefslogtreecommitdiff
path: root/webAO/packets/handlers/handleFL.ts
blob: d9e67e52b2476f99a2d538a4c5db9aaa11cd8607 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
import { setExtraFeatures } from "../../client";

  
  /**
   * With this the server tells us which features it supports
   * @param {Array} args list of features
   */
export const handleFL = (args: string[]) => {
    console.info("Server-supported features:");
    console.info(args);
    setExtraFeatures(args);

    if (args.includes("yellowtext")) {
      const colorselect = <HTMLSelectElement>(
        document.getElementById("textcolor")
      );

      colorselect.options[colorselect.options.length] = new Option(
        "Yellow",
        "5"
      );
      colorselect.options[colorselect.options.length] = new Option("Grey", "6");
      colorselect.options[colorselect.options.length] = new Option("Pink", "7");
      colorselect.options[colorselect.options.length] = new Option("Cyan", "8");
    }

    if (args.includes("cccc_ic_support")) {
      document.getElementById("cccc")!.style.display = "";
      document.getElementById("pairing")!.style.display = "";
    }

    if (args.includes("flipping")) {
      document.getElementById("button_flip")!.style.display = "";
    }

    if (args.includes("looping_sfx")) {
      document.getElementById("button_shake")!.style.display = "";
      document.getElementById("2.7")!.style.display = "";
    }

    if (args.includes("effects")) {
      document.getElementById("2.8")!.style.display = "";
    }

    if (args.includes("y_offset")) {
      document.getElementById("y_offset")!.style.display = "";
    }
  }