Renderer/assets/Scripts/client/uihooks.ts
austin e3ab44227f
All checks were successful
studiorailgun/Renderer/pipeline/head This commit looks good
dynamic menu navigation
2025-05-05 20:01:38 -04:00

17 lines
531 B
TypeScript

import { Engine } from "/Scripts/types/engine";
import { Hook } from "/Scripts/types/hook";
/**
* The hook that fires every time a dynamic button in the ui is clicked
*/
export const clientUIButtonHook: Hook =
{
signal: "uiButton",
callback: (engine: Engine, data: string) => {
if(data.length > 4 && data.substring(0,9) === "openDiag("){
engine.classes.menuUtils.static.openDialog(data.substring(9,data.length - 1))
} else {
console.log("button clicked " + data)
}
}
}