Skip to content

Commit

Permalink
Rename weatherItems -> weathers, gameTypeItems -> gameTypes.
Browse files Browse the repository at this point in the history
  • Loading branch information
Pavel Kovalenko committed Oct 3, 2014
1 parent e1f1afe commit 6f8bb70
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
18 changes: 9 additions & 9 deletions src/xrGame/ui/ChangeWeatherDialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -94,23 +94,23 @@ void ChangeWeatherDialog::InitChangeWeather(CUIXml& xmlDoc)
CUIXmlInit::Init3tButton(xmlDoc, "change_weather:btn_cancel", 0, CancelButton);
auto& gameWeathers = gMapListHelper.GetGameWeathers();
Initialize(gameWeathers.size());
weatherItems.resize(gameWeathers.size());
weathers.resize(gameWeathers.size());
string256 path;
for (u32 i = 0; i < weatherItems.size(); i++)
for (u32 i = 0; i < weathers.size(); i++)
{
xr_sprintf(path, "change_weather:btn_%s", gameWeathers[i].m_weather_name.c_str());
CUIXmlInit::Init3tButton(xmlDoc, path, 0, GetButton(i).Button);
xr_sprintf(path, "change_weather:txt_%s", gameWeathers[i].m_weather_name.c_str());
CUIXmlInit::InitTextWnd(xmlDoc, path, 0, GetButton(i).Text);
weatherItems[i].Name = gameWeathers[i].m_weather_name;
weatherItems[i].Time = gameWeathers[i].m_start_time;
weathers[i].Name = gameWeathers[i].m_weather_name;
weathers[i].Time = gameWeathers[i].m_start_time;
}
}

void ChangeWeatherDialog::OnButtonClick(int i)
{
string1024 command;
xr_sprintf(command, "cl_votestart changeweather %s %s", *weatherItems[i].Name, *weatherItems[i].Time);
xr_sprintf(command, "cl_votestart changeweather %s %s", *weathers[i].Name, *weathers[i].Time);
Console->Execute(command);
HideDialog();
}
Expand All @@ -124,22 +124,22 @@ void ChangeGameTypeDialog::InitChangeGameType(CUIXml& xmlDoc)
// XXX nitrocaster: get it from somewhere
const int gameTypeCount = 4;
Initialize(gameTypeCount);
gameTypeItems.resize(gameTypeCount);
gameTypes.resize(gameTypeCount);
string256 path;
for (u32 i = 0; i < gameTypeItems.size(); i++)
for (u32 i = 0; i < gameTypes.size(); i++)
{
xr_sprintf(path, "change_gametype:btn_%d", i+1);
CUIXmlInit::Init3tButton(xmlDoc, path, 0, GetButton(i).Button);
xr_sprintf(path, "change_gametype:txt_%d", i+1);
CUIXmlInit::InitTextWnd(xmlDoc, path, 0, GetButton(i).Text);
gameTypeItems[i] = xmlDoc.ReadAttrib(path, 0, "id");
gameTypes[i] = xmlDoc.ReadAttrib(path, 0, "id");
}
}

void ChangeGameTypeDialog::OnButtonClick(int i)
{
string1024 command;
xr_sprintf(command, "cl_votestart changegametype %s", gameTypeItems[i].c_str());
xr_sprintf(command, "cl_votestart changegametype %s", gameTypes[i].c_str());
Console->Execute(command);
HideDialog();
}
4 changes: 2 additions & 2 deletions src/xrGame/ui/ChangeWeatherDialog.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ class ChangeWeatherDialog : public ButtonListDialog
shared_str Time;
};

xr_vector<WeatherDesc> weatherItems;
xr_vector<WeatherDesc> weathers;

public:
void InitChangeWeather(CUIXml& xmlDoc);
Expand All @@ -64,7 +64,7 @@ class ChangeWeatherDialog : public ButtonListDialog
class ChangeGameTypeDialog : public ButtonListDialog
{
private:
xr_vector<shared_str> gameTypeItems;
xr_vector<shared_str> gameTypes;

public:
void InitChangeGameType(CUIXml& xmlDoc);
Expand Down

0 comments on commit 6f8bb70

Please sign in to comment.