From 4b0bc220e4da1173f742a4973939b139bef562db Mon Sep 17 00:00:00 2001 From: Kae <80987908+Novaenia@users.noreply.github.com> Date: Fri, 21 Jul 2023 00:58:49 +1000 Subject: Support for changing the game's timescale Context-specific (like per-world) timescales can also be added later --- source/frontend/StarAiInterface.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'source/frontend/StarAiInterface.cpp') diff --git a/source/frontend/StarAiInterface.cpp b/source/frontend/StarAiInterface.cpp index d9a543a..599b829 100644 --- a/source/frontend/StarAiInterface.cpp +++ b/source/frontend/StarAiInterface.cpp @@ -98,21 +98,21 @@ AiInterface::AiInterface(UniverseClientPtr client, CinematicPtr cinematic, MainI m_defaultRecruitDescription = assets->json("/interface/ai/ai.config:defaultRecruitDescription").toString(); } -void AiInterface::update() { +void AiInterface::update(float dt) { if (!m_client->playerOnOwnShip()) dismiss(); - Pane::update(); + Pane::update(dt); m_showCrewButton->setVisibility(m_currentPage == AiPages::StatusPage); m_showMissionsButton->setVisibility(m_currentPage == AiPages::StatusPage); m_backButton->setVisibility(m_currentPage != AiPages::StatusPage); - m_staticAnimation.update(WorldTimestep); - m_scanlineAnimation.update(WorldTimestep); + m_staticAnimation.update(dt); + m_scanlineAnimation.update(dt); if (m_currentSpeech) { - m_textLength += m_currentSpeech->speedModifier * m_aiDatabase->charactersPerSecond() * WorldTimestep; + m_textLength += m_currentSpeech->speedModifier * m_aiDatabase->charactersPerSecond() * dt; m_currentTextWidget->setText(m_currentSpeech->text); m_currentTextWidget->setTextCharLimit(min(m_textMaxLength, floor(m_textLength))); @@ -129,10 +129,10 @@ void AiInterface::update() { if (m_chatterSound) m_chatterSound->stop(); } - m_faceAnimation.second.update(WorldTimestep * m_currentSpeech->speedModifier); + m_faceAnimation.second.update(dt * m_currentSpeech->speedModifier); } else { setFaceAnimation("idle"); - m_faceAnimation.second.update(WorldTimestep); + m_faceAnimation.second.update(dt); if (m_chatterSound) m_chatterSound->stop(); } -- cgit v1.2.3