Support links to GMST in l10n files

This commit is contained in:
Petr Mikheev 2023-03-12 00:34:17 +01:00
parent efebb8efd8
commit 58fdd687a8
6 changed files with 42 additions and 4 deletions

View file

@ -777,6 +777,18 @@ void OMW::Engine::prepareEngine()
mEnvironment.setWorldModel(mWorld->getWorldModel());
mEnvironment.setWorldScene(mWorld->getWorldScene());
const MWWorld::Store<ESM::GameSetting>* gmst = &mWorld->getStore().get<ESM::GameSetting>();
mL10nManager->setGmstLoader([gmst](std::string_view gmstName) {
const ESM::GameSetting* res = gmst->search(gmstName);
if (res && res->mValue.getType() == ESM::VT_String)
return res->mValue.getString();
else
{
Log(Debug::Error) << "GMST " << gmstName << " not found";
return std::string("GMST:") + std::string(gmstName);
}
});
mWindowManager->setStore(mWorld->getStore());
mWindowManager->initUI();