summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/client.cpp27
-rw-r--r--src/configuration.cpp5
-rw-r--r--src/configuration.h4
-rw-r--r--src/defaults.cpp6
-rw-r--r--src/gui/setup_video.cpp10
-rw-r--r--src/gui/widgets/chattab.cpp2
-rw-r--r--src/gui/widgets/window.cpp2
-rw-r--r--src/playerrelations.cpp3
8 files changed, 21 insertions, 38 deletions
diff --git a/src/client.cpp b/src/client.cpp
index f428aaec..fba54c81 100644
--- a/src/client.cpp
+++ b/src/client.cpp
@@ -87,7 +87,7 @@
#include <sys/stat.h>
#include <cassert>
-// TODO: Get rid fo these globals
+// TODO: Get rid of these globals
std::string errorMessage;
LoginData loginData;
@@ -262,10 +262,10 @@ Client::Client(const Options &options):
// Add the local data directory to PhysicsFS search path
resman->addToSearchPath(mLocalDataDir, false);
- bool useOpenGL = !mOptions.noOpenGL && (config.getValue("opengl", 0) == 1);
+ bool useOpenGL = !mOptions.noOpenGL && config.getBoolValue("opengl");
// Set up the transparency option for low CPU when not using OpenGL.
- if (!useOpenGL && (config.getValue("disableTransparency", 0) == 1))
+ if (!useOpenGL && config.getBoolValue("disableTransparency"))
Image::SDLdisableTransparency();
VideoSettings videoSettings;
@@ -394,10 +394,7 @@ Client::Client(const Options &options):
listen(Event::ConfigChannel);
- //TODO: fix having to fake a option changed event
- Event fakeevent(Event::ConfigOptionChanged);
- fakeevent.setString("option", "fpslimit");
- event(Event::ConfigChannel, fakeevent);
+ mFpsLimit = config.getIntValue("fpslimit");
// Initialize PlayerInfo
PlayerInfo::init();
@@ -1105,20 +1102,8 @@ void Client::initHomeDir()
void Client::initConfiguration()
{
// Fill configuration with defaults
- config.setValue("opengl", false);
- config.setValue("screen", false);
- config.setValue("sound", true);
- config.setValue("guialpha", 0.8f);
- config.setValue("remember", true);
- config.setValue("sfxVolume", 100);
- config.setValue("musicVolume", 60);
- config.setValue("fpslimit", 60);
- std::string defaultUpdateHost = branding.getValue("defaultUpdateHost", "");
- config.setValue("updatehost", defaultUpdateHost);
- config.setValue("customcursor", true);
- config.setValue("useScreenshotDirectorySuffix", true);
- config.setValue("ChatLogLength", 128);
- config.setValue("disableTransparency", false);
+ config.setValue("updatehost", branding.getValue("defaultUpdateHost",
+ std::string()));
// Checking if the configuration file exists... otherwise create it with
// default options.
diff --git a/src/configuration.cpp b/src/configuration.cpp
index e37fc1ba..f0499b2d 100644
--- a/src/configuration.cpp
+++ b/src/configuration.cpp
@@ -115,9 +115,8 @@ void Configuration::setDefaultValues(DefaultsData *defaultsData)
mDefaultsData = defaultsData;
}
-VariableData* Configuration::getDefault(const std::string &key,
- VariableData::DataType type
- ) const
+VariableData *Configuration::getDefault(const std::string &key,
+ VariableData::DataType type) const
{
if (mDefaultsData)
{
diff --git a/src/configuration.h b/src/configuration.h
index 81806ad9..a22eb258 100644
--- a/src/configuration.h
+++ b/src/configuration.h
@@ -245,8 +245,8 @@ class Configuration : public ConfigurationObject
bool getBoolValue(const std::string &key) const;
- VariableData* getDefault(const std::string &key,
- VariableData::DataType type) const;
+ VariableData *getDefault(const std::string &key,
+ VariableData::DataType type) const;
private:
/**
* Clean up the default values member.
diff --git a/src/defaults.cpp b/src/defaults.cpp
index 3c03355a..b17ba350 100644
--- a/src/defaults.cpp
+++ b/src/defaults.cpp
@@ -82,11 +82,11 @@ DefaultsData* getConfigDefaults()
AddDEF(configData, "screenheight", defaultScreenHeight);
AddDEF(configData, "scale", 0);
AddDEF(configData, "vsync", true);
- AddDEF(configData, "sound", false);
+ AddDEF(configData, "sound", true);
AddDEF(configData, "sfxVolume", 100);
AddDEF(configData, "notificationsVolume", 100);
AddDEF(configData, "musicVolume", 60);
- AddDEF(configData, "remember", false);
+ AddDEF(configData, "remember", true);
AddDEF(configData, "username", "");
AddDEF(configData, "lastCharacter", "");
AddDEF(configData, "fpslimit", 0);
@@ -103,7 +103,7 @@ DefaultsData* getConfigDefaults()
AddDEF(configData, "logNpcInGui", true);
AddDEF(configData, "download-music", false);
AddDEF(configData, "guialpha", 0.8f);
- AddDEF(configData, "ChatLogLength", 0);
+ AddDEF(configData, "ChatLogLength", 128);
AddDEF(configData, "enableChatLog", false);
AddDEF(configData, "whispertab", true);
AddDEF(configData, "customcursor", true);
diff --git a/src/gui/setup_video.cpp b/src/gui/setup_video.cpp
index 0d6c9cce..5f7dc7b4 100644
--- a/src/gui/setup_video.cpp
+++ b/src/gui/setup_video.cpp
@@ -397,22 +397,22 @@ void Setup_Video::apply()
// If LowCPU is enabled from a disabled state we warn the user
else if (mDisableSDLTransparencyCheckBox->isSelected())
{
- if (config.getValue("disableTransparency", true) == false)
+ if (!config.getBoolValue("disableTransparency"))
{
new OkDialog(_("Transparency disabled"),
- _("You must restart to apply changes."));
+ _("You must restart to apply changes."));
}
}
else
{
- if (config.getValue("disableTransparency", true) == true)
+ if (config.getBoolValue("disableTransparency"))
{
new OkDialog(_("Transparency enabled"),
- _("You must restart to apply changes."));
+ _("You must restart to apply changes."));
}
}
config.setValue("disableTransparency",
- mDisableSDLTransparencyCheckBox->isSelected());
+ mDisableSDLTransparencyCheckBox->isSelected());
mFps = mFpsCheckBox->isSelected() ? (int) mFpsSlider->getValue() : 0;
mFpsSlider->setEnabled(mFps > 0);
diff --git a/src/gui/widgets/chattab.cpp b/src/gui/widgets/chattab.cpp
index 9bdb20ef..7a840cc6 100644
--- a/src/gui/widgets/chattab.cpp
+++ b/src/gui/widgets/chattab.cpp
@@ -52,7 +52,7 @@ ChatTab::ChatTab(const std::string &name)
mTextOutput = new BrowserBox(BrowserBox::AUTO_WRAP);
mTextOutput->setWrapIndent(15);
- mTextOutput->setMaxRows((int) config.getIntValue("ChatLogLength"));
+ mTextOutput->setMaxRows(config.getIntValue("ChatLogLength"));
mTextOutput->setLinkHandler(chatWindow->mItemLinkHandler);
mScrollArea = new ScrollArea(mTextOutput);
diff --git a/src/gui/widgets/window.cpp b/src/gui/widgets/window.cpp
index 7e5c9ad9..050e31da 100644
--- a/src/gui/widgets/window.cpp
+++ b/src/gui/widgets/window.cpp
@@ -407,7 +407,7 @@ void Window::mouseMoved(gcn::MouseEvent &event)
int resizeHandles = getResizeHandles(event);
- // Changes the custom mouse cursor based on it's current position.
+ // Changes the custom mouse cursor based on its current position.
switch (resizeHandles)
{
case BOTTOM | RIGHT:
diff --git a/src/playerrelations.cpp b/src/playerrelations.cpp
index f949203e..65b10a8c 100644
--- a/src/playerrelations.cpp
+++ b/src/playerrelations.cpp
@@ -58,8 +58,7 @@ class PlayerConfSerialiser : public ConfigurationListManager<std::pair<std::stri
if (name.empty())
return container;
- auto it =
- (*container).find(name);
+ auto it = (*container).find(name);
if (it != (*container).end())
{
int v = (int)cobj->getValue(RELATION, PlayerRelation::NEUTRAL);