diff --git a/src/Game.cpp b/src/Game.cpp index 1c8c574..c3a8402 100644 --- a/src/Game.cpp +++ b/src/Game.cpp @@ -317,7 +317,7 @@ namespace ZL gameState.chatHistory[i].clear(); } gameState.inventory.clear(); - gameState.questJournal.loadFromFile("resources/config/quests.json", CONST_ZIP_FILE); + gameState.questJournal.loadFromFile(localizedConfigPath("resources/config/quests.json", g_currentLanguage), CONST_ZIP_FILE); createLocations(); }; diff --git a/src/GameState.cpp b/src/GameState.cpp index 555cd84..f9fbf65 100644 --- a/src/GameState.cpp +++ b/src/GameState.cpp @@ -15,7 +15,7 @@ void GameState::save(nlohmann::json& out) const out["savedAt"] = ts.str(); // --- World --- - out["currentLocationName"] = currentLocationName; + out["currentLocationName"] = currentLocationName; out["isDarklands"] = isDarklands; out["isNight"] = isNight; out["isDawn"] = isDawn; diff --git a/src/MenuManager.cpp b/src/MenuManager.cpp index 4733694..bced095 100644 --- a/src/MenuManager.cpp +++ b/src/MenuManager.cpp @@ -101,6 +101,14 @@ namespace ZL { gameState_(gameState), audioPlayer_(audioPlayer) { + localizedLocationName["uni_interior"][Language::Russian] = "Университет, 3 этаж"; + localizedLocationName["uni_interior"][Language::English] = "University, 3rd floor"; + + localizedLocationName["uni_exterior"][Language::Russian] = "Университет, двор"; + localizedLocationName["uni_exterior"][Language::English] = "University, exterior"; + + localizedLocationName["location_dorm"][Language::Russian] = "Общежитие, 1 этаж"; + localizedLocationName["location_dorm"][Language::English] = "Dormitory, 1st floor"; } void MenuManager::setup(Inventory& inv, const std::string& zipFile) { @@ -445,7 +453,7 @@ namespace ZL { SaveSlotInfo info = getSlotInfoFunc(slot); std::string label = info.empty ? "Empty" - : info.locationName + "\n" + info.savedAt; + : localizedLocationName[info.locationName][ZL::g_currentLanguage] + "\n" + info.savedAt; uiManager.setTextButtonText(kSlotButtons[i], label); } uiManager.setTextButtonCallback(kSlotButtons[i], [this, slot](const std::string&) { @@ -473,7 +481,7 @@ namespace ZL { SaveSlotInfo info = getSlotInfoFunc(slot); std::string label = info.empty ? "Empty" - : info.locationName + "\n" + info.savedAt; + : localizedLocationName[info.locationName][ZL::g_currentLanguage] + "\n" + info.savedAt; uiManager.setTextButtonText(buttonName, label); } uiManager.setTextButtonCallback(buttonName, [this, slot, buttonName](const std::string&) { @@ -482,7 +490,7 @@ namespace ZL { SaveSlotInfo info = getSlotInfoFunc(slot); std::string label = info.empty ? "Empty" - : info.locationName + "\n" + info.savedAt; + : localizedLocationName[info.locationName][ZL::g_currentLanguage] + "\n" + info.savedAt; uiManager.setTextButtonText(buttonName, label); } }); diff --git a/src/MenuManager.h b/src/MenuManager.h index 4cb8d9f..2d64af0 100644 --- a/src/MenuManager.h +++ b/src/MenuManager.h @@ -34,6 +34,9 @@ namespace ZL { UiManager topUiManager; UiManager chatUiManager; + std::unordered_map> localizedLocationName; + MenuManager(Renderer& iRenderer, GameState& gameState, AudioPlayerAsync& audioPlayer); void setup(Inventory& inv, const std::string& zipFile);