From e3461e90531345650fe70ada38d875a68f87f416 Mon Sep 17 00:00:00 2001 From: Kae <80987908+Novaenia@users.noreply.github.com> Date: Tue, 4 Jul 2023 19:27:16 +1000 Subject: Start of Interface callbacks, starting with a bindCanvas function for the whole screen --- source/frontend/StarInterfaceLuaBindings.cpp | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 source/frontend/StarInterfaceLuaBindings.cpp (limited to 'source/frontend/StarInterfaceLuaBindings.cpp') diff --git a/source/frontend/StarInterfaceLuaBindings.cpp b/source/frontend/StarInterfaceLuaBindings.cpp new file mode 100644 index 0000000..a9257aa --- /dev/null +++ b/source/frontend/StarInterfaceLuaBindings.cpp @@ -0,0 +1,21 @@ +#include "StarInterfaceLuaBindings.hpp" +#include "StarWidgetLuaBindings.hpp" +#include "StarJsonExtra.hpp" +#include "StarLuaGameConverters.hpp" +#include "StarMainInterface.hpp" + +namespace Star { + +LuaCallbacks LuaBindings::makeInterfaceCallbacks(MainInterface* mainInterface) { + LuaCallbacks callbacks; + + callbacks.registerCallback("bindCanvas", [mainInterface](String const& canvasName) -> Maybe { + if (auto canvas = mainInterface->fetchCanvas(canvasName)) + return canvas; + return {}; + }); + + return callbacks; +} + +} -- cgit v1.2.3