Fixing minor bugs in texts, encoding, UI
This commit is contained in:
1 parent
79413e7319
commit
d4365728fe
87 files changed
+883
-404
No files matched your search
+47
-13
@@ -1,4 +1,4 @@
|
||||
#include "MenuManager.h"
|
||||
#include "MenuManager.h"
|
||||
#include "Game.h"
|
||||
#include "Localization.h"
|
||||
#include "items/ItemRegistry.h"
|
||||
@@ -672,10 +672,16 @@ namespace ZL {
|
||||
const bool portrait = isPortraitMode();
|
||||
uiManager.pushMenuFromSavedRoot(portrait ? portraitInventoryListRoot : newInventoryRoot);
|
||||
|
||||
uiManager.setButtonCallback("inventoryExitButton", [this](const std::string&) {
|
||||
uiManager.setButtonCallback("inventoryExitButton2", [this](const std::string&) {
|
||||
closeInventory();
|
||||
});
|
||||
|
||||
uiManager.setButtonCallback("inventoryExitButton", [this](const std::string&) {
|
||||
closeInventory();
|
||||
});
|
||||
|
||||
uiManager.setButtonCallback("inventoryMain", [this](const std::string&) {});
|
||||
|
||||
const auto& items = inventory->getItems();
|
||||
const int maxSlots = 9;
|
||||
for (int i = 0; i < maxSlots; ++i) {
|
||||
@@ -772,6 +778,15 @@ namespace ZL {
|
||||
audioPlayer_.playSoundAsync("audio/656126__itsthegoodstuff__paging-through-book.ogg");
|
||||
});
|
||||
|
||||
uiManager.setButtonCallback("journalExitButton2", [this](const std::string&) {
|
||||
closeQuestJournal();
|
||||
audioPlayer_.playSoundAsync("audio/656126__itsthegoodstuff__paging-through-book.ogg");
|
||||
});
|
||||
|
||||
|
||||
uiManager.setButtonCallback("journalMain", [this](const std::string&) {});
|
||||
|
||||
|
||||
static const char* kItemNames[9] = {
|
||||
"item1name","item2name","item3name",
|
||||
"item4name","item5name","item6name",
|
||||
@@ -1576,6 +1591,14 @@ namespace ZL {
|
||||
audioPlayer_.playSoundAsync("audio/sound_bag001.ogg");
|
||||
});
|
||||
|
||||
uiManager.setButtonCallback("inventoryExitButton2", [this](const std::string&) {
|
||||
closePortraitInventoryItem();
|
||||
audioPlayer_.playSoundAsync("audio/sound_bag001.ogg");
|
||||
});
|
||||
|
||||
uiManager.setButtonCallback("inventoryMain", [this](const std::string&) {});
|
||||
|
||||
|
||||
const auto& item = items[index];
|
||||
|
||||
auto img = uiManager.findStaticImage("selectedItemPic");
|
||||
@@ -1604,6 +1627,15 @@ namespace ZL {
|
||||
audioPlayer_.playSoundAsync("audio/255571__stradie__flipping-paper.ogg");
|
||||
});
|
||||
|
||||
uiManager.setButtonCallback("journalItemExitButton2", [this](const std::string&) {
|
||||
closeQuestJournal();
|
||||
audioPlayer_.playSoundAsync("audio/656126__itsthegoodstuff__paging-through-book.ogg");
|
||||
});
|
||||
|
||||
|
||||
uiManager.setButtonCallback("journalMain", [this](const std::string&) {});
|
||||
|
||||
|
||||
Quest::QuestState* quest = gameState_.questJournal.findQuest(visibleQuestIds[index]);
|
||||
if (!quest) return;
|
||||
const auto& def = quest->definition;
|
||||
@@ -1665,6 +1697,13 @@ namespace ZL {
|
||||
uiManager.updateAllLayouts();
|
||||
refreshQuestJournalUi();
|
||||
}
|
||||
/*
|
||||
void MenuManager::closePortraitJournalItemCompletely() {
|
||||
journalMenuStackDepth_ = 1;
|
||||
uiManager.popMenu();
|
||||
uiManager.updateAllLayouts();
|
||||
refreshQuestJournalUi();
|
||||
}*/
|
||||
|
||||
void MenuManager::resetPhoneChatNodes() {
|
||||
static const char* kChatNodes[] = {
|
||||
@@ -2054,19 +2093,14 @@ namespace ZL {
|
||||
|
||||
void MenuManager::saveSettings() {
|
||||
nlohmann::json root;
|
||||
root["musicVolume"] = audioPlayer_.getMusicVolume();
|
||||
root["soundVolume"] = audioPlayer_.getSoundVolume();
|
||||
root["musicVolume"] = audioPlayer_.getMusicVolume();
|
||||
root["soundVolume"] = audioPlayer_.getSoundVolume();
|
||||
root["musicEnabled"] = audioPlayer_.isMusicEnabled();
|
||||
root["soundEnabled"] = audioPlayer_.isSoundEnabled();
|
||||
root["fullscreen"] = Environment::isFullscreen;
|
||||
root["language"] = ZL::languageToCode(ZL::g_currentLanguage);
|
||||
root["fullscreen"] = Environment::isFullscreen;
|
||||
root["language"] = ZL::languageToCode(ZL::g_currentLanguage);
|
||||
|
||||
std::ofstream file("settings.json");
|
||||
if (file.is_open()) {
|
||||
file << root.dump(2);
|
||||
} else {
|
||||
std::cerr << "[settings] Could not open settings.json for writing" << std::endl;
|
||||
}
|
||||
saveJsonToFile(root, "settings.json");
|
||||
}
|
||||
|
||||
void MenuManager::loadSettings() {
|
||||
@@ -2079,7 +2113,7 @@ namespace ZL {
|
||||
// loaded, before this function ever runs.
|
||||
ZL::loadLanguageSetting();
|
||||
|
||||
const std::string content = ZL::readTextFile("settings.json");
|
||||
const std::string content = ZL::readSavedTextFile("settings.json");
|
||||
if (content.empty()) return;
|
||||
try {
|
||||
const nlohmann::json root = nlohmann::json::parse(content);
|
||||
|
||||
Reference in new issue
Block a user