mirror of
https://github.com/celisej567/mcpe.git
synced 2026-09-11 20:11:18 +03:00
* Add support for an options file on Windows.
This commit is contained in:
@@ -113,6 +113,11 @@ void Options::save()
|
||||
// stub
|
||||
}
|
||||
|
||||
std::string Options::getMessage(const Options::Option& option)
|
||||
{
|
||||
return "Options::getMessage - Not implemented";
|
||||
}
|
||||
|
||||
bool Options::readBool(const std::string& str)
|
||||
{
|
||||
std::string trimmed = Util::stringTrim(str);
|
||||
@@ -120,9 +125,22 @@ bool Options::readBool(const std::string& str)
|
||||
return true;
|
||||
if (trimmed == "false" || trimmed == "0")
|
||||
return false;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
#ifndef ORIGINAL_CODE
|
||||
int Options::readInt(const std::string& str)
|
||||
{
|
||||
int f;
|
||||
|
||||
if (!sscanf(str.c_str(), "%d", &f))
|
||||
f = 0;
|
||||
|
||||
return f;
|
||||
}
|
||||
#endif
|
||||
|
||||
void Options::update(const std::vector<std::string>& strings)
|
||||
{
|
||||
for (int i = 0; i<int(strings.size()); i += 2)
|
||||
@@ -137,5 +155,11 @@ void Options::update(const std::vector<std::string>& strings)
|
||||
m_bFancyGraphics = readBool(value);
|
||||
else if (key == "mp_server_visible_default")
|
||||
m_bServerVisibleDefault = readBool(value);
|
||||
#ifndef ORIGINAL_CODE
|
||||
else if (key == "gfx_smoothlighting")
|
||||
Minecraft::useAmbientOcclusion = field_18 = readBool(value);
|
||||
else if (key == "gfx_viewdistance")
|
||||
field_10 = readInt(value);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user