diff options
author | Kae <80987908+Novaenia@users.noreply.github.com> | 2025-01-25 10:42:15 +1100 |
---|---|---|
committer | Kae <80987908+Novaenia@users.noreply.github.com> | 2025-01-25 10:42:15 +1100 |
commit | a7aa6679397563b144c016ef8712bf438cfa63df (patch) | |
tree | 8c102cbb52ed32a19e6a9005cf1752c9572fdbfd /source/client | |
parent | 93b78ec8e80b404346ee3b4781f98a4d9342863f (diff) |
Fix callbacks not being updated properly in chat scripts
Diffstat (limited to 'source/client')
-rw-r--r-- | source/client/StarClientApplication.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/source/client/StarClientApplication.cpp b/source/client/StarClientApplication.cpp index 40287b6..908d0da 100644 --- a/source/client/StarClientApplication.cpp +++ b/source/client/StarClientApplication.cpp @@ -19,6 +19,8 @@ #include "StarCurve25519.hpp" #include "StarInterpolation.hpp" +#include "StarTeamClientLuaBindings.hpp" +#include "StarCelestialLuaBindings.hpp" #include "StarInterfaceLuaBindings.hpp" #include "StarInputLuaBindings.hpp" #include "StarVoiceLuaBindings.hpp" @@ -726,12 +728,16 @@ void ClientApplication::changeState(MainAppState newState) { m_titleScreen->stopMusic(); + m_universeClient->restartLua(); m_mainInterface = make_shared<MainInterface>(m_universeClient, m_worldPainter, m_cinematicOverlay); m_universeClient->setLuaCallbacks("interface", LuaBindings::makeInterfaceCallbacks(m_mainInterface.get())); m_universeClient->setLuaCallbacks("chat", LuaBindings::makeChatCallbacks(m_mainInterface.get(), m_universeClient.get())); + m_universeClient->setLuaCallbacks("celestial", LuaBindings::makeCelestialCallbacks(m_universeClient.get())); + m_universeClient->setLuaCallbacks("team", LuaBindings::makeTeamClientCallbacks(m_universeClient->teamClient().get())); + m_universeClient->setLuaCallbacks("world", LuaBindings::makeWorldCallbacks(m_universeClient->worldClient().get())); m_mainInterface->displayDefaultPanes(); + m_universeClient->startLuaScripts(); - m_universeClient->startLua(); m_mainMixer->setWorldPainter(m_worldPainter); if (auto renderer = Application::renderer()) { |