public void Update(WingProperty prop) { name = prop.name; value = prop.Value; defaultValue = prop.defaultValue; decPlaces = prop.decPlaces; min = prop.min; max = prop.max; tooltip = prop.tooltip; }
private void UpdateProperty() { WingProperty wp = new WingProperty(); foreach (var item in m_wings) { WingData d = WingData.dataMap.Get(item.Value.id); WingLevelData wld = d.GetLevelData(item.Value.level); PropertyEffectData p = wld.GetProperEffectData(); wp.AddProperty(p); } List <string> attrs = wp.GetPropertEffect(); WingUILogicManager.Instance.SetWingAttribute(attrs); }
public override void SetupProperties() { base.SetupProperties(); if (rootOffset != null) return; if (part.symmetryCounterparts.Count == 0 || part.symmetryCounterparts[0].Modules.GetModule<B9_ProceduralControl>().rootOffset == null) { rootOffset = new WingProperty("Offset (root)", nameof(rootOffset), 0, 2, -2, 2, "Offset of the trailing edge \nroot corner on the lateral axis"); tipOffset.min = -2; tipOffset.max = 2; length.Value = 1; tipWidth.Value = 0.5; rootWidth.Value = 0.5; leadingEdgeType.max = 3; trailingEdgeType.max = 3; } else { B9_ProceduralControl wp = part.symmetryCounterparts[0].Modules.GetModule<B9_ProceduralControl>(); // all properties for symmetry will be the same object. Yay for no need to update values :D rootOffset = wp.rootOffset; } }
public WingProperty(WingProperty prop) { ID = prop.ID; Update(prop); }
public override void SetupProperties() { if (length != null) return; if (part.symmetryCounterparts.Count == 0 || part.symmetryCounterparts[0].Modules.GetModule<B9_ProceduralWing>().length == null) { length = new WingProperty("Length", nameof(length), 4, 2, 0.05, 16, "Lateral measurement of the wing, \nalso referred to as semispan"); tipOffset = new WingProperty("Offset (tip)", nameof(tipOffset), 0, 2, -8, 8, "Distance between midpoints of the cross \nsections on the longitudinal axis"); rootWidth = new WingProperty("Width (root)", nameof(rootWidth), 4, 2, 0.05, 16, "Longitudinal measurement of the wing \nat the root cross section"); tipWidth = new WingProperty("Width (tip)", nameof(tipWidth), 4, 2, 0.05, 16, "Longitudinal measurement of the wing \nat the tip cross section"); rootThickness = new WingProperty("Thickness (root)", nameof(rootThickness), 0.24, 2, 0.01, 1, "Thickness at the root cross section \nUsually kept proportional to edge width"); tipThickness = new WingProperty("Thickness (tip)", nameof(tipThickness), 0.24, 2, 0.01, 1, "Thickness at the tip cross section \nUsually kept proportional to edge width"); leadingEdgeType = new WingProperty("Shape", nameof(leadingEdgeType), 2, 0, 1, 4, "Shape of the leading edge cross \nsection (round/biconvex/sharp)"); rootLeadingEdge = new WingProperty("Width (root)", nameof(rootLeadingEdge), 0.24, 2, 0.01, 1.0, "Longitudinal measurement of the leading \nedge cross section at wing root"); tipLeadingEdge = new WingProperty("Width (tip)", nameof(tipLeadingEdge), 0.24, 2, 0.01, 1.0, "Longitudinal measurement of the leading \nedge cross section at with tip"); trailingEdgeType = new WingProperty("Shape", nameof(trailingEdgeType), 3, 0, 1, 4, "Shape of the trailing edge cross \nsection (round/biconvex/sharp)"); rootTrailingEdge = new WingProperty("Width (root)", nameof(rootTrailingEdge), 0.48, 2, 0.01, 1.0, "Longitudinal measurement of the trailing \nedge cross section at wing root"); tipTrailingEdge = new WingProperty("Width (tip)", nameof(tipTrailingEdge), 0.48, 2, 0.01, 1.0, "Longitudinal measurement of the trailing \nedge cross section at wing tip"); surfTopMat = new WingProperty("Material", nameof(surfTopMat), 1, 0, 0, 4, "Surface material (uniform fill, plating, \nLRSI/HRSI tiles and so on)"); surfTopOpacity = new WingProperty("Opacity", nameof(surfTopOpacity), 0, 2, 0, 1, "Fairly self-explanatory, controls the paint \nopacity: no paint at 0, full coverage at 1"); surfTopHue = new WingProperty("Hue", nameof(surfTopHue), 0.1, 2, 0, 1, "Controls the paint hue (HSB axis): \nvalues from zero to one make full circle"); surfTopSat = new WingProperty("Saturation", nameof(surfTopSat), 0.75, 2, 0, 1, "Controls the paint saturation (HSB axis): \ncolorless at 0, full color at 1"); surfTopBright = new WingProperty("Brightness", nameof(surfTopBright), 0.6, 2, 0, 1, "Controls the paint brightness (HSB axis): black at 0, white at 1, primary at 0.5"); surfBottomMat = new WingProperty("Material", nameof(surfBottomMat), 4, 0, 0, 4, "Surface material (uniform fill, plating, \nLRSI/HRSI tiles and so on)"); surfBottomOpacity = new WingProperty("Opacity", nameof(surfBottomOpacity), 0, 2, 0, 1, "Fairly self-explanatory, controls the paint \nopacity: no paint at 0, full coverage at 1"); surfBottomHue = new WingProperty("Hue", nameof(surfBottomHue), 0.1, 2, 0, 1, "Controls the paint hue (HSB axis): \nvalues from zero to one make full circle"); surfBottomSat = new WingProperty("Saturation", nameof(surfBottomSat), 0.75, 2, 0, 1, "Controls the paint saturation (HSB axis): \ncolorless at 0, full color at 1"); surfBottomBright = new WingProperty("Brightness", nameof(surfBottomBright), 0.6, 2, 0, 1, "Controls the paint brightness (HSB axis): black at 0, white at 1, primary at 0.5"); surfLeadMat = new WingProperty("Material", nameof(surfLeadMat), 4, 0, 0, 4, "Surface material (uniform fill, plating, \nLRSI/HRSI tiles and so on)"); surfLeadOpacity = new WingProperty("Opacity", nameof(surfLeadOpacity), 0, 2, 0, 1, "Fairly self-explanatory, controls the paint \nopacity: no paint at 0, full coverage at 1"); surfLeadHue = new WingProperty("Hue", nameof(surfLeadHue), 0.1, 2, 0, 1, "Controls the paint hue (HSB axis): \nvalues from zero to one make full circle"); surfLeadSat = new WingProperty("Saturation", nameof(surfLeadSat), 0.75, 2, 0, 1, "Controls the paint saturation (HSB axis): \ncolorless at 0, full color at 1"); surfLeadBright = new WingProperty("Brightness", nameof(surfLeadBright), 0.6, 2, 0, 1, "Controls the paint brightness (HSB axis): black at 0, white at 1, primary at 0.5"); surfTrailMat = new WingProperty("Material", nameof(surfTrailMat), 4, 0, 0, 4, "Surface material (uniform fill, plating, \nLRSI/HRSI tiles and so on)"); surfTrailOpacity = new WingProperty("Opacity", nameof(surfTrailOpacity), 0, 2, 0, 1, "Fairly self-explanatory, controls the paint \nopacity: no paint at 0, full coverage at 1"); surfTrailHue = new WingProperty("Hue", nameof(surfTrailHue), 0.1, 2, 0, 1, "Controls the paint hue (HSB axis): \nvalues from zero to one make full circle"); surfTrailSat = new WingProperty("Saturation", nameof(surfTrailSat), 0.75, 2, 0, 1, "Controls the paint saturation (HSB axis): \ncolorless at 0, full color at 1"); surfTrailBright = new WingProperty("Brightness", nameof(surfTrailBright), 0.6, 2, 0, 1, "Controls the paint brightness (HSB axis): black at 0, white at 1, primary at 0.5"); } else { B9_ProceduralWing pw = part.symmetryCounterparts[0].Modules.GetModule<B9_ProceduralWing>(); // all properties for symmetry will be the same object. Yay for no need to update values :D length = pw.length; tipOffset = pw.tipOffset; rootWidth = pw.rootWidth; tipWidth = pw.tipWidth; rootThickness = pw.rootThickness; tipThickness = pw.tipThickness; leadingEdgeType = pw.leadingEdgeType; rootLeadingEdge = pw.rootLeadingEdge; tipLeadingEdge = pw.tipLeadingEdge; trailingEdgeType = pw.trailingEdgeType; rootTrailingEdge = pw.rootTrailingEdge; tipTrailingEdge = pw.tipTrailingEdge; surfTopMat = pw.surfTopMat; surfTopOpacity = pw.surfTopOpacity; surfTopHue = pw.surfTopHue; surfTopSat = pw.surfTopSat; surfTopBright = pw.surfTopBright; surfBottomMat = pw.surfBottomMat; surfBottomOpacity = pw.surfBottomOpacity; surfBottomHue = pw.surfBottomHue; surfBottomSat = pw.surfBottomSat; surfBottomBright = pw.surfBottomBright; surfLeadMat = pw.surfLeadMat; surfLeadOpacity = pw.surfLeadOpacity; surfLeadHue = pw.surfLeadHue; surfLeadSat = pw.surfLeadSat; surfLeadBright = pw.surfLeadBright; surfTrailMat = pw.surfTrailMat; surfTrailOpacity = pw.surfTrailOpacity; surfTrailHue = pw.surfTrailHue; surfTrailSat = pw.surfTrailSat; surfTrailBright = pw.surfTrailBright; } }
private void UpdateProperty() { WingProperty wp = new WingProperty(); foreach (var item in m_wings) { WingData d = WingData.dataMap.Get(item.Value.id); WingLevelData wld = d.GetLevelData(item.Value.level); PropertyEffectData p = wld.GetProperEffectData(); wp.AddProperty(p); } List<string> attrs = wp.GetPropertEffect(); WingUILogicManager.Instance.SetWingAttribute(attrs); }