1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-01-29 07:15:34 +00:00

Merge branch 'internationalonoff' into 'master'

Fix localized checkbox toggling behavior

See merge request OpenMW/openmw!4501
This commit is contained in:
psi29a 2025-01-06 08:58:56 +00:00
commit 710aa9ad4f

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