diff options
author | Kae <80987908+Novaenia@users.noreply.github.com> | 2023-07-04 22:36:27 +1000 |
---|---|---|
committer | Kae <80987908+Novaenia@users.noreply.github.com> | 2023-07-04 22:36:27 +1000 |
commit | c923f4f13b1cade968bb6fec585a242b62d35715 (patch) | |
tree | 94bc9f9098c007070d3644f077e6f544c4fd43a4 /source/frontend/StarInterfaceLuaBindings.cpp | |
parent | 5df9adcd0ecbf09ae2ba426b3eeab78296d370c4 (diff) |
pane lua stuff
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; } |