Do not track resolution settings changes in the InputManager (bug #4902)

pull/541/head
Andrei Kortunov 6 years ago
parent 0bec84342c
commit 0cd8d4b842

@ -58,6 +58,7 @@
Bug #4877: Startup script executes only on a new game start
Bug #4888: Global variable stray explicit reference calls break script compilation
Bug #4896: Title screen music doesn't loop
Bug #4902: Using scrollbars in settings causes resolution to change
Bug #4911: Editor: QOpenGLContext::swapBuffers() warning with Qt5
Bug #4916: Specular power (shininess) material parameter is ignored when shaders are used.
Bug #4918: Abilities don't play looping VFX when they're initially applied

@ -584,6 +584,7 @@ namespace MWGui
void SettingsWindow::onOpen()
{
highlightCurrentResolution();
updateControlsBox();
resetScrollbars();
MWBase::Environment::get().getWindowManager()->setKeyFocusWidget(mOkButton);

@ -826,9 +826,6 @@ namespace MWInput
Settings::Manager::getInt("resolution y", "Video"),
Settings::Manager::getBool("fullscreen", "Video"),
Settings::Manager::getBool("window border", "Video"));
// We should reload TrueType fonts to fit new resolution
MWBase::Environment::get().getWindowManager()->loadUserFonts();
}
}
@ -1129,10 +1126,17 @@ namespace MWInput
void InputManager::windowResized(int x, int y)
{
// Note: this is a side effect of resolution change or window resize.
// There is no need to track these changes.
Settings::Manager::setInt("resolution x", "Video", x);
Settings::Manager::setInt("resolution y", "Video", y);
Settings::Manager::apply("resolution x", "Video");
Settings::Manager::apply("resolution y", "Video");
MWBase::Environment::get().getWindowManager()->windowResized(x, y);
// We should reload TrueType fonts to fit new resolution
MWBase::Environment::get().getWindowManager()->loadUserFonts();
}
void InputManager::windowClosed()

@ -414,6 +414,12 @@ void Manager::setBool(const std::string &setting, const std::string &category, c
setString(setting, category, value ? "true" : "false");
}
void Manager::apply(const std::string &setting, const std::string &category)
{
CategorySettingValueMap::key_type key = std::make_pair(category, setting);
mChangedSettings.erase(key);
}
const CategorySettingVector Manager::apply()
{
CategorySettingVector vec = mChangedSettings;

@ -35,6 +35,8 @@ namespace Settings
void saveUser (const std::string& file);
///< save user settings to file
static void apply(const std::string &setting, const std::string &category);
static const CategorySettingVector apply();
///< returns the list of changed settings and then clears it

Loading…
Cancel
Save