]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Allow mutators to add their own menu dialogs
authorMario <mario@smbclan.net>
Mon, 6 Mar 2017 14:16:35 +0000 (00:16 +1000)
committerMario <mario@smbclan.net>
Mon, 6 Mar 2017 14:16:35 +0000 (00:16 +1000)
qcsrc/menu/mutators/events.qh
qcsrc/menu/xonotic/mainwindow.qc

index f43199ceada1ca00caea4851bb42302c38cc445d..1df38f5af09c571df07e280b3c9691ec192f837b 100644 (file)
@@ -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);
index 0e071c2e71efc20321722e13b4246f46ec81cfda..b46fe846b6002cb18e74fe30a30d7d101e49c292 100644 (file)
@@ -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);