diff options
author | Andrei Karas <akaras@inbox.ru> | 2013-05-03 21:36:25 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2013-05-03 21:36:25 +0300 |
commit | 070511a39b941fd4648e46a2302e1670c3fef09e (patch) | |
tree | bc190cb6e485783f00210a364e424ce14b76011e | |
parent | 5bde28f9cd5b075f5d17d94a955d0700e0f8e664 (diff) | |
download | plus-070511a39b941fd4648e46a2302e1670c3fef09e.tar.gz plus-070511a39b941fd4648e46a2302e1670c3fef09e.tar.bz2 plus-070511a39b941fd4648e46a2302e1670c3fef09e.tar.xz plus-070511a39b941fd4648e46a2302e1670c3fef09e.zip |
add config versioning.
-rw-r--r-- | src/client.cpp | 15 | ||||
-rw-r--r-- | src/client.h | 2 | ||||
-rw-r--r-- | src/defaults.cpp | 1 |
3 files changed, 18 insertions, 0 deletions
diff --git a/src/client.cpp b/src/client.cpp index df8fa3c85..1199c1213 100644 --- a/src/client.cpp +++ b/src/client.cpp @@ -589,6 +589,7 @@ void Client::gameInit() runCounters = config.getBoolValue("packetcounters"); applyVSync(); graphicsManager.setVideoMode(); + checkConfigVersion(); getConfigDefaults2(config.getDefaultValues()); applyGrabMode(); applyGamma(); @@ -2929,3 +2930,17 @@ void Client::updateScreenKeyboard(int height A_UNUSED) { // logger->log("keyboard height: %d", height); } + +void Client::checkConfigVersion() +{ + const int version = config.getIntValue("cfgver"); + if (version < 1) + { + if (config.getIntValue("fontSize") == 11) + config.deleteKey("fontSize"); + if (config.getIntValue("npcfontSize") == 13) + config.deleteKey("npcfontSize"); + } + + config.setValue("cfgver", 1); +} diff --git a/src/client.h b/src/client.h index e5bf5183e..733bc21e8 100644 --- a/src/client.h +++ b/src/client.h @@ -366,6 +366,8 @@ private: void logVars(); + void checkConfigVersion(); + static Client *mInstance; static void bindTextDomain(const char *const name, const char *const path); diff --git a/src/defaults.cpp b/src/defaults.cpp index 045b007f0..481960606 100644 --- a/src/defaults.cpp +++ b/src/defaults.cpp @@ -316,6 +316,7 @@ DefaultsData* getConfigDefaults() AddDEF("moveNames", false); AddDEF("uselonglivesprites", false); AddDEF("screenDensity", 0); + AddDEF("cfgver", 0); return configData; } |