mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-01-27 21:35:24 +00:00
Merge branch 'gmst_misses' into 'master'
Log the message "GMST ... not found" only once for each missing l10n GMST See merge request OpenMW/openmw!2897
This commit is contained in:
commit
d899848d33
@ -778,13 +778,18 @@ void OMW::Engine::prepareEngine()
|
|||||||
mEnvironment.setWorldScene(mWorld->getWorldScene());
|
mEnvironment.setWorldScene(mWorld->getWorldScene());
|
||||||
|
|
||||||
const MWWorld::Store<ESM::GameSetting>* gmst = &mWorld->getStore().get<ESM::GameSetting>();
|
const MWWorld::Store<ESM::GameSetting>* gmst = &mWorld->getStore().get<ESM::GameSetting>();
|
||||||
mL10nManager->setGmstLoader([gmst](std::string_view gmstName) {
|
mL10nManager->setGmstLoader(
|
||||||
|
[gmst, misses = std::set<std::string, std::less<>>()](std::string_view gmstName) mutable {
|
||||||
const ESM::GameSetting* res = gmst->search(gmstName);
|
const ESM::GameSetting* res = gmst->search(gmstName);
|
||||||
if (res && res->mValue.getType() == ESM::VT_String)
|
if (res && res->mValue.getType() == ESM::VT_String)
|
||||||
return res->mValue.getString();
|
return res->mValue.getString();
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
if (misses.count(gmstName) == 0)
|
||||||
|
{
|
||||||
|
misses.emplace(gmstName);
|
||||||
Log(Debug::Error) << "GMST " << gmstName << " not found";
|
Log(Debug::Error) << "GMST " << gmstName << " not found";
|
||||||
|
}
|
||||||
return std::string("GMST:") + std::string(gmstName);
|
return std::string("GMST:") + std::string(gmstName);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user