diff options
Diffstat (limited to 'source/frontend/StarInterfaceLuaBindings.cpp')
-rw-r--r-- | source/frontend/StarInterfaceLuaBindings.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/source/frontend/StarInterfaceLuaBindings.cpp b/source/frontend/StarInterfaceLuaBindings.cpp index a9257aa..65bcd68 100644 --- a/source/frontend/StarInterfaceLuaBindings.cpp +++ b/source/frontend/StarInterfaceLuaBindings.cpp @@ -3,6 +3,7 @@ #include "StarJsonExtra.hpp" #include "StarLuaGameConverters.hpp" #include "StarMainInterface.hpp" +#include "StarGuiContext.hpp" namespace Star { @@ -15,6 +16,17 @@ LuaCallbacks LuaBindings::makeInterfaceCallbacks(MainInterface* mainInterface) { return {}; }); + + callbacks.registerCallback("bindRegisteredPane", [mainInterface](String const& registeredPaneName) -> Maybe<LuaCallbacks> { + if (auto pane = mainInterface->paneManager()->maybeRegisteredPane(MainInterfacePanesNames.getLeft(registeredPaneName))) + return pane->makePaneCallbacks(); + return {}; + }); + + callbacks.registerCallback("scale", [mainInterface]() -> int { + return GuiContext::singleton().interfaceScale(); + }); + return callbacks; } |