]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/menu/xonotic/dialog_gamemenu.qc
Fix #2727 "New esc-menu shouldn't open a standard settings page"
[xonotic/xonotic-data.pk3dir.git] / qcsrc / menu / xonotic / dialog_gamemenu.qc
index 6ab4973cce87f82cdf781b8218d85cd0e584071c..a9ba16b4f0ff885f62e1b8773c893964576b2988 100644 (file)
@@ -10,6 +10,28 @@ void XonoticGameMenuDialog_destroy(entity me)
        cvar_set("_menu_gamemenu_dialog_available", "0");
 }
 
+void XonoticGameMenuDialog_draw(entity me)
+{
+       entity btn = me.joinButton;
+       if(cvar("g_campaign"))
+       {
+               if (btn.toString(btn) == _("Join!"))
+               {
+                       btn.setText(btn, _("Restart level"));
+                       btn.onClickCommand = "resetmatch";
+               }
+       }
+       else
+       {
+               if (btn.toString(btn) == _("Restart level"))
+               {
+                       btn.setText(btn, _("Join!"));
+                       btn.onClickCommand = "join";
+               }
+       }
+       SUPER(XonoticGameMenuDialog).draw(me);
+}
+
 void XonoticGameMenuDialog_fill(entity me)
 {
        registercvar("_menu_gamemenu_dialog_available", "0", 0);
@@ -26,7 +48,7 @@ void XonoticGameMenuDialog_fill(entity me)
                me.TD(me, 1, 0.8, e = makeXonoticCommandButton(_("Profile"), '0 0 0', "menu_cmd profile", 0));
        me.TR(me);
                me.TDempty(me, 0.1);
-               me.TD(me, 1, 0.8, e = makeXonoticCommandButton(_("Settings"), '0 0 0', "menu_cmd videosettings", 0));
+               me.TD(me, 1, 0.8, e = makeXonoticCommandButton(_("Settings"), '0 0 0', "menu_cmd settings", 0));
        me.TR(me);
                me.TDempty(me, 0.1);
                me.TD(me, 1, 0.8, e = makeXonoticCommandButton(_("Input"), '0 0 0', "menu_cmd inputsettings", 0));
@@ -34,7 +56,7 @@ void XonoticGameMenuDialog_fill(entity me)
                me.TD(me, 1, 1, e = makeXonoticCommandButton(_("Quick menu"), '0 0 0', "quickmenu", COMMANDBUTTON_CLOSE));
        me.TR(me);
        me.TR(me);
-               me.TD(me, 1, 1, e = makeXonoticCommandButton(_("Join!"), '0 0 0', "join", COMMANDBUTTON_CLOSE));
+               me.TD(me, 1, 1, e = me.joinButton = makeXonoticCommandButton(_("Join!"), '0 0 0', "join", COMMANDBUTTON_CLOSE));
        me.TR(me);
                me.TD(me, 1, 1, e = makeXonoticCommandButton(_("Spectate"), '0 0 0', "spec", COMMANDBUTTON_CLOSE));
        me.TR(me);