X-Git-Url: http://de.git.xonotic.org/?p=xonotic%2Fxonotic-data.pk3dir.git;a=blobdiff_plain;f=qcsrc%2Fmenu%2Fxonotic%2Fgametypelist.qc;h=eac075a9c041f16f78b1f139ff505c245e5c5af5;hp=feb1d89b133d2b4e040db7bd42d2828c500fc89f;hb=20387ff9f8cef7536362de05c76cc0062416a64c;hpb=77f03e6ce033bef39ac19e0e7cb6e606ffcb26db diff --git a/qcsrc/menu/xonotic/gametypelist.qc b/qcsrc/menu/xonotic/gametypelist.qc index feb1d89b13..eac075a9c0 100644 --- a/qcsrc/menu/xonotic/gametypelist.qc +++ b/qcsrc/menu/xonotic/gametypelist.qc @@ -2,7 +2,7 @@ CLASS(XonoticGametypeList) EXTENDS(XonoticListBox) METHOD(XonoticGametypeList, configureXonoticGametypeList, void(entity)) ATTRIB(XonoticGametypeList, rowsPerItem, float, 2) - METHOD(XonoticGametypeList, drawListBoxItem, void(entity, float, vector, float)) + METHOD(XonoticGametypeList, drawListBoxItem, void(entity, int, vector, bool, float)) METHOD(XonoticGametypeList, resizeNotify, void(entity, vector, vector, vector, vector)) METHOD(XonoticGametypeList, setSelected, void(entity, float)) METHOD(XonoticGametypeList, loadCvars, void(entity)) @@ -31,12 +31,11 @@ entity makeXonoticGametypeList(void) } void XonoticGametypeList_configureXonoticGametypeList(entity me) { - float i; me.configureXonoticListBox(me); me.nItems = GameType_GetCount(); // we want the pics mipmapped - for(i = 0; i < GameType_GetCount(); ++i) + for(int i = 0; i < GameType_GetCount(); ++i) draw_PreloadPictureWithFlags(GameType_GetIcon(i), PRECACHE_PIC_MIPMAP); me.loadCvars(me); @@ -67,19 +66,24 @@ void XonoticGametypeList_loadCvars(entity me) } void XonoticGametypeList_saveCvars(entity me) { - float t; - t = GameType_GetID(me.selectedItem); - if(t == MapInfo_CurrentGametype()) + int t = GameType_GetID(me.selectedItem); + if (t == MapInfo_CurrentGametype()) { return; + } MapInfo_SwitchGameType(t); - me.parent.gameTypeChangeNotify(me.parent); + entity owner = me.parent; + if (owner) { // not set immediately + owner.gameTypeChangeNotify(owner); + } } -void XonoticGametypeList_drawListBoxItem(entity me, float i, vector absSize, float isSelected) +void XonoticGametypeList_drawListBoxItem(entity me, int i, vector absSize, bool isSelected, float highlightedTime) { string s1, s2; if(isSelected) draw_Fill('0 0 0', '1 1 0', SKINCOLOR_LISTBOX_SELECTED, SKINALPHA_LISTBOX_SELECTED); + else if(highlightedTime) + draw_Fill('0 0 0', '1 1 0', SKINCOLOR_LISTBOX_SELECTED, getHighlightAlpha(SKINALPHA_LISTBOX_SELECTED * 0.1, highlightedTime)); draw_Picture(me.columnIconOrigin * eX, GameType_GetIcon(i), me.columnIconSize * eX + eY, '1 1 1', SKINALPHA_LISTBOX_SELECTED); s1 = GameType_GetName(i);