22 lines
546 B
C++
22 lines
546 B
C++
|
#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;
|
||
|
}
|
||
|
|
||
|
}
|