From 6a0b432779324955bf8f2c222a6ba22d698909bb Mon Sep 17 00:00:00 2001 From: erysdren Date: Thu, 14 Nov 2024 10:31:21 -0600 Subject: [PATCH] MENU: m_menu.qc: actually connect to server --- source/menu/m_menu.qc | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/source/menu/m_menu.qc b/source/menu/m_menu.qc index 21c0fad..e0b7941 100644 --- a/source/menu/m_menu.qc +++ b/source/menu/m_menu.qc @@ -633,11 +633,22 @@ void(string id, vector pos, vector size, __inout vector scrollofs, float num_ser sui_push_frame(listitem_pos, rowsize); sui_set_align([SUI_ALIGN_START, SUI_ALIGN_CENTER]); + string listitem_id = strcat(id, "scrl", ftos(index)); + sui_action_element([0, 0], rowsize, listitem_id, sui_noop); + // bg vector bpos = [0, 0]; vector bsize = [(rowsize.x / 8) * 5, rowsize.y]; sui_fill(bpos, rowsize, [0.25, 0.25, 0.25], 0.5, 0); + // hovered bg + if (sui_is_hovered(listitem_id)) + sui_fill(bpos, rowsize, [0.25, 0.25, 0.25], 0.5, 0); + + // do it + if (sui_is_clicked(listitem_id)) + localcmd("connect ", gethostcachestring(gethostcacheindexforkey("cname"), index), "\n"); + // name sui_fill(bpos, bsize, [0.25, 0.25, 0.25], 0.5, 0); sui_text(bpos + [8, 0], MENU_TEXT_SMALL, str2ascii(gethostcachestring(gethostcacheindexforkey("name"), index)), MENU_TEXT_1, 1, 0);