X-Git-Url: http://de.git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fmenu%2Fxonotic%2Fgametypelist.qc;h=a08e4dbbc5fa13dc4eb51680a1bb551a25780fc0;hb=f41f81f37e3ecf5a2d14f7bc7ffd7bbf09fff32e;hp=9ee031dc783e6196dca7df6592ba6ab5f63fb6ea;hpb=42e255d014f2c6a1871177ea511f630624cdfb57;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/menu/xonotic/gametypelist.qc b/qcsrc/menu/xonotic/gametypelist.qc index 9ee031dc7..a08e4dbbc 100644 --- a/qcsrc/menu/xonotic/gametypelist.qc +++ b/qcsrc/menu/xonotic/gametypelist.qc @@ -17,7 +17,7 @@ void XonoticGametypeList_configureXonoticGametypeList(entity me) if(SKINBOOL_GAMETYPELIST_ICON_BLUR) { - for(int i = 0; i < GameType_GetCount(); ++i) + for(int i = 0; i < GameType_GetTotalCount(); ++i) draw_PreloadPictureWithFlags(GameType_GetIcon(i), PRECACHE_PIC_MIPMAP); } @@ -30,8 +30,7 @@ void XonoticGametypeList_setSelected(entity me, float i) } void XonoticGametypeList_loadCvars(entity me) { - float t; - t = MapInfo_CurrentGametype(); + Gametype t = MapInfo_CurrentGametype(); float i; for(i = 0; i < GameType_GetCount(); ++i) if(t == GameType_GetID(i)) @@ -49,7 +48,7 @@ void XonoticGametypeList_loadCvars(entity me) } void XonoticGametypeList_saveCvars(entity me) { - int t = GameType_GetID(me.selectedItem); + Gametype t = GameType_GetID(me.selectedItem); if (t == MapInfo_CurrentGametype()) { return; } @@ -59,6 +58,15 @@ void XonoticGametypeList_saveCvars(entity me) owner.gameTypeChangeNotify(owner); } } +void XonoticGametypeList_draw(entity me) +{ + if(me.nItems != GameType_GetCount()) + { + me.nItems = GameType_GetCount(); + me.setSelected(me, 0); + } + SUPER(XonoticGametypeList).draw(me); +} void XonoticGametypeList_drawListBoxItem(entity me, int i, vector absSize, bool isSelected, bool isFocused) { string s1, s2;