From 753b7569cd6ccb5a6528aad2ecc374a68c962748 Mon Sep 17 00:00:00 2001 From: Mario Date: Tue, 7 Mar 2017 00:16:35 +1000 Subject: [PATCH] Allow mutators to add their own menu dialogs --- qcsrc/menu/mutators/events.qh | 5 +++++ qcsrc/menu/xonotic/mainwindow.qc | 2 ++ 2 files changed, 7 insertions(+) diff --git a/qcsrc/menu/mutators/events.qh b/qcsrc/menu/mutators/events.qh index f43199cea..1df38f5af 100644 --- a/qcsrc/menu/mutators/events.qh +++ b/qcsrc/menu/mutators/events.qh @@ -33,3 +33,8 @@ string cmd_string; /** whole command, use only if you really have to */ i(string, cmd_string) \ /**/ MUTATOR_HOOKABLE(Menu_ConsoleCommand, EV_Menu_ConsoleCommand); + +#define EV_ConfigureDialogs(i, o) \ + /** main window entity */ i(entity, MUTATOR_ARGV_0_entity) \ + /**/ +MUTATOR_HOOKABLE(ConfigureDialogs, EV_ConfigureDialogs); diff --git a/qcsrc/menu/xonotic/mainwindow.qc b/qcsrc/menu/xonotic/mainwindow.qc index 0e071c2e7..b46fe846b 100644 --- a/qcsrc/menu/xonotic/mainwindow.qc +++ b/qcsrc/menu/xonotic/mainwindow.qc @@ -233,6 +233,8 @@ void MainWindow_configureMainWindow(entity me) i.configureDialog(i); me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z * SKINALPHA_DIALOG_SANDBOXTOOLS); + MUTATOR_CALLHOOK(ConfigureDialogs, me); + // main dialogs/windows me.mainNexposee = n = NEW(XonoticNexposee); -- 2.39.2