From: Mario Date: Mon, 6 Mar 2017 14:16:35 +0000 (+1000) Subject: Allow mutators to add their own menu dialogs X-Git-Tag: xonotic-v0.8.2~127 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=753b7569cd6ccb5a6528aad2ecc374a68c962748;p=xonotic%2Fxonotic-data.pk3dir.git Allow mutators to add their own menu dialogs --- 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);