Веб-сайт самохостера Lotigara

summaryrefslogtreecommitdiff
path: root/source/frontend/StarInterfaceLuaBindings.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'source/frontend/StarInterfaceLuaBindings.cpp')
-rw-r--r--source/frontend/StarInterfaceLuaBindings.cpp21
1 files changed, 21 insertions, 0 deletions
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<CanvasWidgetPtr> {
+ if (auto canvas = mainInterface->fetchCanvas(canvasName))
+ return canvas;
+ return {};
+ });
+
+ return callbacks;
+}
+
+}