]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/menu/xonotic/dialog_welcome.qc
Allow showing the Welcome dialog in demos, initially hidden
[xonotic/xonotic-data.pk3dir.git] / qcsrc / menu / xonotic / dialog_welcome.qc
index 6448a0fca5333b3f71e0bc5ea736e74cf9435d7e..bf45084d73bc47b305d62ed831e09536e42f14b9 100644 (file)
@@ -82,6 +82,17 @@ void XonoticWelcomeDialog_draw(entity me)
                localcmd("\n+show_info0; defer 2 -show_info0\n");
                me.close(me);
        }
+
+       if (isdemo())
+       {
+               me.joinButton_ent.disabled = true;
+               me.spectateButton_ent.disabled = true;
+       }
+       else
+       {
+               me.joinButton_ent.disabled = false;
+               me.spectateButton_ent.disabled = false;
+       }
 }
 
 void XonoticWelcomeDialog_fill(entity me)
@@ -101,5 +112,5 @@ void XonoticWelcomeDialog_fill(entity me)
        me.gotoRC(me, me.rows - 1, 0);
                me.TD(me, 1, me.columns / 2, me.joinButton_ent = makeXonoticCommandButton(_("Join"), '0 1 0', "cmd join", COMMANDBUTTON_CLOSE));
                        me.joinButton_ent.preferredFocusPriority = 1;
-               me.TD(me, 1, me.columns / 2, makeXonoticCommandButton(_("Spectate"), '0 0 0', "cmd spectate", COMMANDBUTTON_CLOSE));
+               me.TD(me, 1, me.columns / 2, me.spectateButton_ent = makeXonoticCommandButton(_("Spectate"), '0 0 0', "cmd spectate", COMMANDBUTTON_CLOSE));
 }