Fix not respecting case-insensitive functions when converting menus

This commit is contained in:
Jan
2023-12-14 19:32:51 +01:00
parent 0b1120f26f
commit 82f3d4925f
4 changed files with 24 additions and 7 deletions

View File

@ -1,10 +1,15 @@
#include "MenuAssetZoneState.h"
#include "Utils/StringUtils.h"
using namespace menu;
void MenuAssetZoneState::AddFunction(std::unique_ptr<CommonFunctionDef> function)
{
m_functions_by_name.emplace(std::make_pair(function->m_name, function.get()));
std::string lowerCaseFunctionName(function->m_name);
utils::MakeStringLowerCase(lowerCaseFunctionName);
m_functions_by_name.emplace(std::make_pair(lowerCaseFunctionName, function.get()));
m_functions.emplace_back(std::move(function));
}

View File

@ -1,5 +1,7 @@
#include "MenuFileParserState.h"
#include "Utils/StringUtils.h"
using namespace menu;
MenuFileParserState::EventHandlerConditionState::EventHandlerConditionState(CommonEventHandlerCondition* condition)
@ -32,7 +34,9 @@ MenuFileParserState::MenuFileParserState(const FeatureLevel featureLevel, const
{
for (const auto& function : zoneState->m_functions)
{
m_functions_by_name.emplace(std::make_pair(function->m_name, function.get()));
std::string lowerCaseName(function->m_name);
utils::MakeStringLowerCase(lowerCaseName);
m_functions_by_name.emplace(std::make_pair(lowerCaseName, function.get()));
}
for (const auto& menu : zoneState->m_menus)