From 9486a56508bf22f46c62b0b71ea81e104e30e0b8 Mon Sep 17 00:00:00 2001 From: Kae <80987908+Novaenia@users.noreply.github.com> Date: Thu, 29 Jun 2023 00:13:43 +1000 Subject: [PATCH] Add base variables for warping cinematics I literally only did this because I have an ultra-wide monitor and the letterboxing bothered me --- assets/opensb/client.config.patch | 11 +++++++++++ source/game/StarUniverseClient.cpp | 15 ++++++++------- 2 files changed, 19 insertions(+), 7 deletions(-) create mode 100644 assets/opensb/client.config.patch diff --git a/assets/opensb/client.config.patch b/assets/opensb/client.config.patch new file mode 100644 index 0000000..88bf328 --- /dev/null +++ b/assets/opensb/client.config.patch @@ -0,0 +1,11 @@ +{ + // Disables scissoring and letterboxing on vanilla and modded warp cinematics + "warpCinematicBase" : { + "scissor" : false, + "letterbox" : false + }, + "deployCinematicBase" : { + "scissor" : false, + "letterbox" : false + } +} \ No newline at end of file diff --git a/source/game/StarUniverseClient.cpp b/source/game/StarUniverseClient.cpp index 9b26416..e025517 100644 --- a/source/game/StarUniverseClient.cpp +++ b/source/game/StarUniverseClient.cpp @@ -183,13 +183,14 @@ void UniverseClient::update() { m_warpDelay.reset(); if (m_warping) { m_warpCinemaCancelTimer = GameTimer(assets->json("/client.config:playerWarpCinemaMinimumTime").toFloat()); - String cinematic; - if (m_mainPlayer->isDeploying()) - cinematic = assets->json("/client.config:deployCinematic").toString(); - else - cinematic = assets->json("/client.config:warpCinematic").toString(); - cinematic = cinematic.replaceTags(StringMap{{"species", m_mainPlayer->species()}}); - m_mainPlayer->setPendingCinematic(Json(move(cinematic))); + + bool isDeploying = m_mainPlayer->isDeploying(); + String cinematicJsonPath = isDeploying ? "/client.config:deployCinematic" : "/client.config:warpCinematic"; + String cinematicAssetPath = assets->json(cinematicJsonPath).toString() + .replaceTags(StringMap{{"species", m_mainPlayer->species()}}); + + Json cinematic = jsonMerge(assets->json(cinematicJsonPath + "Base"), assets->json(cinematicAssetPath)); + m_mainPlayer->setPendingCinematic(cinematic); } } }