More work on follow and tanking

This commit is contained in:
Pax1601
2023-04-14 17:30:10 +02:00
parent b56f1ca547
commit 39698c66a3
15 changed files with 308 additions and 104 deletions

View File

@@ -5,12 +5,12 @@ export class UnitContextMenu extends ContextMenu {
super(id);
}
setOptions(options: string[], callback: CallableFunction)
setOptions(options: {[key: string]: string}, callback: CallableFunction)
{
this.getContainer()?.replaceChildren(...options.map((option: string) =>
this.getContainer()?.replaceChildren(...Object.keys(options).map((option: string, idx: number) =>
{
var button = document.createElement("button");
button.innerText = option;
button.innerHTML = options[option];
button.addEventListener("click", () => callback(option));
return (button);
}));