private HudElement(string elementType, string defName, HudTarget targets) { _elementType = elementType; DefName = defName; Targets = targets; HudTimings.Add(this); }
private HudLayout(XElement xe) : base(xe, true) { HudTimings.Add(this); bool docked; if (xe.Name == DockedElementName) { docked = true; } else if (xe.Name == FloatingElementName) { docked = false; } else { return; } var height = xe.Attribute(HeightAttributeName)?.Value.ToInt() ?? -1; var width = xe.Attribute(WidthAttributeName)?.Value.ToInt() ?? -1; var tabs = xe.Attribute(TabsAttributeName)?.Value.ToInt() ?? -1; if (height > 0) { if (docked) { Theme.InspectPaneHeight.Value = height; } else { Theme.HudHeight.Value = height; } } if (width > 0) { if (docked) { Theme.InspectPaneTabWidth.Value = width; } else { Theme.HudWidth.Value = width; } } if (docked && tabs > 0) { Theme.InspectPaneMinTabs.Value = tabs; } }