Working on new UI
This commit is contained in:
1 parent
2807d82d51
commit
901142385d
35 files changed
+4407
-1069
No files matched your search
+10
-1
@@ -387,6 +387,7 @@ namespace ZL
|
||||
"resources/navigation/dorm3_b.json",
|
||||
"resources/navigation/dorm3_all_open.json",
|
||||
};*/
|
||||
/*
|
||||
params_dorm.navigationJsonPaths = {
|
||||
"resources/navigation/dorm3_bca.txt", //0
|
||||
"resources/navigation/dorm3_ca.txt", //1
|
||||
@@ -395,7 +396,15 @@ namespace ZL
|
||||
"resources/navigation/dorm3_b.txt",
|
||||
"resources/navigation/dorm3_all_open.txt", //5
|
||||
};
|
||||
|
||||
*/
|
||||
params_dorm.navigationJsonPaths = {
|
||||
"resources/navigation/dorm0_large.json",
|
||||
"resources/navigation/dorm0_large.json",
|
||||
"resources/navigation/dorm0_large.json",
|
||||
"resources/navigation/dorm0_large.json",
|
||||
"resources/navigation/dorm0_large.json",
|
||||
"resources/navigation/dorm0_large.json",
|
||||
};
|
||||
params_dorm.teleportsJsonPath = "resources/config2/teleports_dorm.json";
|
||||
params_dorm.triggerZonesJsonPath = "resources/config2/trigger_zones_dorm.json";
|
||||
params_dorm.lightsJsonPath = "resources/config2/lights_dorm.json";
|
||||
|
||||
@@ -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();
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -114,7 +114,12 @@ namespace ZL {
|
||||
void closePhoneScreenFromChat();
|
||||
void applyUniIntHud();
|
||||
void rebuildChatBubblesFromHistory(int chatIndex);
|
||||
void showModalMenuScreen();
|
||||
|
||||
void showAboutScreen();
|
||||
void showSettingsScreen();
|
||||
void showLoadGameScreen();
|
||||
void showSaveGameScreen();
|
||||
|
||||
// Toast internals
|
||||
struct ToastEntry {
|
||||
@@ -178,8 +183,15 @@ namespace ZL {
|
||||
std::shared_ptr<UiNode> phoneChat2Root;
|
||||
std::shared_ptr<UiNode> phoneChat3Root;
|
||||
|
||||
std::shared_ptr<UiNode> modalMenuRoot;
|
||||
|
||||
|
||||
std::shared_ptr<UiNode> mainMenuRoot;
|
||||
std::shared_ptr<UiNode> aboutScreenRoot;
|
||||
std::shared_ptr<UiNode> settingsScreenRoot;
|
||||
std::shared_ptr<UiNode> loadSavedGameScreenRoot;
|
||||
std::shared_ptr<UiNode> saveGameScreenRoot;
|
||||
|
||||
|
||||
std::shared_ptr<UiNode> newInventoryRoot;
|
||||
std::shared_ptr<UiNode> questJournalRoot;
|
||||
|
||||
Reference in new issue
Block a user