Working on phone
This commit is contained in:
parent
7a02665305
commit
1b1ceac2fe
@ -318,6 +318,24 @@
|
|||||||
"type": "End"
|
"type": "End"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "dialog_taxi002",
|
||||||
|
"start": "line_1",
|
||||||
|
"nodes": [
|
||||||
|
{
|
||||||
|
"id": "line_1",
|
||||||
|
"type": "Line",
|
||||||
|
"speaker": "Бекзат",
|
||||||
|
"portrait": "resources/dialogue/portrait_hero_neutral.png",
|
||||||
|
"text": "Я заказал такси до универа, машина уже ждет!",
|
||||||
|
"next": "end_1"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "end_1",
|
||||||
|
"type": "End"
|
||||||
|
}
|
||||||
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": "dialog_second_floor001",
|
"id": "dialog_second_floor001",
|
||||||
|
|||||||
@ -27,7 +27,7 @@
|
|||||||
"type": "Line",
|
"type": "Line",
|
||||||
"speaker": "Бекзат",
|
"speaker": "Бекзат",
|
||||||
"portrait": "resources/dialogue/portrait_hero_neutral.png",
|
"portrait": "resources/dialogue/portrait_hero_neutral.png",
|
||||||
"text": "Это мусорный контейнер, я не буду в нем копаться!",
|
"text": "Это куча строительного мусора, я не буду в ней копаться!",
|
||||||
"next": "end_1"
|
"next": "end_1"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -69,7 +69,61 @@
|
|||||||
"type": "End"
|
"type": "End"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
},
|
||||||
|
{
|
||||||
|
"id": "dialog_contaier003",
|
||||||
|
"start": "line_1",
|
||||||
|
"nodes": [
|
||||||
|
{
|
||||||
|
"id": "line_1",
|
||||||
|
"type": "Line",
|
||||||
|
"speaker": "Бекзат",
|
||||||
|
"portrait": "resources/dialogue/portrait_hero_neutral.png",
|
||||||
|
"text": "Я уже нашел в этой куче мусора то, что мне нужно.",
|
||||||
|
"next": "end_1"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "end_1",
|
||||||
|
"type": "End"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "dialog_taxi001",
|
||||||
|
"start": "line_1",
|
||||||
|
"nodes": [
|
||||||
|
{
|
||||||
|
"id": "line_1",
|
||||||
|
"type": "Line",
|
||||||
|
"speaker": "Бекзат",
|
||||||
|
"portrait": "resources/dialogue/portrait_hero_neutral.png",
|
||||||
|
"text": "Прежде чем выходить за ворота, я должен заказать такси до общаги.",
|
||||||
|
"next": "end_1"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "end_1",
|
||||||
|
"type": "End"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "dialog_taxi002",
|
||||||
|
"start": "line_1",
|
||||||
|
"nodes": [
|
||||||
|
{
|
||||||
|
"id": "line_1",
|
||||||
|
"type": "Line",
|
||||||
|
"speaker": "Бекзат",
|
||||||
|
"portrait": "resources/dialogue/portrait_hero_neutral.png",
|
||||||
|
"text": "Я заказал такси до общаги, машина уже ждет!",
|
||||||
|
"next": "end_1"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "end_1",
|
||||||
|
"type": "End"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
],
|
],
|
||||||
"cutscenes": [
|
"cutscenes": [
|
||||||
{
|
{
|
||||||
|
|||||||
@ -1083,6 +1083,24 @@
|
|||||||
"type": "End"
|
"type": "End"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "dialog_taxi003",
|
||||||
|
"start": "line_1",
|
||||||
|
"nodes": [
|
||||||
|
{
|
||||||
|
"id": "line_1",
|
||||||
|
"type": "Line",
|
||||||
|
"speaker": "Бекзат",
|
||||||
|
"portrait": "resources/dialogue/portrait_hero_neutral.png",
|
||||||
|
"text": "Чтобы заказать такси, я сначала должен выйти на улицу.",
|
||||||
|
"next": "end_1"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "end_1",
|
||||||
|
"type": "End"
|
||||||
|
}
|
||||||
|
]
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"cutscenes": [
|
"cutscenes": [
|
||||||
|
|||||||
@ -89,9 +89,11 @@ namespace ZL {
|
|||||||
hudUniExtDarkRoot = loadUiFromFile("resources/w/ui/hud_uni_ext_dark.json", renderer, zipFile);
|
hudUniExtDarkRoot = loadUiFromFile("resources/w/ui/hud_uni_ext_dark.json", renderer, zipFile);
|
||||||
|
|
||||||
|
|
||||||
//phoneChatListRoot = loadUiFromFile("resources/w/ui/screen_phone_bank.json", renderer, zipFile);
|
phoneMainRoot = loadUiFromFile("resources/w/ui/screen_phone.json", renderer, zipFile);
|
||||||
//phoneChatListRoot = loadUiFromFile("resources/w/ui/screen_phone_map_dorm.json", renderer, zipFile);
|
phoneBankRoot = loadUiFromFile("resources/w/ui/screen_phone_bank.json", renderer, zipFile);
|
||||||
//phoneChatListRoot = loadUiFromFile("resources/w/ui/screen_phone_video.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);
|
phoneChatListRoot = loadUiFromFile("resources/w/ui/screen_phone_chat_list.json", renderer, zipFile);
|
||||||
phoneChat1Root = loadUiFromFile("resources/w/ui/screen_phone_chat1.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);
|
phoneChat2Root = loadUiFromFile("resources/w/ui/screen_phone_chat2.json", renderer, zipFile);
|
||||||
@ -269,10 +271,30 @@ namespace ZL {
|
|||||||
state = GameState::PhoneScreen;
|
state = GameState::PhoneScreen;
|
||||||
tutorialPhoneScreenOpened = true;
|
tutorialPhoneScreenOpened = true;
|
||||||
uiManager.setNodeVisible("hint6a", false);
|
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.pushMenuFromSavedRoot(phoneChatListRoot);
|
||||||
|
|
||||||
uiManager.setButtonCallback("phoneExitButton", [this](const std::string&) {
|
uiManager.setButtonCallback("phoneExitButton", [this](const std::string&) {
|
||||||
closePhoneScreen();
|
closePhoneEntirely();
|
||||||
});
|
});
|
||||||
uiManager.setButtonCallback("phoneMain", [this](const std::string&) {});
|
uiManager.setButtonCallback("phoneMain", [this](const std::string&) {});
|
||||||
uiManager.setTextButtonCallback("chat1button", [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) {
|
void MenuManager::openPhoneChatFromList(std::shared_ptr<UiNode> chatRoot, const std::string& dialogueId) {
|
||||||
phoneChatVisibleBubbles_.clear();
|
phoneChatVisibleBubbles_.clear();
|
||||||
uiManager.pushMenuFromSavedRoot(chatRoot);
|
uiManager.pushMenuFromSavedRoot(chatRoot);
|
||||||
@ -314,17 +388,19 @@ namespace ZL {
|
|||||||
uiManager.popMenu();
|
uiManager.popMenu();
|
||||||
}
|
}
|
||||||
|
|
||||||
void MenuManager::closePhoneScreenFromChat() {
|
void MenuManager::closePhoneEntirely() {
|
||||||
state = GameState::Gameplay;
|
state = GameState::Gameplay;
|
||||||
phoneChatVisibleBubbles_.clear();
|
phoneChatVisibleBubbles_.clear();
|
||||||
uiManager.popMenu();
|
const int depth = uiManager.menuStackSize();
|
||||||
uiManager.popMenu();
|
for (int i = 0; i < depth; ++i) uiManager.popMenu();
|
||||||
|
}
|
||||||
|
|
||||||
|
void MenuManager::closePhoneScreenFromChat() {
|
||||||
|
closePhoneEntirely();
|
||||||
}
|
}
|
||||||
|
|
||||||
void MenuManager::closePhoneScreen() {
|
void MenuManager::closePhoneScreen() {
|
||||||
state = GameState::Gameplay;
|
closePhoneEntirely();
|
||||||
phoneChatVisibleBubbles_.clear();
|
|
||||||
uiManager.popMenu();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Registers phoneButton / journalButton callbacks on the current HUD root
|
// Registers phoneButton / journalButton callbacks on the current HUD root
|
||||||
|
|||||||
@ -55,6 +55,7 @@ namespace ZL {
|
|||||||
void closePhoneScreen();
|
void closePhoneScreen();
|
||||||
void revealPhoneChatBubble(const std::string& slotName);
|
void revealPhoneChatBubble(const std::string& slotName);
|
||||||
bool isPhoneScreenOpen() const { return state == GameState::PhoneScreen; }
|
bool isPhoneScreenOpen() const { return state == GameState::PhoneScreen; }
|
||||||
|
void closePhoneEntirely();
|
||||||
|
|
||||||
std::function<void(const std::string&)> startDialogueFunc;
|
std::function<void(const std::string&)> startDialogueFunc;
|
||||||
std::function<void()> startDarklandsTransitionFunc;
|
std::function<void()> startDarklandsTransitionFunc;
|
||||||
@ -82,6 +83,11 @@ namespace ZL {
|
|||||||
void refreshItemPickupHud();
|
void refreshItemPickupHud();
|
||||||
void setupStep5Callbacks();
|
void setupStep5Callbacks();
|
||||||
void setupGameplayHudCallbacks();
|
void setupGameplayHudCallbacks();
|
||||||
|
void openPhoneMessenger();
|
||||||
|
void openPhoneBank();
|
||||||
|
void openPhoneVideo();
|
||||||
|
void openPhoneTaxi();
|
||||||
|
void openPhoneMapScreen(std::shared_ptr<UiNode> mapRoot);
|
||||||
void resetPhoneChatNodes();
|
void resetPhoneChatNodes();
|
||||||
void recomputePhoneChatPositions();
|
void recomputePhoneChatPositions();
|
||||||
void openPhoneChatFromList(std::shared_ptr<UiNode> chatRoot, const std::string& dialogueId);
|
void openPhoneChatFromList(std::shared_ptr<UiNode> chatRoot, const std::string& dialogueId);
|
||||||
@ -120,6 +126,11 @@ namespace ZL {
|
|||||||
std::shared_ptr<UiNode> hudUniIntStep13Root;
|
std::shared_ptr<UiNode> hudUniIntStep13Root;
|
||||||
std::shared_ptr<UiNode> hudUniIntDarkFullRoot;
|
std::shared_ptr<UiNode> hudUniIntDarkFullRoot;
|
||||||
std::shared_ptr<UiNode> hudUniExtDarkRoot;
|
std::shared_ptr<UiNode> hudUniExtDarkRoot;
|
||||||
|
std::shared_ptr<UiNode> phoneMainRoot;
|
||||||
|
std::shared_ptr<UiNode> phoneBankRoot;
|
||||||
|
std::shared_ptr<UiNode> phoneVideoRoot;
|
||||||
|
std::shared_ptr<UiNode> phoneMapDormRoot;
|
||||||
|
std::shared_ptr<UiNode> phoneMapUniRoot;
|
||||||
std::shared_ptr<UiNode> phoneChatListRoot;
|
std::shared_ptr<UiNode> phoneChatListRoot;
|
||||||
std::shared_ptr<UiNode> phoneChat1Root;
|
std::shared_ptr<UiNode> phoneChat1Root;
|
||||||
std::shared_ptr<UiNode> phoneChat2Root;
|
std::shared_ptr<UiNode> phoneChat2Root;
|
||||||
|
|||||||
@ -1321,6 +1321,10 @@ namespace ZL {
|
|||||||
menuStack.clear();
|
menuStack.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int UiManager::menuStackSize() const {
|
||||||
|
return static_cast<int>(menuStack.size());
|
||||||
|
}
|
||||||
|
|
||||||
void UiManager::draw(Renderer& renderer) {
|
void UiManager::draw(Renderer& renderer) {
|
||||||
renderer.PushProjectionMatrix(Environment::projectionWidth, Environment::projectionHeight, -1, 1);
|
renderer.PushProjectionMatrix(Environment::projectionWidth, Environment::projectionHeight, -1, 1);
|
||||||
renderer.PushMatrix();
|
renderer.PushMatrix();
|
||||||
|
|||||||
@ -407,6 +407,7 @@ namespace ZL {
|
|||||||
bool pushMenuFromSavedRoot(std::shared_ptr<UiNode> newRoot);
|
bool pushMenuFromSavedRoot(std::shared_ptr<UiNode> newRoot);
|
||||||
bool popMenu();
|
bool popMenu();
|
||||||
void clearMenuStack();
|
void clearMenuStack();
|
||||||
|
int menuStackSize() const;
|
||||||
|
|
||||||
void update(float deltaMs);
|
void update(float deltaMs);
|
||||||
void startAnimation(const std::string& animName);
|
void startAnimation(const std::string& animName);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user