Do not parse menus more than once when they have already been parsed

This commit is contained in:
Jan
2022-01-01 16:39:28 +01:00
parent 5d1df29542
commit 4b80ed1e9e
3 changed files with 70 additions and 28 deletions

View File

@ -12,3 +12,8 @@ void MenuAssetZoneState::AddMenu(std::unique_ptr<CommonMenuDef> menu)
{
m_menus.emplace_back(std::move(menu));
}
void MenuAssetZoneState::AddMenusToLoad(std::string menuName, std::vector<std::string> menusToLoad)
{
m_menus_to_load_by_menu.emplace(std::make_pair(std::move(menuName), std::move(menusToLoad)));
}

View File

@ -16,9 +16,12 @@ namespace menu
std::map<std::string, CommonFunctionDef*> m_functions_by_name;
std::map<std::string, std::vector<std::string>> m_menus_to_load_by_menu;
MenuAssetZoneState() = default;
void AddFunction(std::unique_ptr<CommonFunctionDef> function);
void AddMenu(std::unique_ptr<CommonMenuDef> menu);
void AddMenusToLoad(std::string menuName, std::vector<std::string> menusToLoad);
};
}