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

Method progressHandler

source/windowing/StarWidgetParsing.cpp:721–744  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

719}
720
721WidgetConstructResult WidgetParser::progressHandler(String const& name, Json const& config) {
722 String background, overlay;
723 ImageStretchSet progressSet;
724
725 background = config.get("background", "").toString();
726 overlay = config.get("overlay", "").toString();
727 progressSet = parseImageStretchSet(config.get("progressSet"));
728 GuiDirection direction = GuiDirectionNames.getLeft(config.getString("direction", "horizontal"));
729
730 auto progress = make_shared<ProgressWidget>(background, overlay, progressSet, direction);
731
732 common(progress, config);
733
734 if (config.contains("barColor"))
735 progress->setColor(jsonToColor(config.get("barColor")));
736
737 if (config.contains("max"))
738 progress->setMaxProgressLevel(config.getFloat("max"));
739
740 if (config.contains("initial"))
741 progress->setCurrentProgressLevel(config.getFloat("initial"));
742
743 return WidgetConstructResult(progress, name, config.getFloat("zlevel", 0));
744}
745
746WidgetConstructResult WidgetParser::stackHandler(String const& name, Json const& config) {
747 auto stack = make_shared<StackWidget>();

Callers

nothing calls this directly

Calls 10

jsonToColorFunction · 0.85
getStringMethod · 0.80
setMaxProgressLevelMethod · 0.80
getFloatMethod · 0.80
toStringMethod · 0.45
getMethod · 0.45
containsMethod · 0.45
setColorMethod · 0.45

Tested by

no test coverage detected