From 5d5cb58412bd663aed4897ef7b0f0bd7f263d096 Mon Sep 17 00:00:00 2001 From: Caleb Date: Tue, 30 Aug 2022 17:28:30 -0400 Subject: Add more --- webAO/packets/handlers/handleFL.ts | 48 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 webAO/packets/handlers/handleFL.ts (limited to 'webAO/packets/handlers/handleFL.ts') diff --git a/webAO/packets/handlers/handleFL.ts b/webAO/packets/handlers/handleFL.ts new file mode 100644 index 0000000..d9e67e5 --- /dev/null +++ b/webAO/packets/handlers/handleFL.ts @@ -0,0 +1,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 = ( + 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 = ""; + } + } -- cgit