Added translations support and fixed some bugs with strings

This commit is contained in:
MontyTRC89 2021-06-20 06:33:44 +02:00
parent e2e4022188
commit dc5db910f2
5 changed files with 22 additions and 217 deletions

View file

@ -202,7 +202,7 @@ bool GameFlow::LoadGameFlowScript()
// Hardcode English for now - this will be changed
// to something like "Strings.lua" once that system
// through
if (!ExecuteScript("Scripts/English.lua", err)) {
if (!ExecuteScript("Scripts/Strings.lua", err)) {
std::cout << err << "\n";
}
@ -211,8 +211,10 @@ bool GameFlow::LoadGameFlowScript()
char* GameFlow::GetString(const char* id)
{
return (char*)id;
//return (char*)(CurrentStrings->Strings[id].c_str());
if (m_translationsMap.find(id) == m_translationsMap.end())
return "String not found";
else
return (char*)(m_translationsMap.at(string(id)).at(0).c_str());
}
GameScriptSettings* GameFlow::GetSettings()