Working on phone
This commit is contained in:
1 parent
7a02665305
commit
1b1ceac2fe
7 files changed
+194
-12
No files matched your search
+86
-10
@@ -89,9 +89,11 @@ namespace ZL {
|
||||
hudUniExtDarkRoot = loadUiFromFile("resources/w/ui/hud_uni_ext_dark.json", renderer, zipFile);
|
||||
|
||||
|
||||
//phoneChatListRoot = loadUiFromFile("resources/w/ui/screen_phone_bank.json", renderer, zipFile);
|
||||
//phoneChatListRoot = loadUiFromFile("resources/w/ui/screen_phone_map_dorm.json", renderer, zipFile);
|
||||
//phoneChatListRoot = loadUiFromFile("resources/w/ui/screen_phone_video.json", renderer, zipFile);
|
||||
phoneMainRoot = loadUiFromFile("resources/w/ui/screen_phone.json", renderer, zipFile);
|
||||
phoneBankRoot = loadUiFromFile("resources/w/ui/screen_phone_bank.json", renderer, zipFile);
|
||||
phoneVideoRoot = loadUiFromFile("resources/w/ui/screen_phone_video.json", renderer, zipFile);
|
||||
phoneMapDormRoot = loadUiFromFile("resources/w/ui/screen_phone_map_dorm.json", renderer, zipFile);
|
||||
phoneMapUniRoot = loadUiFromFile("resources/w/ui/screen_phone_map_uni.json", renderer, zipFile);
|
||||
phoneChatListRoot = loadUiFromFile("resources/w/ui/screen_phone_chat_list.json", renderer, zipFile);
|
||||
phoneChat1Root = loadUiFromFile("resources/w/ui/screen_phone_chat1.json", renderer, zipFile);
|
||||
phoneChat2Root = loadUiFromFile("resources/w/ui/screen_phone_chat2.json", renderer, zipFile);
|
||||
@@ -269,10 +271,30 @@ namespace ZL {
|
||||
state = GameState::PhoneScreen;
|
||||
tutorialPhoneScreenOpened = true;
|
||||
uiManager.setNodeVisible("hint6a", false);
|
||||
uiManager.pushMenuFromSavedRoot(phoneMainRoot);
|
||||
|
||||
uiManager.setButtonCallback("phoneExitButton", [this](const std::string&) {
|
||||
closePhoneEntirely();
|
||||
});
|
||||
uiManager.setButtonCallback("phoneMessenger", [this](const std::string&) {
|
||||
openPhoneMessenger();
|
||||
});
|
||||
uiManager.setButtonCallback("phoneBank", [this](const std::string&) {
|
||||
openPhoneBank();
|
||||
});
|
||||
uiManager.setButtonCallback("phoneVideo", [this](const std::string&) {
|
||||
openPhoneVideo();
|
||||
});
|
||||
uiManager.setButtonCallback("phoneTaxi", [this](const std::string&) {
|
||||
openPhoneTaxi();
|
||||
});
|
||||
}
|
||||
|
||||
void MenuManager::openPhoneMessenger() {
|
||||
uiManager.pushMenuFromSavedRoot(phoneChatListRoot);
|
||||
|
||||
uiManager.setButtonCallback("phoneExitButton", [this](const std::string&) {
|
||||
closePhoneScreen();
|
||||
closePhoneEntirely();
|
||||
});
|
||||
uiManager.setButtonCallback("phoneMain", [this](const std::string&) {});
|
||||
uiManager.setTextButtonCallback("chat1button", [this](const std::string&) {
|
||||
@@ -286,6 +308,58 @@ namespace ZL {
|
||||
});
|
||||
}
|
||||
|
||||
void MenuManager::openPhoneBank() {
|
||||
uiManager.pushMenuFromSavedRoot(phoneBankRoot);
|
||||
|
||||
uiManager.setButtonCallback("phoneExitButton", [this](const std::string&) {
|
||||
closePhoneEntirely();
|
||||
});
|
||||
uiManager.setButtonCallback("buttonBack", [this](const std::string&) {
|
||||
uiManager.popMenu();
|
||||
});
|
||||
}
|
||||
|
||||
void MenuManager::openPhoneVideo() {
|
||||
uiManager.pushMenuFromSavedRoot(phoneVideoRoot);
|
||||
|
||||
uiManager.setButtonCallback("phoneExitButton", [this](const std::string&) {
|
||||
closePhoneEntirely();
|
||||
});
|
||||
uiManager.setButtonCallback("buttonBack", [this](const std::string&) {
|
||||
uiManager.popMenu();
|
||||
});
|
||||
uiManager.setButtonCallback("videoSkip", [this](const std::string&) {
|
||||
// TODO: trigger time-skip game feature
|
||||
closePhoneEntirely();
|
||||
});
|
||||
}
|
||||
|
||||
void MenuManager::openPhoneTaxi() {
|
||||
if (currentLocationName_ == "uni_interior") {
|
||||
closePhoneEntirely();
|
||||
if (startDialogueFunc) startDialogueFunc("dialog_taxi003");
|
||||
} else if (currentLocationName_ == "uni_exterior") {
|
||||
openPhoneMapScreen(phoneMapUniRoot);
|
||||
} else {
|
||||
openPhoneMapScreen(phoneMapDormRoot);
|
||||
}
|
||||
}
|
||||
|
||||
void MenuManager::openPhoneMapScreen(std::shared_ptr<UiNode> mapRoot) {
|
||||
uiManager.pushMenuFromSavedRoot(mapRoot);
|
||||
|
||||
uiManager.setButtonCallback("phoneExitButton", [this](const std::string&) {
|
||||
closePhoneEntirely();
|
||||
});
|
||||
uiManager.setButtonCallback("buttonBack", [this](const std::string&) {
|
||||
uiManager.popMenu();
|
||||
});
|
||||
uiManager.setButtonCallback("mapGo", [this](const std::string&) {
|
||||
closePhoneEntirely();
|
||||
if (startDialogueFunc) startDialogueFunc("dialog_taxi002");
|
||||
});
|
||||
}
|
||||
|
||||
void MenuManager::openPhoneChatFromList(std::shared_ptr<UiNode> chatRoot, const std::string& dialogueId) {
|
||||
phoneChatVisibleBubbles_.clear();
|
||||
uiManager.pushMenuFromSavedRoot(chatRoot);
|
||||
@@ -314,17 +388,19 @@ namespace ZL {
|
||||
uiManager.popMenu();
|
||||
}
|
||||
|
||||
void MenuManager::closePhoneScreenFromChat() {
|
||||
void MenuManager::closePhoneEntirely() {
|
||||
state = GameState::Gameplay;
|
||||
phoneChatVisibleBubbles_.clear();
|
||||
uiManager.popMenu();
|
||||
uiManager.popMenu();
|
||||
const int depth = uiManager.menuStackSize();
|
||||
for (int i = 0; i < depth; ++i) uiManager.popMenu();
|
||||
}
|
||||
|
||||
void MenuManager::closePhoneScreenFromChat() {
|
||||
closePhoneEntirely();
|
||||
}
|
||||
|
||||
void MenuManager::closePhoneScreen() {
|
||||
state = GameState::Gameplay;
|
||||
phoneChatVisibleBubbles_.clear();
|
||||
uiManager.popMenu();
|
||||
closePhoneEntirely();
|
||||
}
|
||||
|
||||
// Registers phoneButton / journalButton callbacks on the current HUD root
|
||||
|
||||
Reference in new issue
Block a user