Some clean up, web version prepare

This commit is contained in:
Vladislav Khorev committed 2026-07-17 21:27:47 +03:00
1 parent e9c888e2bf
commit 0975f3b9cd
104 files changed
+779 -1483

No files matched your search

+17 -17
View File
@@ -10,7 +10,7 @@
#include <string>
#include <SDL.h>
namespace ZL {
namespace FRG {
// Localization
static const std::string EMPTY_LANGUAGE_RU = u8"(пусто)";
@@ -669,13 +669,13 @@ namespace ZL {
uiManager.setTextButtonCallback("languageRussianButton", [this](const std::string&) {
audioPlayer_.playSoundAsync("audio/751089__smallconfusion__mechanical-plastic-click-11.ogg");
ZL::g_currentLanguage = ZL::Language::Russian;
FRG::g_currentLanguage = FRG::Language::Russian;
reloadLocalizedGameContent();
saveSettings();
});
uiManager.setTextButtonCallback("languageEnglishButton", [this](const std::string&) {
audioPlayer_.playSoundAsync("audio/751089__smallconfusion__mechanical-plastic-click-11.ogg");
ZL::g_currentLanguage = ZL::Language::English;
FRG::g_currentLanguage = FRG::Language::English;
reloadLocalizedGameContent();
saveSettings();
});
@@ -748,18 +748,18 @@ namespace ZL {
SaveSlotInfo info = getSlotInfoFunc(slot);
std::string emptyText;
if (ZL::g_currentLanguage == ZL::Language::Russian)
if (FRG::g_currentLanguage == FRG::Language::Russian)
{
emptyText = EMPTY_LANGUAGE_RU;
}
else if (ZL::g_currentLanguage == ZL::Language::English)
else if (FRG::g_currentLanguage == FRG::Language::English)
{
emptyText = EMPTY_LANGUAGE_EN;
}
std::string label = info.empty
? emptyText
: localizedLocationName[info.locationName][ZL::g_currentLanguage] + " " + info.savedAt;
: localizedLocationName[info.locationName][FRG::g_currentLanguage] + " " + info.savedAt;
uiManager.setTextButtonText(kSlotButtons[i], label);
}
uiManager.setTextButtonCallback(kSlotButtons[i], [this, slot](const std::string&) {
@@ -789,18 +789,18 @@ namespace ZL {
SaveSlotInfo info = getSlotInfoFunc(slot);
std::string emptyText;
if (ZL::g_currentLanguage == ZL::Language::Russian)
if (FRG::g_currentLanguage == FRG::Language::Russian)
{
emptyText = EMPTY_LANGUAGE_RU;
}
else if (ZL::g_currentLanguage == ZL::Language::English)
else if (FRG::g_currentLanguage == FRG::Language::English)
{
emptyText = EMPTY_LANGUAGE_EN;
}
std::string label = info.empty
? emptyText
: localizedLocationName[info.locationName][ZL::g_currentLanguage] + " " + info.savedAt;
: localizedLocationName[info.locationName][FRG::g_currentLanguage] + " " + info.savedAt;
uiManager.setTextButtonText(buttonName, label);
}
uiManager.setTextButtonCallback(buttonName, [this, slot, buttonName](const std::string&) {
@@ -809,18 +809,18 @@ namespace ZL {
SaveSlotInfo info = getSlotInfoFunc(slot);
std::string emptyText;
if (ZL::g_currentLanguage == ZL::Language::Russian)
if (FRG::g_currentLanguage == FRG::Language::Russian)
{
emptyText = EMPTY_LANGUAGE_RU;
}
else if (ZL::g_currentLanguage == ZL::Language::English)
else if (FRG::g_currentLanguage == FRG::Language::English)
{
emptyText = EMPTY_LANGUAGE_EN;
}
std::string label = info.empty
? emptyText
: localizedLocationName[info.locationName][ZL::g_currentLanguage] + " " + info.savedAt;
: localizedLocationName[info.locationName][FRG::g_currentLanguage] + " " + info.savedAt;
uiManager.setTextButtonText(buttonName, label);
audioPlayer_.playSoundAsync("audio/751089__smallconfusion__mechanical-plastic-click-11.ogg");
}
@@ -2271,7 +2271,7 @@ namespace ZL {
root["musicEnabled"] = audioPlayer_.isMusicEnabled();
root["soundEnabled"] = audioPlayer_.isSoundEnabled();
root["fullscreen"] = Environment::isFullscreen;
root["language"] = ZL::languageToCode(ZL::g_currentLanguage);
root["language"] = FRG::languageToCode(FRG::g_currentLanguage);
root["shadow"] = shadowsEnabled;
saveJsonToFile(root, "settings.json");
@@ -2282,12 +2282,12 @@ namespace ZL {
// directly in the right fullscreen state (see WIN32 main() in main.cpp) to avoid
// a windowed -> fullscreen flash. The block below just keeps Environment::isFullscreen
// in sync in case this is ever called from a path that didn't pre-apply it.
// Language is loaded separately, even earlier (see ZL::loadLanguageSetting()
// Language is loaded separately, even earlier (see FRG::loadLanguageSetting()
// callers), because some location scripts start a dialogue as soon as they're
// loaded, before this function ever runs.
ZL::loadLanguageSetting();
FRG::loadLanguageSetting();
const std::string content = ZL::readSavedTextFile("settings.json");
const std::string content = FRG::readSavedTextFile("settings.json");
if (content.empty()) return;
try {
const nlohmann::json root = nlohmann::json::parse(content);
@@ -2427,4 +2427,4 @@ namespace ZL {
uiManager.updateAllLayouts();
}
} // namespace ZL
} // namespace FRG