Working on new UI
This commit is contained in:
1 parent
2807d82d51
commit
901142385d
35 files changed
+4407
-1069
No files matched your search
@@ -137,10 +137,14 @@ namespace ZL {
|
||||
phoneChat2Root = loadUiFromFile("resources/w/ui/screen_phone_chat2.json", renderer, zipFile);
|
||||
phoneChat3Root = loadUiFromFile("resources/w/ui/screen_phone_chat3.json", renderer, zipFile);
|
||||
|
||||
modalMenuRoot = loadUiFromFile("resources/w/ui/screen_modal_menu.json", renderer, zipFile);
|
||||
newInventoryRoot = loadUiFromFile("resources/w/ui/screen_inventory.json", renderer, zipFile);
|
||||
questJournalRoot = loadUiFromFile("resources/w/ui/screen_journal.json", renderer, zipFile);
|
||||
mainMenuRoot = loadUiFromFile("resources/w/ui/screen_main_menu.json", renderer, zipFile);
|
||||
aboutScreenRoot = loadUiFromFile("resources/w/ui/screen_about.json", renderer, zipFile);
|
||||
settingsScreenRoot = loadUiFromFile("resources/w/ui/screen_settings.json", renderer, zipFile);
|
||||
loadSavedGameScreenRoot = loadUiFromFile("resources/w/ui/screen_load.json", renderer, zipFile);
|
||||
saveGameScreenRoot = loadUiFromFile("resources/w/ui/screen_save.json", renderer, zipFile);
|
||||
|
||||
texObjectiveCompleted_ = renderer.textureManager.LoadFromPng("resources/w/ui/img/journal/quest_objective_completed.png", zipFile, true);
|
||||
texObjectiveBlank_ = renderer.textureManager.LoadFromPng("resources/w/ui/img/journal/quest_objective_blank.png", zipFile, true);
|
||||
@@ -193,6 +197,11 @@ namespace ZL {
|
||||
uiManager.setButtonCallback("inventoryButton", [this](const std::string&) {
|
||||
openInventory();
|
||||
});
|
||||
if (uiManager.findButton("settingsButton")) {
|
||||
uiManager.setButtonCallback("settingsButton", [this](const std::string&) {
|
||||
showModalMenuScreen();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
void MenuManager::showMainMenu() {
|
||||
@@ -205,6 +214,13 @@ namespace ZL {
|
||||
uiManager.setTextButtonCallback("menuAboutButton", [this](const std::string&) {
|
||||
showAboutScreen();
|
||||
});
|
||||
uiManager.setTextButtonCallback("menuSettingsButton", [this](const std::string&) {
|
||||
showSettingsScreen();
|
||||
});
|
||||
uiManager.setTextButtonCallback("menuLoadButton", [this](const std::string&) {
|
||||
showLoadGameScreen();
|
||||
});
|
||||
|
||||
|
||||
#ifndef EMSCRIPTEN
|
||||
uiManager.setTextButtonCallback("menuExitButton", [this](const std::string&) {
|
||||
@@ -223,6 +239,32 @@ namespace ZL {
|
||||
});
|
||||
}
|
||||
|
||||
void MenuManager::showSettingsScreen() {
|
||||
uiManager.pushMenuFromSavedRoot(settingsScreenRoot);
|
||||
uiManager.setTextButtonCallback("settingsBackButton", [this](const std::string&) {
|
||||
uiManager.popMenu();
|
||||
uiManager.updateAllLayouts();
|
||||
});
|
||||
}
|
||||
|
||||
void MenuManager::showLoadGameScreen()
|
||||
{
|
||||
uiManager.pushMenuFromSavedRoot(loadSavedGameScreenRoot);
|
||||
uiManager.setTextButtonCallback("loadBackButton", [this](const std::string&) {
|
||||
uiManager.popMenu();
|
||||
uiManager.updateAllLayouts();
|
||||
});
|
||||
}
|
||||
|
||||
void MenuManager::showSaveGameScreen()
|
||||
{
|
||||
uiManager.pushMenuFromSavedRoot(saveGameScreenRoot);
|
||||
uiManager.setTextButtonCallback("saveBackButton", [this](const std::string&) {
|
||||
uiManager.popMenu();
|
||||
uiManager.updateAllLayouts();
|
||||
});
|
||||
}
|
||||
|
||||
void MenuManager::openInventory() {
|
||||
uiState_ = GameUiState::Inventory;
|
||||
uiManager.pushMenuFromSavedRoot(newInventoryRoot);
|
||||
@@ -646,6 +688,31 @@ namespace ZL {
|
||||
closePhoneEntirely();
|
||||
}
|
||||
|
||||
void MenuManager::showModalMenuScreen() {
|
||||
uiManager.pushMenuFromSavedRoot(modalMenuRoot);
|
||||
uiManager.setButtonCallback("modalExitButton", [this](const std::string&) {
|
||||
uiManager.popMenu();
|
||||
uiManager.updateAllLayouts();
|
||||
});
|
||||
|
||||
uiManager.setButtonCallback("menuCloseButton", [this](const std::string&) {
|
||||
uiManager.popMenu();
|
||||
uiManager.updateAllLayouts();
|
||||
});
|
||||
|
||||
uiManager.setButtonCallback("menuSaveButton", [this](const std::string&) {
|
||||
showSaveGameScreen();
|
||||
});
|
||||
|
||||
uiManager.setButtonCallback("menuLoadButton", [this](const std::string&) {
|
||||
showLoadGameScreen();
|
||||
});
|
||||
|
||||
uiManager.setButtonCallback("menuSettingsButton", [this](const std::string&) {
|
||||
showSettingsScreen();
|
||||
});
|
||||
}
|
||||
|
||||
void MenuManager::tutorialShowTaxiHint()
|
||||
{
|
||||
std::cout << "tutorialShowTaxiHint" << std::endl;
|
||||
@@ -679,6 +746,11 @@ namespace ZL {
|
||||
openQuestJournal();
|
||||
});
|
||||
}
|
||||
if (uiManager.findButton("settingsButton")) {
|
||||
uiManager.setButtonCallback("settingsButton", [this](const std::string&) {
|
||||
showModalMenuScreen();
|
||||
});
|
||||
}
|
||||
if (gameState_.tutorialNeedOpenTaxiScreen)
|
||||
{
|
||||
uiManager.setNodeVisible("hint6a", false);
|
||||
@@ -716,6 +788,10 @@ namespace ZL {
|
||||
uiManager.setButtonCallback("journalButton", [this](const std::string&) { openQuestJournal(); });
|
||||
if (uiManager.findButton("darklandsButton"))
|
||||
uiManager.setButtonCallback("darklandsButton", [this](const std::string&) { startDarklandsTransitionFunc(); });
|
||||
if (uiManager.findButton("settingsButton"))
|
||||
uiManager.setButtonCallback("settingsButton", [this](const std::string&) { showModalMenuScreen(); });
|
||||
|
||||
|
||||
hideAllToastWidgets();
|
||||
applyToastsToUi();
|
||||
}
|
||||
@@ -775,6 +851,11 @@ namespace ZL {
|
||||
uiManager.setButtonCallback("inventoryButton", [this](const std::string&) {
|
||||
openInventory();
|
||||
});
|
||||
if (uiManager.findButton("settingsButton")) {
|
||||
uiManager.setButtonCallback("settingsButton", [this](const std::string&) {
|
||||
showModalMenuScreen();
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user