Working on state for location

This commit is contained in:
Vladislav Khorev committed 2026-06-18 21:48:27 +03:00
1 parent e0968b5522
commit b01e970554
13 files changed
+494 -101

No files matched your search

+17 -17
View File
@@ -422,13 +422,13 @@ namespace ZL
menuManager.tutorialShowTaxiHint();
};
locations["location_dorm"]->tutorialInteractiveObjectsLocked = true;
locations["location_dorm"]->state.tutorialInteractiveObjectsLocked = true;
menuManager.tutorialUnlockInteractiveObjectsFunc = [this]()
{
if (locations["location_dorm"])
{
locations["location_dorm"]->tutorialInteractiveObjectsLocked = false;
locations["location_dorm"]->state.tutorialInteractiveObjectsLocked = false;
}
};
@@ -466,10 +466,10 @@ namespace ZL
currentLocation->player->state.facingAngle = destRotY;
currentLocation->player->state.targetFacingAngle = destRotY;
}
currentLocation->cameraAzimuth = destRotY;
currentLocation->isDarklands = isDarklands;
currentLocation->isNight = menuManager.isNight;
currentLocation->isDawn = menuManager.isDawn;
currentLocation->state.cameraAzimuth = destRotY;
currentLocation->state.isDarklands = isDarklands;
currentLocation->state.isNight = menuManager.isNight;
currentLocation->state.isDawn = menuManager.isDawn;
currentLocation->scriptEngine.callLocationEnterCallback();
@@ -638,9 +638,9 @@ namespace ZL
if (currentLocation)
{
// Sync global flags so Location's draw functions see them.
currentLocation->isDarklands = isDarklands;
currentLocation->isNight = menuManager.isNight;
currentLocation->isDawn = menuManager.isDawn;
currentLocation->state.isDarklands = isDarklands;
currentLocation->state.isNight = menuManager.isNight;
currentLocation->state.isDawn = menuManager.isDawn;
if (isDarklands) {
currentLocation->drawGameDarklands();
@@ -1071,8 +1071,8 @@ namespace ZL
//x = x - 1;
//std::cout << "current x: " << x << std::endl;
std::cout << "Azimuth: " << currentLocation->cameraAzimuth << std::endl;
std::cout << "Inclination: " << currentLocation->cameraInclination << std::endl;
std::cout << "Azimuth: " << currentLocation->state.cameraAzimuth << std::endl;
std::cout << "Inclination: " << currentLocation->state.cameraInclination << std::endl;
break;
case SDLK_c:
@@ -1177,8 +1177,8 @@ namespace ZL
currentLocation->lastMouseY = eventY;
// Snapshot current angles so we can measure how far the user rotates.
dragStartAzimuth = currentLocation->cameraAzimuth;
dragStartInclination = currentLocation->cameraInclination;
dragStartAzimuth = currentLocation->state.cameraAzimuth;
dragStartInclination = currentLocation->state.cameraInclination;
}
}
@@ -1383,8 +1383,8 @@ namespace ZL
static constexpr float TUTORIAL_ROTATION_THRESHOLD = 0.15f;
if (cameraDragging
&& menuManager.tutorialStep == TutorialStep::Step1) {
float deltaAz = std::abs(currentLocation->cameraAzimuth - dragStartAzimuth);
float deltaInc = std::abs(currentLocation->cameraInclination - dragStartInclination);
float deltaAz = std::abs(currentLocation->state.cameraAzimuth - dragStartAzimuth);
float deltaInc = std::abs(currentLocation->state.cameraInclination - dragStartInclination);
if (deltaAz >= TUTORIAL_ROTATION_THRESHOLD && deltaInc >= TUTORIAL_ROTATION_THRESHOLD) {
menuManager.advanceTutorialStep();
}
@@ -1438,7 +1438,7 @@ namespace ZL
if (currentLocation)
{
//currentLocation->dialogueSystem.startDialogue("dialog_video001");
currentLocation->isNight = menuManager.isNight;
currentLocation->state.isNight = menuManager.isNight;
currentLocation->scriptEngine.callTriggerNightEnterCallback();
}
} else {
@@ -1448,7 +1448,7 @@ namespace ZL
menuManager.setDarklandsMode(isDarklands);
if (currentLocation) {
currentLocation->isDarklands = isDarklands;
currentLocation->state.isDarklands = isDarklands;
if (isDarklands)
currentLocation->scriptEngine.callDarklandsEnterCallback();
else