private Config() { Gui = GuiNode.GetDefault(); ContextMenu = ContextMenuNode.GetDefault(); Overlay = OverlayNode.GetDefault(); Diagnostics = DiagnosticsNode.GetDefault(); }
public static Config TryParse(ConfigNode node) { if (node != null) { var gui = GuiNode.TryParse(node.GetNode("GUI")) ?? GuiNode.GetDefault(); var contextMenu = ContextMenuNode.TryParse(node.GetNode("CONTEXT_MENU")) ?? ContextMenuNode.GetDefault(); var overlay = OverlayNode.TryParse(node.GetNode("OVERLAY")) ?? OverlayNode.GetDefault(); var diagnostics = DiagnosticsNode.TryParse(node.GetNode("DIAGNOSTICS")) ?? DiagnosticsNode.GetDefault(); return(new Config(gui, contextMenu, overlay, diagnostics)); } Log.Debug("Could not parse missing HOT_SPOT node"); return(null); }