METHOD(XonoticServerList, configureXonoticServerList, void(entity))
ATTRIB(XonoticServerList, rowsPerItem, float, 1)
METHOD(XonoticServerList, draw, void(entity))
METHOD(XonoticServerList, configureXonoticServerList, void(entity))
ATTRIB(XonoticServerList, rowsPerItem, float, 1)
METHOD(XonoticServerList, draw, void(entity))
- METHOD(XonoticServerList, drawListBoxItem, void(entity, float, vector, float))
+ METHOD(XonoticServerList, drawListBoxItem, void(entity, int, vector, bool, bool))
METHOD(XonoticServerList, doubleClickListBoxItem, void(entity, float, vector))
METHOD(XonoticServerList, resizeNotify, void(entity, vector, vector, vector, vector))
METHOD(XonoticServerList, keyDown, float(entity, float, float, float))
METHOD(XonoticServerList, doubleClickListBoxItem, void(entity, float, vector))
METHOD(XonoticServerList, resizeNotify, void(entity, vector, vector, vector, vector))
METHOD(XonoticServerList, keyDown, float(entity, float, float, float))
ATTRIB(XonoticServerList, columnTypeSize, float, 0)
ATTRIB(XonoticServerList, columnPlayersOrigin, float, 0)
ATTRIB(XonoticServerList, columnPlayersSize, float, 0)
ATTRIB(XonoticServerList, columnTypeSize, float, 0)
ATTRIB(XonoticServerList, columnPlayersOrigin, float, 0)
ATTRIB(XonoticServerList, columnPlayersSize, float, 0)
ATTRIB(XonoticServerList, selectedServer, string, string_null) // to restore selected server when needed
METHOD(XonoticServerList, setSelected, void(entity, float))
ATTRIB(XonoticServerList, selectedServer, string, string_null) // to restore selected server when needed
METHOD(XonoticServerList, setSelected, void(entity, float))
//int save = me.selectedItem;
SUPER(XonoticServerList).setSelected(me, i);
/*
//int save = me.selectedItem;
SUPER(XonoticServerList).setSelected(me, i);
/*
me.infoButton.disabled = ((me.nItems == 0) || !owned);
me.favoriteButton.disabled = ((me.nItems == 0) && (me.ipAddressBox.text == ""));
me.infoButton.disabled = ((me.nItems == 0) || !owned);
me.favoriteButton.disabled = ((me.nItems == 0) && (me.ipAddressBox.text == ""));
+ if(me.lockedSelectedItem)
+ {
+ if(me.nItems > 0)
+ {
+ if(gethostcachestring(SLIST_FIELD_CNAME, me.selectedItem) != me.selectedServer)
+ {
+ if(me.selectedServer)
+ strunzone(me.selectedServer);
+ me.selectedServer = strzone(gethostcachestring(SLIST_FIELD_CNAME, me.selectedItem));
+ }
+ found = true;
+ }
+ }
+ else if(me.selectedServer)
{
for(i = 0; i < me.nItems; ++i)
{
if(gethostcachestring(SLIST_FIELD_CNAME, i) == me.selectedServer)
{
{
for(i = 0; i < me.nItems; ++i)
{
if(gethostcachestring(SLIST_FIELD_CNAME, i) == me.selectedServer)
{
if(me.selectedServer)
strunzone(me.selectedServer);
me.selectedServer = strzone(gethostcachestring(SLIST_FIELD_CNAME, me.selectedItem));
if(me.selectedServer)
strunzone(me.selectedServer);
me.selectedServer = strzone(gethostcachestring(SLIST_FIELD_CNAME, me.selectedItem));
-void XonoticServerList_drawListBoxItem(entity me, int i, vector absSize, bool isSelected)
+void XonoticServerList_drawListBoxItem(entity me, int i, vector absSize, bool isSelected, bool isFocused)
{
// layout: Ping, Server name, Map name, NP, TP, MP
float p;
{
// layout: Ping, Server name, Map name, NP, TP, MP
float p;
if(isSelected)
draw_Fill('0 0 0', '1 1 0', SKINCOLOR_LISTBOX_SELECTED, SKINALPHA_LISTBOX_SELECTED);
if(isSelected)
draw_Fill('0 0 0', '1 1 0', SKINCOLOR_LISTBOX_SELECTED, SKINALPHA_LISTBOX_SELECTED);
+ else if(isFocused)
+ {
+ me.focusedItemAlpha = getFadedAlpha(me.focusedItemAlpha, SKINALPHA_LISTBOX_FOCUSED, SKINFADEALPHA_LISTBOX_FOCUSED);
+ draw_Fill('0 0 0', '1 1 0', SKINCOLOR_LISTBOX_FOCUSED, me.focusedItemAlpha);
+ }
s = gethostcachestring(SLIST_FIELD_QCSTATUS, i);
m = tokenizebyseparator(s, ":");
s = gethostcachestring(SLIST_FIELD_QCSTATUS, i);
m = tokenizebyseparator(s, ":");
- draw_PreloadPictureWithFlags(n = strcat(SKINGFX_SERVERLIST_ICON, "_ipv6"), 0); // PRECACHE_PIC_MIPMAP
+ draw_Picture(iconPos, "icon_ipv6", iconSize, '1 1 1', 1);
- draw_PreloadPictureWithFlags(n = strcat(SKINGFX_SERVERLIST_ICON, "_ipv4"), 0); // PRECACHE_PIC_MIPMAP
- if(n)
- draw_Picture(iconPos, n, iconSize, '1 1 1', 1);
- iconPos.x += iconSize.x;
+ draw_Picture(iconPos, "icon_ipv4", iconSize, '1 1 1', 1);
- {
- draw_PreloadPictureWithFlags(n = strcat(SKINGFX_SERVERLIST_ICON, "_aeslevel", ftos(q)), 0); // PRECACHE_PIC_MIPMAP
- draw_Picture(iconPos, n, iconSize, '1 1 1', 1);
- }
+ draw_Picture(iconPos, strcat("icon_aeslevel", ftos(q)), iconSize, '1 1 1', 1);
+
- {
- draw_PreloadPictureWithFlags(n = strcat(SKINGFX_SERVERLIST_ICON, "_pure1"), PRECACHE_PIC_MIPMAP);
- draw_Picture(iconPos, n, iconSize, '1 1 1', 1);
- }
+ draw_Picture(iconPos, "icon_pure1", iconSize, '1 1 1', 1);
- draw_PreloadPictureWithFlags(n = strcat(SKINGFX_SERVERLIST_ICON, "_mod_", modname), PRECACHE_PIC_MIPMAP);
- if(draw_PictureSize(n) == '0 0 0')
- draw_PreloadPictureWithFlags(n = strcat(SKINGFX_SERVERLIST_ICON, "_mod_"), PRECACHE_PIC_MIPMAP);
+ string icon = strcat("icon_mod_", modname);
+ if(draw_PictureSize(icon) == '0 0 0')
+ icon = "icon_mod_";
+
- draw_Picture(iconPos, n, iconSize, '1 1 1', 1);
+ draw_Picture(iconPos, icon, iconSize, '1 1 1', 1);
- draw_Picture(iconPos, n, iconSize, '1 1 1', SKINALPHA_SERVERLIST_ICON_NONPURE);
+ draw_Picture(iconPos, icon, iconSize, '1 1 1', SKINALPHA_SERVERLIST_ICON_NONPURE);
- {
- draw_PreloadPictureWithFlags(n = strcat(SKINGFX_SERVERLIST_ICON, "_stats1"), 0); // PRECACHE_PIC_MIPMAP
- draw_Picture(iconPos, n, iconSize, '1 1 1', 1);
- }
- iconPos.x += iconSize.x;
+ draw_Picture(iconPos, "icon_stats1", iconSize, '1 1 1', 1);