]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Merge branch 'z411/welcome_join' into 'master'
authorterencehill <piuntn@gmail.com>
Sat, 4 Jun 2022 21:05:48 +0000 (21:05 +0000)
committerterencehill <piuntn@gmail.com>
Sat, 4 Jun 2022 21:05:48 +0000 (21:05 +0000)
Add join button to Welcome dialog and make it default

See merge request xonotic/xonotic-data.pk3dir!1021

1  2 
qcsrc/menu/xonotic/dialog_welcome.qc

index 5da6f8b1ea9a0bb30aba0786c0bba645f59f2d3b,3c5c0b353ac5d4779f8286587728171cb27c148f..6448a0fca5333b3f71e0bc5ea736e74cf9435d7e
@@@ -20,7 -20,7 +20,7 @@@ float XonoticWelcomeDialog_keyDown(enti
                case K_KP_ENTER:
                case K_ENTER:
                case K_SPACE:
-                       me.close(me);
+                       XonoticCommandButton_Click(me.joinButton_ent, me);
                        return true;
                default:
                        return SUPER(XonoticWelcomeDialog).keyDown(me, key, ascii, shift);
@@@ -71,10 -71,6 +71,10 @@@ void XonoticWelcomeDialog_readInputArgs
  void XonoticWelcomeDialog_draw(entity me)
  {
        SUPER(XonoticWelcomeDialog).draw(me);
 +
 +      if (!(gamestatus & (GAME_ISSERVER | GAME_CONNECTED)))
 +              me.close(me);
 +
        if(me.serverinfo_MOTD == "" && gamestatus & (GAME_CONNECTED | GAME_ISSERVER))
        {
                // if serverinfo_MOTD is empty while connected it means we are connected to an old server
@@@ -99,8 -95,7 +99,7 @@@ void XonoticWelcomeDialog_fill(entity m
                        me.serverinfo_MOTD_ent.allowColors = true;
                        me.serverinfo_MOTD_ent.escapedNewLines = true;
        me.gotoRC(me, me.rows - 1, 0);
-               me.TD(me, 1, me.columns, e = makeXonoticButton(_("OK"), '0 0 0'));
-                       e.onClick = Dialog_Close;
-                       e.onClickEntity = me;
-                       e.preferredFocusPriority = 1;
+               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));
  }