X-Git-Url: http://git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fmenu%2Fxonotic%2Fdialog_multiplayer_join.qc;h=1792ec635b41f1e594e3be4fbf6b455980f9d204;hb=b5255f33cd683fb2cbc3f7d4da75b5e2f200b7fb;hp=fba5f193098652d55e7dfb00556e3f712145dc6a;hpb=8da45596c76bb645e864b4ec8ff5a3ee13bbf27c;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/menu/xonotic/dialog_multiplayer_join.qc b/qcsrc/menu/xonotic/dialog_multiplayer_join.qc index fba5f1930..1792ec635 100644 --- a/qcsrc/menu/xonotic/dialog_multiplayer_join.qc +++ b/qcsrc/menu/xonotic/dialog_multiplayer_join.qc @@ -1,16 +1,12 @@ -#ifndef DIALOG_MULTIPLAYER_JOIN_H -#define DIALOG_MULTIPLAYER_JOIN_H -#include "tab.qc" -CLASS(XonoticServerListTab, XonoticTab) - METHOD(XonoticServerListTab, fill, void(entity)); - ATTRIB(XonoticServerListTab, intendedWidth, float, 0.9) - ATTRIB(XonoticServerListTab, rows, float, 23) - ATTRIB(XonoticServerListTab, columns, float, 6.5) -ENDCLASS(XonoticServerListTab) -entity makeXonoticServerListTab(); -#endif +#include "dialog_multiplayer_join.qh" -#ifdef IMPLEMENTATION +#include "serverlist.qh" + +#include "textlabel.qh" +#include "inputbox.qh" +#include "checkbox.qh" +#include "commandbutton.qh" +#include "button.qh" entity makeXonoticServerListTab() { @@ -19,6 +15,13 @@ entity makeXonoticServerListTab() me.configureDialog(me); return me; } + +void XonoticServerListTab_refresh(entity this, entity slist) +{ + bool clear = false; + slist.refreshServerList(slist, clear ? REFRESHSERVERLIST_RESET : REFRESHSERVERLIST_ASK); +} + void XonoticServerListTab_fill(entity me) { entity e, slist; @@ -26,13 +29,13 @@ void XonoticServerListTab_fill(entity me) slist = makeXonoticServerList(); me.gotoRC(me, 0.5, 0); - me.TD(me, 1, 0.6, e = makeXonoticTextLabel(1, _("Filter:"))); - me.TD(me, 1, 2.8, e = makeXonoticInputBox(0, string_null)); + me.TD(me, 1, 0.5, e = makeXonoticTextLabel(1, _("Filter:"))); + me.TD(me, 1, 2, e = makeXonoticInputBox(0, string_null)); e.onChange = ServerList_Filter_Change; e.onChangeEntity = slist; slist.controlledTextbox = e; - me.gotoRC(me, 0.5, 3.6); + me.gotoRC(me, 0.5, 2.6); me.TD(me, 1, 0.9, e = makeXonoticCheckBox(0, "menu_slist_categories", ZCTX(_("SRVS^Categories")))); e.onClickEntity = slist; e.onClick = ServerList_Categories_Click; @@ -48,6 +51,9 @@ void XonoticServerListTab_fill(entity me) e.onClick = ServerList_ShowFull_Click; me.TD(me, 1, 0.6, e = makeXonoticCheckBox_T(0, "net_slist_pause", _("Pause"), _("Pause updating the server list to prevent servers from \"jumping around\""))); + me.TD(me, 1, 1, e = makeXonoticButton_T(_("Refresh"), '0 0 0', _("Reload the server list"))); + e.onClick = XonoticServerListTab_refresh; + e.onClickEntity = slist; me.gotoRC(me, 2, 0); me.TD(me, 1, 1, slist.sortButton1 = makeXonoticButton(string_null, '0 0 0')); @@ -76,9 +82,11 @@ void XonoticServerListTab_fill(entity me) e.onClickEntity = slist; slist.infoButton = e; me.TR(me); - me.TD(me, 1, me.columns, e = makeXonoticButton(_("Join!"), '0 0 0')); + me.TD(me, 1, 1, e = makeXonoticCommandButton_T(_("Disconnect"), '0 0 0', "disconnect", 0, + _("Disconnect from the server"))); + slist.disconnectButton = e; + me.TD(me, 1, me.columns-1, e = makeXonoticButton(_("Join!"), '0 0 0')); e.onClick = ServerList_Connect_Click; e.onClickEntity = slist; slist.connectButton = e; } -#endif