diff options
author | Kae <80987908+Novaenia@users.noreply.github.com> | 2023-07-04 19:27:16 +1000 |
---|---|---|
committer | Kae <80987908+Novaenia@users.noreply.github.com> | 2023-07-04 19:27:16 +1000 |
commit | e3461e90531345650fe70ada38d875a68f87f416 (patch) | |
tree | 41b923b02ca8dbac1b075654052c972545aab16e /source/frontend/StarInterfaceLuaBindings.cpp | |
parent | ab72b03ad8679437ebf01ead65d9f0d3195e6bae (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.cpp | 21 |
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; +} + +} |