From cb19eef701b5c9e27d0464795fffcf8a4d795a21 Mon Sep 17 00:00:00 2001 From: Kae <80987908+Novaenia@users.noreply.github.com> Date: Sat, 22 Jul 2023 22:31:04 +1000 Subject: Add character swapping (no GUI yet) --- source/client/StarClientApplication.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'source/client/StarClientApplication.cpp') diff --git a/source/client/StarClientApplication.cpp b/source/client/StarClientApplication.cpp index 460c17b..5483591 100644 --- a/source/client/StarClientApplication.cpp +++ b/source/client/StarClientApplication.cpp @@ -506,9 +506,17 @@ 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_universeClient->setLuaCallbacks("voice", LuaBindings::makeVoiceCallbacks()); + m_universeClient->playerReloadCallback() = [&]() { + if (auto paneManager = m_mainInterface->paneManager()) { + if (auto inventory = paneManager->registeredPane(MainInterfacePanes::Inventory)) + inventory->clearChangedSlots(); + } + }; + m_mainMixer->setUniverseClient(m_universeClient); m_titleScreen = make_shared(m_playerStorage, m_mainMixer->mixer()); if (auto renderer = Application::renderer()) -- cgit v1.2.3