X-Git-Url: http://de.git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fmenu%2Fxonotic%2Fserverlist.qc;h=8bf70cc33307d06fe1ae5130649d602a8ef164fc;hb=e090603a32c8cba598f2c54e355cdb5b32b0d986;hp=7837693b4975c8d9d878023df8199f1c249de3e1;hpb=244f8292cf03247e90bf1a0c3fee1f491f6b93a0;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/menu/xonotic/serverlist.qc b/qcsrc/menu/xonotic/serverlist.qc index 7837693b4..8bf70cc33 100644 --- a/qcsrc/menu/xonotic/serverlist.qc +++ b/qcsrc/menu/xonotic/serverlist.qc @@ -1,9 +1,11 @@ -#ifdef INTERFACE +#ifndef SERVERLIST_H +#define SERVERLIST_H +#include "listbox.qc" CLASS(XonoticServerList, XonoticListBox) 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)) @@ -961,7 +963,7 @@ void XonoticServerList_doubleClickListBoxItem(entity me, int i, vector where) { ServerList_Connect_Click(NULL, me); } -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; @@ -1017,6 +1019,11 @@ void XonoticServerList_drawListBoxItem(entity me, int i, vector absSize, bool is 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, ":");