From: terencehill Date: Sat, 27 Dec 2014 21:30:39 +0000 (+0100) Subject: Simplify sliderTeams update code X-Git-Tag: xonotic-v0.8.0~3^2 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=e15f8b4c745e7218dca6f115d27a640dfba4c9aa;p=xonotic%2Fxonotic-data.pk3dir.git Simplify sliderTeams update code --- diff --git a/qcsrc/menu/xonotic/dialog_multiplayer_create.c b/qcsrc/menu/xonotic/dialog_multiplayer_create.c index 1e06d98fc..bbffb5276 100644 --- a/qcsrc/menu/xonotic/dialog_multiplayer_create.c +++ b/qcsrc/menu/xonotic/dialog_multiplayer_create.c @@ -190,18 +190,17 @@ void XonoticServerCreateTab_gameTypeChangeNotify(entity me) default: GameType_ConfigureSliders(e, l, _("Frag limit:"), 5, 100, 5, "fraglimit_override"); break; } - float x = FALSE; + string x = string_null; e = me.sliderTeams; switch(gt) { - case MAPINFO_TYPE_CA: x = TRUE; e.configureXonoticTextSlider(e, "g_ca_teams_override"); break; - case MAPINFO_TYPE_DOMINATION: x = TRUE; e.configureXonoticTextSlider(e, "g_domination_teams_override"); break; - case MAPINFO_TYPE_FREEZETAG: x = TRUE; e.configureXonoticTextSlider(e, "g_freezetag_teams_override"); break; - case MAPINFO_TYPE_KEYHUNT: x = TRUE; e.configureXonoticTextSlider(e, "g_keyhunt_teams_override"); break; - case MAPINFO_TYPE_TEAM_DEATHMATCH: x = TRUE; e.configureXonoticTextSlider(e, "g_tdm_teams_override"); break; - - default: x = FALSE; e.configureXonoticTextSlider(e, string_null); break; + case MAPINFO_TYPE_CA: x = "g_ca_teams_override"; break; + case MAPINFO_TYPE_DOMINATION: x = "g_domination_teams_override"; break; + case MAPINFO_TYPE_FREEZETAG: x = "g_freezetag_teams_override"; break; + case MAPINFO_TYPE_KEYHUNT: x = "g_keyhunt_teams_override"; break; + case MAPINFO_TYPE_TEAM_DEATHMATCH: x = "g_tdm_teams_override"; break; } + e.configureXonoticTextSlider(e, x); e.configureXonoticTextSliderValues(e); if(!x) e.value = 0;