From c923f4f13b1cade968bb6fec585a242b62d35715 Mon Sep 17 00:00:00 2001 From: Kae <80987908+Novaenia@users.noreply.github.com> Date: Tue, 4 Jul 2023 22:36:27 +1000 Subject: pane lua stuff --- source/frontend/StarInterfaceLuaBindings.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'source/frontend/StarInterfaceLuaBindings.cpp') 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 { + if (auto pane = mainInterface->paneManager()->maybeRegisteredPane(MainInterfacePanesNames.getLeft(registeredPaneName))) + return pane->makePaneCallbacks(); + return {}; + }); + + callbacks.registerCallback("scale", [mainInterface]() -> int { + return GuiContext::singleton().interfaceScale(); + }); + return callbacks; } -- cgit v1.2.3