use of buildcraft.lib.gui.ledger.Ledger_Neptune in project BuildCraft by BuildCraft.
the class ElementTypeLedger method deserialize0.
@Override
public IGuiElement deserialize0(BuildCraftJsonGui gui, IGuiPosition parent, JsonGuiInfo info, JsonGuiElement json) {
FunctionContext ctx = createContext(json);
inheritProperty(json, "color", "colour");
String side = json.properties.get("side");
String title = json.properties.get("title");
int colour = resolveEquationInt(json, "colour", ctx);
boolean positive = "right".equalsIgnoreCase(side);
Ledger_Neptune ledger = new Ledger_Neptune(gui, colour, positive);
ledger.setTitle(title);
addChildren(gui, ledger.positionLedgerIconStart, info, json, "closed", ledger.getClosedElements()::add);
ledger.calculateMaxSize();
ResourceLocation def = gui.jsonGuiDefinition;
def = new ResourceLocation(def.getResourceDomain(), def.getResourcePath().replace(".json", ""));
ledger.setOpenProperty(GuiConfigManager.getOrAddBoolean(def, json.name + ".is_open", false));
return ledger;
}
Aggregations