Working on cutscene skip
This commit is contained in:
1 parent
c991b5dbc1
commit
7011bbb754
16 files changed
+112
-17
No files matched your search
+24
-4
@@ -418,6 +418,19 @@ namespace ZL
|
||||
});
|
||||
}
|
||||
|
||||
// Wire cutscene HUD: show skip button when cutscene starts, restore HUD when it ends.
|
||||
for (auto& [name, loc] : locations) {
|
||||
loc->dialogueSystem.setOnCutsceneStarted([this]() {
|
||||
menuManager.onCutsceneStarted();
|
||||
});
|
||||
loc->dialogueSystem.setOnCutsceneFinishedExtra([this](const std::string&) {
|
||||
menuManager.onCutsceneFinished();
|
||||
});
|
||||
}
|
||||
menuManager.skipCutsceneFunc = [this]() {
|
||||
if (currentLocation) currentLocation->dialogueSystem.skipCutscene();
|
||||
};
|
||||
|
||||
currentLocation = locations["location_dorm"];
|
||||
currentLocation->scriptEngine.callLocationEnterCallback();
|
||||
|
||||
@@ -498,12 +511,14 @@ namespace ZL
|
||||
renderer.RenderUniform1i(textureUniformName, 0);
|
||||
glEnable(GL_BLEND);
|
||||
|
||||
menuManager.uiManager.draw(renderer);
|
||||
if (!menuManager.cutsceneHudActive_)
|
||||
menuManager.uiManager.draw(renderer);
|
||||
if (currentLocation)
|
||||
{
|
||||
currentLocation->dialogueSystem.draw(renderer);
|
||||
}
|
||||
|
||||
glEnable(GL_BLEND);
|
||||
menuManager.topUiManager.draw(renderer);
|
||||
glDisable(GL_BLEND);
|
||||
renderer.shaderManager.PopShader();
|
||||
|
||||
@@ -619,6 +634,7 @@ namespace ZL
|
||||
updateDarklandsFlash(delta);
|
||||
|
||||
menuManager.uiManager.update(static_cast<float>(delta));
|
||||
menuManager.topUiManager.update(static_cast<float>(delta));
|
||||
|
||||
if (currentLocation)
|
||||
{
|
||||
@@ -1029,11 +1045,13 @@ namespace ZL
|
||||
|
||||
const int uiX = mx;
|
||||
const int uiY = Environment::projectionHeight - my;
|
||||
menuManager.topUiManager.onTouchDown(fingerId, uiX, uiY);
|
||||
const bool capturedByTopUi = menuManager.topUiManager.isUiInteractionForFinger(fingerId);
|
||||
const bool dialogueActive = currentLocation && currentLocation->dialogueSystem.isActive();
|
||||
if (!dialogueActive) {
|
||||
if (!dialogueActive && !capturedByTopUi) {
|
||||
menuManager.uiManager.onTouchDown(fingerId, uiX, uiY);
|
||||
}
|
||||
st.capturedByUi = !dialogueActive && menuManager.uiManager.isUiInteractionForFinger(fingerId);
|
||||
st.capturedByUi = capturedByTopUi || (!dialogueActive && menuManager.uiManager.isUiInteractionForFinger(fingerId));
|
||||
|
||||
activePointers[fingerId] = st;
|
||||
|
||||
@@ -1064,6 +1082,7 @@ namespace ZL
|
||||
{
|
||||
const int uiX = mx;
|
||||
const int uiY = Environment::projectionHeight - my;
|
||||
menuManager.topUiManager.onTouchUp(fingerId, uiX, uiY);
|
||||
const bool dialogueActive = currentLocation && currentLocation->dialogueSystem.isActive();
|
||||
if (!dialogueActive) {
|
||||
menuManager.uiManager.onTouchUp(fingerId, uiX, uiY);
|
||||
@@ -1108,6 +1127,7 @@ namespace ZL
|
||||
{
|
||||
const int uiX = mx;
|
||||
const int uiY = Environment::projectionHeight - my;
|
||||
menuManager.topUiManager.onTouchMove(fingerId, uiX, uiY);
|
||||
const bool dialogueActive = currentLocation && currentLocation->dialogueSystem.isActive();
|
||||
if (!dialogueActive) {
|
||||
menuManager.uiManager.onTouchMove(fingerId, uiX, uiY);
|
||||
|
||||
Reference in new issue
Block a user