From 6e1d29fe861ef5a81c5458cd8ae68d09f36e28c3 Mon Sep 17 00:00:00 2001 From: Kae <80987908+Novaenia@users.noreply.github.com> Date: Tue, 18 Jul 2023 17:36:51 +1000 Subject: Provide speaker info to HUD indicators --- source/client/StarClientApplication.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'source/client/StarClientApplication.cpp') 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(m_root->toStoragePath("player"), appController()->statisticsService()); m_universeClient = make_shared(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(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)); -- cgit v1.2.3