diff options
author | Kae <80987908+Novaenia@users.noreply.github.com> | 2023-06-20 14:33:09 +1000 |
---|---|---|
committer | Kae <80987908+Novaenia@users.noreply.github.com> | 2023-06-20 14:33:09 +1000 |
commit | 6352e8e3196f78388b6c771073f9e03eaa612673 (patch) | |
tree | e23772f79a7fbc41bc9108951e9e136857484bf4 /source/frontend/StarScriptPane.hpp | |
parent | 6741a057e5639280d85d0f88ba26f000baa58f61 (diff) |
everything everywhere
all at once
Diffstat (limited to 'source/frontend/StarScriptPane.hpp')
-rw-r--r-- | source/frontend/StarScriptPane.hpp | 49 |
1 files changed, 49 insertions, 0 deletions
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<String> cursorOverride(Vec2I const& screenPosition) override; + + bool openWithInventory() const; + +private: + LuaCallbacks makePaneCallbacks(); + + UniverseClientPtr m_client; + EntityId m_sourceEntityId; + Json m_config; + + GuiReader m_reader; + + Map<CanvasWidgetPtr, String> m_canvasClickCallbacks; + Map<CanvasWidgetPtr, String> m_canvasKeyCallbacks; + + LuaWorldComponent<LuaUpdatableComponent<LuaBaseComponent>> m_script; + + List<pair<String, AudioInstancePtr>> m_playingSounds; +}; + +} + +#endif |