me.configureXonoticListBox(me);
me.nItems = GameType_GetCount();
- if(SKINBOOL_GAMETYPELIST_ICON_BLUR)
- {
- for(int i = 0; i < GameType_GetTotalCount(); ++i)
+ if (SKINBOOL_GAMETYPELIST_ICON_BLUR) {
+ for (int i = 0; i < GameType_GetTotalCount(); ++i) {
draw_PreloadPictureWithFlags(GameType_GetIcon(i), PRECACHE_PIC_MIPMAP);
+ }
}
me.loadCvars(me);
{
Gametype t = MapInfo_CurrentGametype();
float i;
- for(i = 0; i < GameType_GetCount(); ++i)
- if(t == GameType_GetID(i))
+ for (i = 0; i < GameType_GetCount(); ++i) {
+ if (t == GameType_GetID(i)) {
break;
- if(i >= GameType_GetCount())
- {
- for(i = 0; i < GameType_GetCount(); ++i)
- if(t == MAPINFO_TYPE_DEATHMATCH)
+ }
+ }
+ if (i >= GameType_GetCount()) {
+ for (i = 0; i < GameType_GetCount(); ++i) {
+ if (t == MAPINFO_TYPE_DEATHMATCH) {
break;
- if(i >= GameType_GetCount())
+ }
+ }
+ if (i >= GameType_GetCount()) {
i = 0;
+ }
}
me.setSelected(me, i);
// do we need this: me.parent.gameTypeChangeNotify(me.parent); // to make sure
}
void XonoticGametypeList_draw(entity me)
{
- if(me.nItems != GameType_GetCount())
- {
+ if (me.nItems != GameType_GetCount()) {
me.nItems = GameType_GetCount();
me.setSelected(me, 0);
}
{
string s1, s2;
- if(isSelected)
+ if (isSelected) {
draw_Fill('0 0 0', '1 1 0', SKINCOLOR_LISTBOX_SELECTED, SKINALPHA_LISTBOX_SELECTED);
- else if(isFocused)
- {
+ } else if (isFocused) {
me.focusedItemAlpha = getFadedAlpha(me.focusedItemAlpha, SKINALPHA_LISTBOX_FOCUSED, SKINFADEALPHA_LISTBOX_FOCUSED);
draw_Fill('0 0 0', '1 1 0', SKINCOLOR_LISTBOX_FOCUSED, me.focusedItemAlpha);
}
draw_Picture(me.columnIconOrigin * eX, GameType_GetIcon(i), me.columnIconSize * eX + eY, '1 1 1', SKINALPHA_LISTBOX_SELECTED);
s1 = GameType_GetName(i);
- if(_MapInfo_GetTeamPlayBool(GameType_GetID(i)))
+ if (_MapInfo_GetTeamPlayBool(GameType_GetID(i))) {
s2 = _("teamplay");
- else
+ } else {
s2 = _("free for all");
+ }
vector save_fontscale = draw_fontscale;
float f = draw_CondensedFontFactor(strcat(s1, " ", s2), false, me.realFontSize, 1);
}
float XonoticGametypeList_keyDown(entity me, float scan, float ascii, float shift)
{
- if(scan == K_ENTER || scan == K_KP_ENTER)
- {
+ if (scan == K_ENTER || scan == K_KP_ENTER) {
m_play_click_sound(MENU_SOUND_EXECUTE);
me.parent.gameTypeSelectNotify(me.parent);
return 1;
}
void XonoticGametypeList_focusedItemChangeNotify(entity me)
{
- if(me.focusedItem >= 0)
+ if (me.focusedItem >= 0) {
setZonedTooltip(me, MapInfo_Type_Description(GameType_GetID(me.focusedItem)), string_null);
- else
+ } else {
clearTooltip(me);
+ }
}