From: z411 Date: Tue, 17 May 2022 02:16:01 +0000 (-0400) Subject: Add join button to Welcome dialog and make it default X-Git-Tag: xonotic-v0.8.5~21^2~1 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=f645cbcbc879e545021572e5ef0da5c0b66ed3f8;p=xonotic%2Fxonotic-data.pk3dir.git Add join button to Welcome dialog and make it default --- diff --git a/qcsrc/menu/xonotic/dialog_welcome.qc b/qcsrc/menu/xonotic/dialog_welcome.qc index ca80ef4dd..bf4edb9c7 100644 --- a/qcsrc/menu/xonotic/dialog_welcome.qc +++ b/qcsrc/menu/xonotic/dialog_welcome.qc @@ -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)); } diff --git a/qcsrc/menu/xonotic/dialog_welcome.qh b/qcsrc/menu/xonotic/dialog_welcome.qh index d02cd6e73..bca7e56e6 100644 --- a/qcsrc/menu/xonotic/dialog_welcome.qh +++ b/qcsrc/menu/xonotic/dialog_welcome.qh @@ -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)