Веб-сайт самохостера Lotigara

summaryrefslogtreecommitdiff
path: root/source/frontend/StarAiInterface.cpp
diff options
context:
space:
mode:
authorKae <80987908+Novaenia@users.noreply.github.com>2023-07-21 00:58:49 +1000
committerKae <80987908+Novaenia@users.noreply.github.com>2023-07-21 00:58:49 +1000
commit4b0bc220e4da1173f742a4973939b139bef562db (patch)
tree0ff66d5957575fa814fc10b8cd93e3dd378f45dc /source/frontend/StarAiInterface.cpp
parent607be749451aa40e3619e7ceab0927d1fcec8233 (diff)
Support for changing the game's timescale
Context-specific (like per-world) timescales can also be added later
Diffstat (limited to 'source/frontend/StarAiInterface.cpp')
-rw-r--r--source/frontend/StarAiInterface.cpp14
1 files changed, 7 insertions, 7 deletions
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();
}