mirror of
https://github.com/nzp-team/quakec.git
synced 2024-12-11 05:00:52 +00:00
MENU: m_menu.qc: actually connect to server
This commit is contained in:
parent
708a5b652b
commit
6a0b432779
1 changed files with 11 additions and 0 deletions
|
@ -633,11 +633,22 @@ void(string id, vector pos, vector size, __inout vector scrollofs, float num_ser
|
||||||
sui_push_frame(listitem_pos, rowsize);
|
sui_push_frame(listitem_pos, rowsize);
|
||||||
sui_set_align([SUI_ALIGN_START, SUI_ALIGN_CENTER]);
|
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
|
// bg
|
||||||
vector bpos = [0, 0];
|
vector bpos = [0, 0];
|
||||||
vector bsize = [(rowsize.x / 8) * 5, rowsize.y];
|
vector bsize = [(rowsize.x / 8) * 5, rowsize.y];
|
||||||
sui_fill(bpos, rowsize, [0.25, 0.25, 0.25], 0.5, 0);
|
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
|
// name
|
||||||
sui_fill(bpos, bsize, [0.25, 0.25, 0.25], 0.5, 0);
|
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);
|
sui_text(bpos + [8, 0], MENU_TEXT_SMALL, str2ascii(gethostcachestring(gethostcacheindexforkey("name"), index)), MENU_TEXT_1, 1, 0);
|
||||||
|
|
Loading…
Reference in a new issue