From c923f4f13b1cade968bb6fec585a242b62d35715 Mon Sep 17 00:00:00 2001 From: Kae <80987908+Novaenia@users.noreply.github.com> Date: Tue, 4 Jul 2023 22:36:27 +1000 Subject: pane lua stuff --- source/frontend/StarScriptPane.cpp | 19 ++----------------- 1 file changed, 2 insertions(+), 17 deletions(-) (limited to 'source/frontend/StarScriptPane.cpp') diff --git a/source/frontend/StarScriptPane.cpp b/source/frontend/StarScriptPane.cpp index b09211d..3de3c26 100644 --- a/source/frontend/StarScriptPane.cpp +++ b/source/frontend/StarScriptPane.cpp @@ -48,25 +48,10 @@ void ScriptPane::dismissed() { } void ScriptPane::tick() { - BaseScriptPane::tick(); - if (m_sourceEntityId != NullEntityId && !m_client->worldClient()->playerCanReachEntity(m_sourceEntityId)) dismiss(); - for (auto p : m_canvasClickCallbacks) { - for (auto const& clickEvent : p.first->pullClickEvents()) - m_script.invoke(p.second, jsonFromVec2I(clickEvent.position), (uint8_t)clickEvent.button, clickEvent.buttonDown); - } - for (auto p : m_canvasKeyCallbacks) { - for (auto const& keyEvent : p.first->pullKeyEvents()) - m_script.invoke(p.second, (int)keyEvent.key, keyEvent.keyDown); - } - - m_playingSounds.filter([](pair const& p) { - return p.second->finished() == false; - }); - - m_script.update(m_script.updateDt()); + BaseScriptPane::tick(); } PanePtr ScriptPane::createTooltip(Vec2I const& screenPosition) { @@ -76,7 +61,7 @@ PanePtr ScriptPane::createTooltip(Vec2I const& screenPosition) { return SimpleTooltipBuilder::buildTooltip(result->toString()); } else { PanePtr tooltip = make_shared(); - m_reader.construct(*result, tooltip.get()); + m_reader->construct(*result, tooltip.get()); return tooltip; } } else { -- cgit v1.2.3