1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-03-21 22:21:02 +00:00

Fix localized checkbox toggling behavior

This commit is contained in:
Alexei Kotov 2025-01-06 09:43:44 +03:00
parent 52d1493500
commit 4eb5b24af5

View File

@ -18,6 +18,7 @@
#include <SDL_video.h> #include <SDL_video.h>
#include <components/debug/debuglog.hpp> #include <components/debug/debuglog.hpp>
#include <components/l10n/manager.hpp>
#include <components/lua_ui/scriptsettings.hpp> #include <components/lua_ui/scriptsettings.hpp>
#include <components/misc/constants.hpp> #include <components/misc/constants.hpp>
#include <components/misc/display.hpp> #include <components/misc/display.hpp>
@ -669,12 +670,12 @@ namespace MWGui
void SettingsWindow::onButtonToggled(MyGUI::Widget* _sender) void SettingsWindow::onButtonToggled(MyGUI::Widget* _sender)
{ {
std::string_view on = MWBase::Environment::get().getWindowManager()->getGameSettingString("sOn", "On"); const std::string on = MWBase::Environment::get().getL10nManager()->getMessage("Interface", "On");
const std::string off = MWBase::Environment::get().getL10nManager()->getMessage("Interface", "Off");
bool newState; bool newState;
if (_sender->castType<MyGUI::Button>()->getCaption() == on) if (_sender->castType<MyGUI::Button>()->getCaption() == on)
{ {
_sender->castType<MyGUI::Button>()->setCaption( _sender->castType<MyGUI::Button>()->setCaption(MyGUI::UString(off));
MyGUI::UString(MWBase::Environment::get().getWindowManager()->getGameSettingString("sOff", "Off")));
newState = false; newState = false;
} }
else else