MCPcopy Create free account
hub / github.com/OpenStarbound/OpenStarbound / paneFeatureHandler

Method paneFeatureHandler

source/windowing/StarGuiReader.cpp:54–66  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

52}
53
54WidgetConstructResult GuiReader::paneFeatureHandler(String const&, Json const& config) {
55 if (m_pane) {
56 m_pane->setAnchor(PaneAnchorNames.getLeft(config.getString("anchor", "None")));
57 if (config.contains("offset"))
58 m_pane->setAnchorOffset(jsonToVec2I(config.get("offset")));
59 if (config.getBool("positionLocked", false))
60 m_pane->lockPosition();
61 } else {
62 throw StarException("Only Pane controls support the 'panefeature' command");
63 }
64
65 return {};
66}
67
68WidgetConstructResult GuiReader::backgroundHandler(String const&, Json const& config) {
69 if (m_pane) {

Callers

nothing calls this directly

Calls 9

jsonToVec2IFunction · 0.85
StarExceptionClass · 0.85
getStringMethod · 0.80
setAnchorOffsetMethod · 0.80
getBoolMethod · 0.80
lockPositionMethod · 0.80
setAnchorMethod · 0.45
containsMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected