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

summaryrefslogtreecommitdiff
path: root/source
diff options
context:
space:
mode:
Diffstat (limited to 'source')
-rw-r--r--source/client/StarClientApplication.cpp3
-rw-r--r--source/game/scripting/StarLuaComponents.hpp7
2 files changed, 3 insertions, 7 deletions
diff --git a/source/client/StarClientApplication.cpp b/source/client/StarClientApplication.cpp
index cb5b2de..d58ed69 100644
--- a/source/client/StarClientApplication.cpp
+++ b/source/client/StarClientApplication.cpp
@@ -16,6 +16,7 @@
#include "StarRootLoader.hpp"
#include "StarInterfaceLuaBindings.hpp"
+#include "StarInputLuaBindings.hpp"
namespace Star {
@@ -483,6 +484,7 @@ void ClientApplication::changeState(MainAppState newState) {
m_playerStorage = make_shared<PlayerStorage>(m_root->toStoragePath("player"));
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_mainMixer->setUniverseClient(m_universeClient);
m_titleScreen = make_shared<TitleScreen>(m_playerStorage, m_mainMixer->mixer());
@@ -601,6 +603,7 @@ void ClientApplication::changeState(MainAppState newState) {
m_worldPainter = make_shared<WorldPainter>();
m_mainInterface = make_shared<MainInterface>(m_universeClient, m_worldPainter, m_cinematicOverlay);
m_universeClient->setLuaCallbacks("interface", LuaBindings::makeInterfaceCallbacks(m_mainInterface.get()));
+
m_mainMixer->setWorldPainter(m_worldPainter);
if (auto renderer = Application::renderer()) {
diff --git a/source/game/scripting/StarLuaComponents.hpp b/source/game/scripting/StarLuaComponents.hpp
index ac18106..bc00309 100644
--- a/source/game/scripting/StarLuaComponents.hpp
+++ b/source/game/scripting/StarLuaComponents.hpp
@@ -283,11 +283,6 @@ void LuaWorldComponent<Base>::init(World* world) {
Base::setLuaRoot(world->luaRoot());
Base::addCallbacks("world", LuaBindings::makeWorldCallbacks(world));
-
- if (world->isClient()) {
- Base::addCallbacks("input", LuaBindings::makeInputCallbacks());
- }
-
Base::init();
}
@@ -295,8 +290,6 @@ template <typename Base>
void LuaWorldComponent<Base>::uninit() {
Base::uninit();
Base::removeCallbacks("world");
-
- Base::removeCallbacks("input");
}
template <typename Base>