return r;
}
-void MapInfo_SwitchGameType(float t)
+void MapInfo_SwitchGameType(int t)
{
- entity e;
- for(e = MapInfo_Type_first; e; e = e.enemy)
+ for (entity e = MapInfo_Type_first; e; e = e.enemy) {
cvar_set(e.netname, (t == e.items) ? "1" : "0");
+ }
}
void MapInfo_LoadMap(string s, float reinit)
string MapInfo_Type_Description(float t);
string MapInfo_Type_ToString(float t);
string MapInfo_Type_ToText(float t);
-void MapInfo_SwitchGameType(float t);
+void MapInfo_SwitchGameType(int t);
// to be called from worldspawn to set up cvars
void MapInfo_LoadMapSettings(string s);
}
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);
}
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);
}
//GAMETYPE(MAPINFO_TYPE_INVASION) \
/* nothing */
-float GameType_GetID(float cnt)
+int GameType_GetID(int cnt)
{
- float i;
- i = 0;
+ int i = 0;
- #define GAMETYPE(id) { if(i++ == cnt) return id; }
+ #define GAMETYPE(id) { if (i++ == cnt) return id; }
GAMETYPES
#undef GAMETYPE
return 0;
}
-float GameType_GetCount()
+int GameType_GetCount()
{
- float i;
- i = 0;
+ int i = 0;
#define GAMETYPE(id) ++i;
GAMETYPES
return i;
}
-string GameType_GetName(float cnt)
+string GameType_GetName(int cnt)
{
- float i = GameType_GetID(cnt);
+ int i = GameType_GetID(cnt);
if(i)
return MapInfo_Type_ToText(i);
return "";
}
-string GameType_GetIcon(float cnt)
+string GameType_GetIcon(int cnt)
{
- float i = GameType_GetID(cnt);
+ int i = GameType_GetID(cnt);
if(i)
return strcat("gametype_", MapInfo_Type_ToString(i));
// game type list box stuff (does not NEED to contain all game types, other
// types stay available via console)
-float GameType_GetID(float cnt);
-string GameType_GetName(float cnt);
-string GameType_GetIcon(float cnt);
+int GameType_GetID(int cnt);
+string GameType_GetName(int cnt);
+string GameType_GetIcon(int cnt);
//string GameType_GetTeams(float cnt);
-float GameType_GetCount();
+int GameType_GetCount();
void dialog_hudpanel_common_notoggle(entity me, string panelname);
#define DIALOG_HUDPANEL_COMMON_NOTOGGLE() \