]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Add join button to Welcome dialog and make it default
authorz411 <z411@omaera.org>
Tue, 17 May 2022 02:16:01 +0000 (22:16 -0400)
committerz411 <z411@omaera.org>
Tue, 17 May 2022 02:16:01 +0000 (22:16 -0400)
qcsrc/menu/xonotic/dialog_welcome.qc
qcsrc/menu/xonotic/dialog_welcome.qh

index ca80ef4dd780241e2c971810972628fd7a60a979..bf4edb9c7b5f0a904febfd9869fb790eed50fd18 100644 (file)
@@ -20,7 +20,7 @@ float XonoticWelcomeDialog_keyDown(entity me, float key, float ascii, float shif
                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);
@@ -95,8 +95,7 @@ void XonoticWelcomeDialog_fill(entity me)
                        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));
 }
index d02cd6e73ca1c8ed99d75169f0d79ef88010235e..bca7e56e6e96d4eda373a949a9a466ec3c238b22 100644 (file)
@@ -19,5 +19,6 @@ CLASS(XonoticWelcomeDialog, XonoticRootDialog)
        //ATTRIB(XonoticWelcomeDialog, serverinfo_name_ent, entity, world);
        ATTRIB(XonoticWelcomeDialog, serverinfo_MOTD, string, string_null);
        ATTRIB(XonoticWelcomeDialog, serverinfo_MOTD_ent, entity, world);
+       ATTRIB(XonoticWelcomeDialog, joinButton_ent, entity, world);
        ATTRIB(XonoticWelcomeDialog, requiresConnection, bool, true);
 ENDCLASS(XonoticWelcomeDialog)