mirror of
https://github.com/nzp-team/quakec.git
synced 2025-03-04 00:20:48 +00:00
MENU: m_menu.qc: improve styling on ServerList
This commit is contained in:
parent
5de586ba7e
commit
854530bf8a
1 changed files with 9 additions and 4 deletions
|
@ -647,18 +647,18 @@ void(string id, vector pos, vector size, __inout vector scrollofs, float num_ser
|
||||||
// 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.1, 0.1], 0.5, 0);
|
||||||
|
|
||||||
// hovered bg
|
// hovered bg
|
||||||
if (sui_is_hovered(listitem_id))
|
if (sui_is_hovered(listitem_id))
|
||||||
sui_fill(bpos, rowsize, [0.25, 0.25, 0.25], 0.5, 0);
|
sui_fill(bpos, rowsize, [0.25, 0.1, 0.1], 0.5, 0);
|
||||||
|
|
||||||
// do it
|
// do it
|
||||||
if (sui_is_clicked(listitem_id))
|
if (sui_is_clicked(listitem_id))
|
||||||
localcmd("connect ", gethostcachestring(gethostcacheindexforkey("cname"), index), "\n");
|
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.1, 0.1], 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);
|
||||||
|
|
||||||
// map
|
// map
|
||||||
|
@ -672,9 +672,14 @@ void(string id, vector pos, vector size, __inout vector scrollofs, float num_ser
|
||||||
stof(gethostcachestring(gethostcacheindexforkey("numhumans"), index)),
|
stof(gethostcachestring(gethostcacheindexforkey("numhumans"), index)),
|
||||||
stof(gethostcachestring(gethostcacheindexforkey("maxplayers"), index))
|
stof(gethostcachestring(gethostcacheindexforkey("maxplayers"), index))
|
||||||
);
|
);
|
||||||
sui_fill(bpos, bsize, [0.25, 0.25, 0.25], 0.5, 0);
|
sui_fill(bpos, bsize, [0.25, 0.1, 0.1], 0.5, 0);
|
||||||
sui_text(bpos + [8, 0], MENU_TEXT_SMALL, s, MENU_TEXT_1, 1, 0);
|
sui_text(bpos + [8, 0], MENU_TEXT_SMALL, s, MENU_TEXT_1, 1, 0);
|
||||||
|
|
||||||
|
// hovered border
|
||||||
|
bpos = [0, 0];
|
||||||
|
if (sui_is_hovered(listitem_id))
|
||||||
|
sui_border_box(bpos, rowsize, 1, [0.4, 0.4, 0], 1, 0);
|
||||||
|
|
||||||
sui_pop_frame();
|
sui_pop_frame();
|
||||||
}
|
}
|
||||||
sui_list_view_end();
|
sui_list_view_end();
|
||||||
|
|
Loading…
Reference in a new issue