diff options
author | Kae <80987908+Novaenia@users.noreply.github.com> | 2023-07-04 19:27:16 +1000 |
---|---|---|
committer | Kae <80987908+Novaenia@users.noreply.github.com> | 2023-07-04 19:27:16 +1000 |
commit | e3461e90531345650fe70ada38d875a68f87f416 (patch) | |
tree | 41b923b02ca8dbac1b075654052c972545aab16e /source/game/StarUniverseClient.cpp | |
parent | ab72b03ad8679437ebf01ead65d9f0d3195e6bae (diff) |
Start of Interface callbacks, starting with a bindCanvas function for the whole screen
Diffstat (limited to 'source/game/StarUniverseClient.cpp')
-rw-r--r-- | source/game/StarUniverseClient.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/source/game/StarUniverseClient.cpp b/source/game/StarUniverseClient.cpp index 783c5d3..1622518 100644 --- a/source/game/StarUniverseClient.cpp +++ b/source/game/StarUniverseClient.cpp @@ -112,6 +112,8 @@ Maybe<String> UniverseClient::connect(UniverseConnection connection, bool allowA m_mainPlayer->setClientContext(m_clientContext); m_mainPlayer->setStatistics(m_statistics); m_worldClient = make_shared<WorldClient>(m_mainPlayer); + for (auto& pair : m_luaCallbacks) + m_worldClient->setLuaCallbacks(pair.first, pair.second); m_connection = move(connection); m_celestialDatabase = make_shared<CelestialSlaveDatabase>(move(success->celestialInformation)); @@ -436,6 +438,12 @@ uint16_t UniverseClient::maxPlayers() { return m_serverInfo.apply([](auto const& info) { return info.maxPlayers; }).value(1); } +void UniverseClient::setLuaCallbacks(String const& groupName, LuaCallbacks const& callbacks) { + m_luaCallbacks[groupName] = callbacks; + if (m_worldClient) + m_worldClient->setLuaCallbacks(groupName, callbacks); +} + ClockConstPtr UniverseClient::universeClock() const { return m_universeClock; } |