parent
7d3e3c91e8
commit
32fb105bca
|
@ -279,7 +279,10 @@ void CModManager::LoadModData(Mod& mod)
|
||||||
auto major = StrUtils::ToString(line->GetParam("major")->AsInt());
|
auto major = StrUtils::ToString(line->GetParam("major")->AsInt());
|
||||||
auto minor = StrUtils::ToString(line->GetParam("minor")->AsInt());
|
auto minor = StrUtils::ToString(line->GetParam("minor")->AsInt());
|
||||||
auto patch = StrUtils::ToString(line->GetParam("patch")->AsInt());
|
auto patch = StrUtils::ToString(line->GetParam("patch")->AsInt());
|
||||||
data.version = boost::algorithm::join(std::vector<std::string>{ major, minor, patch }, ".");
|
|
||||||
|
std::ostringstream stream;
|
||||||
|
stream << major << "." << minor << "." << patch;
|
||||||
|
data.version = stream.str();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -26,7 +26,7 @@
|
||||||
#include "level/robotmain.h"
|
#include "level/robotmain.h"
|
||||||
|
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <boost/algorithm/string/join.hpp>
|
#include <numeric>
|
||||||
|
|
||||||
struct ActivePause
|
struct ActivePause
|
||||||
{
|
{
|
||||||
|
@ -45,13 +45,19 @@ struct ActivePause
|
||||||
static std::string GetPauseName(PauseType type)
|
static std::string GetPauseName(PauseType type)
|
||||||
{
|
{
|
||||||
std::vector<std::string> x;
|
std::vector<std::string> x;
|
||||||
|
|
||||||
if ((type & PAUSE_ENGINE) != 0) x.push_back("engine");
|
if ((type & PAUSE_ENGINE) != 0) x.push_back("engine");
|
||||||
if ((type & PAUSE_HIDE_SHORTCUTS) != 0) x.push_back("hide_shortcuts");
|
if ((type & PAUSE_HIDE_SHORTCUTS) != 0) x.push_back("hide_shortcuts");
|
||||||
if ((type & PAUSE_PHOTO) != 0) x.push_back("photo");
|
if ((type & PAUSE_PHOTO) != 0) x.push_back("photo");
|
||||||
if ((type & PAUSE_OBJECT_UPDATES) != 0) x.push_back("object_updates");
|
if ((type & PAUSE_OBJECT_UPDATES) != 0) x.push_back("object_updates");
|
||||||
if ((type & PAUSE_MUTE_SOUND) != 0) x.push_back("mute_sound");
|
if ((type & PAUSE_MUTE_SOUND) != 0) x.push_back("mute_sound");
|
||||||
if ((type & PAUSE_CAMERA) != 0) x.push_back("camera");
|
if ((type & PAUSE_CAMERA) != 0) x.push_back("camera");
|
||||||
return boost::algorithm::join(x, "|");
|
|
||||||
|
return std::accumulate(x.cbegin(), x.cend(), std::string(),
|
||||||
|
[](auto& acc, auto& value)
|
||||||
|
{
|
||||||
|
return acc.empty() ? value : acc + "|" + value;
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
CPauseManager::CPauseManager()
|
CPauseManager::CPauseManager()
|
||||||
|
|
Loading…
Reference in New Issue