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

summaryrefslogtreecommitdiff
path: root/source/frontend/StarInterfaceLuaBindings.cpp
diff options
context:
space:
mode:
authorKae <80987908+Novaenia@users.noreply.github.com>2023-07-04 19:27:16 +1000
committerKae <80987908+Novaenia@users.noreply.github.com>2023-07-04 19:27:16 +1000
commite3461e90531345650fe70ada38d875a68f87f416 (patch)
tree41b923b02ca8dbac1b075654052c972545aab16e /source/frontend/StarInterfaceLuaBindings.cpp
parentab72b03ad8679437ebf01ead65d9f0d3195e6bae (diff)
Start of Interface callbacks, starting with a bindCanvas function for the whole screen
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;
+}
+
+}