1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-03-21 13:20:54 +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 <components/debug/debuglog.hpp>
#include <components/l10n/manager.hpp>
#include <components/lua_ui/scriptsettings.hpp>
#include <components/misc/constants.hpp>
#include <components/misc/display.hpp>
@ -669,12 +670,12 @@ namespace MWGui
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;
if (_sender->castType<MyGUI::Button>()->getCaption() == on)
{
_sender->castType<MyGUI::Button>()->setCaption(
MyGUI::UString(MWBase::Environment::get().getWindowManager()->getGameSettingString("sOff", "Off")));
_sender->castType<MyGUI::Button>()->setCaption(MyGUI::UString(off));
newState = false;
}
else