else
me.previewImage.src = me.currentMapPreviewImage;
- for(i = 0; i < GameType_GetCount(); ++i)
+ for(i = 0; i < GameType_GetTotalCount(); ++i)
{
entity e;
e = me.(typeLabels[i]);
me.TR(me);
me.TD(me, 1, w, e = makeXonoticTextLabel(0, _("Game types:")));
- n = ceil(GameType_GetCount() / (me.rows - 6));
+ n = ceil(GameType_GetTotalCount() / (me.rows - 6));
wgt = (w - 0.2) / n;
- for(i = 0; i < GameType_GetCount(); ++i)
+ for(i = 0; i < GameType_GetTotalCount(); ++i)
{
if(mod(i, n) == 0)
{
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);
}
GAMETYPE(MAPINFO_TYPE_NEXBALL) \
GAMETYPE(MAPINFO_TYPE_ONSLAUGHT) \
GAMETYPE(MAPINFO_TYPE_ASSAULT) \
- if (cvar("developer")) GAMETYPE(MAPINFO_TYPE_RACE) \
- if (cvar("developer")) GAMETYPE(MAPINFO_TYPE_CTS) \
/* GAMETYPE(MAPINFO_TYPE_INVASION) */ \
/**/
+// hidden gametypes come last so indexing always works correctly
+#define HIDDEN_GAMETYPES \
+ GAMETYPE(MAPINFO_TYPE_RACE) \
+ GAMETYPE(MAPINFO_TYPE_CTS) \
+ /**/
+
Gametype GameType_GetID(int cnt)
{
int i = 0;
#define GAMETYPE(it) { if (i++ == cnt) return it; }
GAMETYPES
+ HIDDEN_GAMETYPES
#undef GAMETYPE
return NULL;
}
#define GAMETYPE(id) ++i;
GAMETYPES
#undef GAMETYPE
+ #define GAMETYPE(it) if (cvar("developer")) ++i;
+ HIDDEN_GAMETYPES
+ #undef GAMETYPE
+ return i;
+}
+
+int GameType_GetTotalCount()
+{
+ int i = 0;
+ #define GAMETYPE(id) ++i;
+ GAMETYPES
+ HIDDEN_GAMETYPES
+ #undef GAMETYPE
return i;
}
string GameType_GetIcon(int cnt);
//string GameType_GetTeams(float cnt);
int GameType_GetCount();
+int GameType_GetTotalCount();
void dialog_hudpanel_common_notoggle(entity me, string panelname);
#define DIALOG_HUDPANEL_COMMON_NOTOGGLE() \