From 6352e8e3196f78388b6c771073f9e03eaa612673 Mon Sep 17 00:00:00 2001 From: Kae <80987908+Novaenia@users.noreply.github.com> Date: Tue, 20 Jun 2023 14:33:09 +1000 Subject: everything everywhere all at once --- source/frontend/StarScriptPane.hpp | 49 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 source/frontend/StarScriptPane.hpp (limited to 'source/frontend/StarScriptPane.hpp') diff --git a/source/frontend/StarScriptPane.hpp b/source/frontend/StarScriptPane.hpp new file mode 100644 index 0000000..1ba7ea0 --- /dev/null +++ b/source/frontend/StarScriptPane.hpp @@ -0,0 +1,49 @@ +#ifndef STAR_SCRIPT_PANE_HPP +#define STAR_SCRIPT_PANE_HPP + +#include "StarPane.hpp" +#include "StarLuaComponents.hpp" +#include "StarGuiReader.hpp" + +namespace Star { + +STAR_CLASS(CanvasWidget); +STAR_CLASS(ScriptPane); +STAR_CLASS(UniverseClient); + +class ScriptPane : public Pane { +public: + ScriptPane(UniverseClientPtr client, Json config, EntityId sourceEntityId = NullEntityId); + + void displayed() override; + void dismissed() override; + + void tick() override; + + bool sendEvent(InputEvent const& event) override; + + PanePtr createTooltip(Vec2I const& screenPosition) override; + Maybe cursorOverride(Vec2I const& screenPosition) override; + + bool openWithInventory() const; + +private: + LuaCallbacks makePaneCallbacks(); + + UniverseClientPtr m_client; + EntityId m_sourceEntityId; + Json m_config; + + GuiReader m_reader; + + Map m_canvasClickCallbacks; + Map m_canvasKeyCallbacks; + + LuaWorldComponent> m_script; + + List> m_playingSounds; +}; + +} + +#endif -- cgit v1.2.3