MENU: m_menu.qc: actually connect to server

This commit is contained in:
erysdren 2024-11-14 10:31:21 -06:00
parent 708a5b652b
commit 6a0b432779

View file

@ -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);