Skip to content

Commit

Permalink
Merge branch 'internationalonoff' into 'master'
Browse files Browse the repository at this point in the history
Fix localized checkbox toggling behavior

See merge request OpenMW/openmw!4501
  • Loading branch information
psi29a committed Jan 6, 2025
2 parents 52d1493 + 4eb5b24 commit 710aa9a
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions apps/openmw/mwgui/settingswindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 710aa9a

Please sign in to comment.