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(m_root->toStoragePath("player")); 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_mainMixer->setUniverseClient(m_universeClient); m_titleScreen = make_shared(m_playerStorage, m_mainMixer->mixer()); @@ -601,6 +603,7 @@ void ClientApplication::changeState(MainAppState newState) { m_worldPainter = make_shared(); m_mainInterface = make_shared(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::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 void LuaWorldComponent::uninit() { Base::uninit(); Base::removeCallbacks("world"); - - Base::removeCallbacks("input"); } template