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

summaryrefslogtreecommitdiff
path: root/source/client
diff options
context:
space:
mode:
authorKae <80987908+Novaenia@users.noreply.github.com>2023-07-18 17:36:51 +1000
committerKae <80987908+Novaenia@users.noreply.github.com>2023-07-18 17:36:51 +1000
commit6e1d29fe861ef5a81c5458cd8ae68d09f36e28c3 (patch)
tree36fb8a412649f1e749e2b9fc0268e80bc05251fb /source/client
parent34bb0b54222c1c0f3450c56e76f89f192d77374b (diff)
Provide speaker info to HUD indicators
Diffstat (limited to 'source/client')
-rw-r--r--source/client/StarClientApplication.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/source/client/StarClientApplication.cpp b/source/client/StarClientApplication.cpp
index 9de1642..cee7dec 100644
--- a/source/client/StarClientApplication.cpp
+++ b/source/client/StarClientApplication.cpp
@@ -20,6 +20,7 @@
#include "StarInterfaceLuaBindings.hpp"
#include "StarInputLuaBindings.hpp"
+#include "StarVoiceLuaBindings.hpp"
namespace Star {
@@ -496,6 +497,7 @@ void ClientApplication::changeState(MainAppState newState) {
m_statistics = make_shared<Statistics>(m_root->toStoragePath("player"), appController()->statisticsService());
m_universeClient = make_shared<UniverseClient>(m_playerStorage, m_statistics);
m_universeClient->setLuaCallbacks("input", LuaBindings::makeInputCallbacks());
+ m_universeClient->setLuaCallbacks("voice", LuaBindings::makeVoiceCallbacks(m_voice.get()));
m_mainMixer->setUniverseClient(m_universeClient);
m_titleScreen = make_shared<TitleScreen>(m_playerStorage, m_mainMixer->mixer());
@@ -888,6 +890,11 @@ void ClientApplication::updateRunning() {
auto broadcast = strf("data\0voice\0{}{}"s, signatureView, audioDataView);
worldClient->sendSecretBroadcast(broadcast, true);
}
+ if (auto mainPlayer = m_universeClient->mainPlayer()) {
+ auto localSpeaker = m_voice->localSpeaker();
+ localSpeaker->entityId = mainPlayer->entityId();
+ localSpeaker->name = mainPlayer->name();
+ }
m_voice->setLocalSpeaker(worldClient->connection());
}
worldClient->setInteractiveHighlightMode(isActionTaken(InterfaceAction::ShowLabels));