mirror of
https://github.com/Pax1601/DCSOlympus.git
synced 2025-10-29 16:56:34 +00:00
Added airbase icons, started airbase spawn menu (WiP)
Added unit action menu
This commit is contained in:
18
client/src/controls/unitcontextmenu.ts
Normal file
18
client/src/controls/unitcontextmenu.ts
Normal file
@@ -0,0 +1,18 @@
|
||||
import { ContextMenu } from "./contextmenu";
|
||||
|
||||
export class UnitContextMenu extends ContextMenu {
|
||||
constructor(id: string) {
|
||||
super(id);
|
||||
}
|
||||
|
||||
setOptions(options: string[], callback: CallableFunction)
|
||||
{
|
||||
this.getContainer()?.replaceChildren(...options.map((option: string) =>
|
||||
{
|
||||
var button = document.createElement("button");
|
||||
button.innerText = option;
|
||||
button.addEventListener("click", () => callback(option));
|
||||
return (button);
|
||||
}));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user