diff --git a/src/xrGame/UIGameCustom.cpp b/src/xrGame/UIGameCustom.cpp index de92b3a4d22..96a5bf8f258 100644 --- a/src/xrGame/UIGameCustom.cpp +++ b/src/xrGame/UIGameCustom.cpp @@ -336,7 +336,7 @@ void CMapListHelper::LoadMapInfo(const char* cfgName, const xr_string& levelName lastItem.m_game_type_id = ParseStringToGameType(gameType.c_str()); suitableLevels = &m_storage.back(); } - SGameTypeMaps::SMapItm levelDesc; + MPLevelDesc levelDesc; levelDesc.map_name = shLevelName; levelDesc.map_ver = shLevelVer; auto& levelNames = suitableLevels->m_map_names; @@ -365,7 +365,7 @@ void CMapListHelper::Load() m_weathers.reserve(weatherCfg.Data.size()); for (CInifile::Item& weatherDesc : weatherCfg.Data) { - SGameWeathers gw; + MPWeatherDesc gw; gw.Name = weatherDesc.first; gw.StartTime = weatherDesc.second; m_weathers.push_back(gw); @@ -435,7 +435,7 @@ const SGameTypeMaps& CMapListHelper::GetMapListFor(const EGameIDs gameId) return m_storage[0]; } -const xr_vector& CMapListHelper::GetGameWeathers() +const xr_vector& CMapListHelper::GetGameWeathers() { if (m_weathers.size() == 0) Load(); diff --git a/src/xrGame/UIGameCustom.h b/src/xrGame/UIGameCustom.h index 5cc11bbd91a..66f72e99ea4 100644 --- a/src/xrGame/UIGameCustom.h +++ b/src/xrGame/UIGameCustom.h @@ -36,21 +36,21 @@ struct StaticDrawableWrapper : public IPureDestroyableObject void SetText(const char* text); }; -struct SGameTypeMaps +struct MPLevelDesc { - struct SMapItm - { - shared_str map_name; - shared_str map_ver; - bool operator == (const SMapItm& rhs) { return map_name == rhs.map_name && map_ver == rhs.map_ver; } - }; + shared_str map_name; + shared_str map_ver; + bool operator == (const MPLevelDesc& rhs) { return map_name == rhs.map_name && map_ver == rhs.map_ver; } +}; +struct SGameTypeMaps +{ shared_str m_game_type_name; EGameIDs m_game_type_id; - xr_vector m_map_names; + xr_vector m_map_names; }; -struct SGameWeathers +struct MPWeatherDesc { shared_str Name; shared_str StartTime; @@ -60,12 +60,12 @@ class CMapListHelper { private: xr_vector m_storage; - xr_vector m_weathers; + xr_vector m_weathers; public: const SGameTypeMaps& GetMapListFor(const shared_str& gameType); const SGameTypeMaps& GetMapListFor(const EGameIDs gameId); - const xr_vector& GetGameWeathers(); + const xr_vector& GetGameWeathers(); private: void Load(); diff --git a/src/xrGame/console_commands_mp.cpp b/src/xrGame/console_commands_mp.cpp index 83c7eb4bd1f..9d6d54b9083 100644 --- a/src/xrGame/console_commands_mp.cpp +++ b/src/xrGame/console_commands_mp.cpp @@ -1342,7 +1342,7 @@ class CCC_ChangeLevelGameType : public IConsole_Command { bool bMapFound = false; for(u32 i=0; iGetSelectedItem(); u32 _idx = (u32)(__int64)(itm->GetData()); - const SGameTypeMaps::SMapItm& M = GetMapNameInt(GetCurGameType(), _idx); + const MPLevelDesc& M = GetMapNameInt(GetCurGameType(), _idx); map_name += M.map_name.c_str(); xr_string full_name = map_name + ".dds"; @@ -203,7 +203,7 @@ const char* CUIMapList::GetCommandLine(LPCSTR player_name){ return NULL; u32 _idx = (u32)(__int64)(itm->GetData()); - const SGameTypeMaps::SMapItm& M = GetMapNameInt (GetCurGameType(), _idx); + const MPLevelDesc& M = GetMapNameInt(GetCurGameType(), _idx); m_command.clear(); m_command = "start server("; @@ -248,7 +248,7 @@ void CUIMapList::LoadMapList() { const auto& weathers = gMapListHelper.GetGameWeathers(); u32 cnt = 0; - for (const SGameWeathers& weather : weathers) + for (const MPWeatherDesc& weather : weathers) AddWeather(weather.Name, weather.StartTime, cnt++); if (weathers.size() > 0) m_pWeatherSelector->SetItemIDX(0); @@ -275,7 +275,7 @@ void CUIMapList::SaveMapList() { CUIListBoxItem* itm = m_pList2->GetItemByIDX(idx); u32 _idx = (u32)(__int64)(itm->GetData()); - const SGameTypeMaps::SMapItm& M = GetMapNameInt(GetCurGameType(), _idx); + const MPLevelDesc& M = GetMapNameInt(GetCurGameType(), _idx); xr_sprintf (map_name, "sv_addmap %s/ver=%s", M.map_name.c_str(), M.map_ver.c_str() ); pW->w_string (map_name); @@ -426,7 +426,7 @@ bool CUIMapList::IsEmpty() return 0 == m_pList2->GetSize(); } -const SGameTypeMaps::SMapItm& CUIMapList::GetMapNameInt(EGameIDs _type, u32 idx) +const MPLevelDesc& CUIMapList::GetMapNameInt(EGameIDs _type, u32 idx) { const SGameTypeMaps& M = gMapListHelper.GetMapListFor(_type); R_ASSERT (M.m_map_names.size()>idx); diff --git a/src/xrGame/ui/UIMapList.h b/src/xrGame/ui/UIMapList.h index 21b2a534344..1c38b8037c3 100644 --- a/src/xrGame/ui/UIMapList.h +++ b/src/xrGame/ui/UIMapList.h @@ -39,7 +39,7 @@ class CUIMapList : public CUIWindow { void StartDedicatedServer(); void ClearList(); bool IsEmpty(); - const SGameTypeMaps::SMapItm& GetMapNameInt(EGameIDs _type, u32 idx); + const MPLevelDesc& GetMapNameInt(EGameIDs _type, u32 idx); private: CUIListBoxItem* GetMapItem_fromList1(shared_str const& map_name); @@ -69,7 +69,7 @@ class CUIMapList : public CUIWindow { // CUISpinText* m_pModeSelector; CUIStatic* m_pMapPic; CUIMapInfo* m_pMapInfo; - + // XXX nitrocaster: use MPWeatherDesc struct Sw{ shared_str weather_name; shared_str weather_time;