From 9068daf471b52559acd6aa58eeaa928899b9f0fa Mon Sep 17 00:00:00 2001 From: terencehill Date: Mon, 25 Jul 2016 19:22:50 +0200 Subject: [PATCH] Properly show / hide Race and CTS from the game type list when toggling developer cvar on / off --- qcsrc/menu/xonotic/gametypelist.qc | 9 +++++++++ qcsrc/menu/xonotic/gametypelist.qh | 1 + 2 files changed, 10 insertions(+) diff --git a/qcsrc/menu/xonotic/gametypelist.qc b/qcsrc/menu/xonotic/gametypelist.qc index 9ee031dc7..193f83368 100644 --- a/qcsrc/menu/xonotic/gametypelist.qc +++ b/qcsrc/menu/xonotic/gametypelist.qc @@ -59,6 +59,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; diff --git a/qcsrc/menu/xonotic/gametypelist.qh b/qcsrc/menu/xonotic/gametypelist.qh index 95eceaa09..9e17c5c85 100644 --- a/qcsrc/menu/xonotic/gametypelist.qh +++ b/qcsrc/menu/xonotic/gametypelist.qh @@ -4,6 +4,7 @@ CLASS(XonoticGametypeList, XonoticListBox) METHOD(XonoticGametypeList, configureXonoticGametypeList, void(entity)); ATTRIB(XonoticGametypeList, rowsPerItem, float, 2) + METHOD(XonoticGametypeList, draw, void(entity)); METHOD(XonoticGametypeList, drawListBoxItem, void(entity, int, vector, bool, bool)); METHOD(XonoticGametypeList, resizeNotify, void(entity, vector, vector, vector, vector)); METHOD(XonoticGametypeList, setSelected, void(entity, float)); -- 2.39.2