public void ChangeCurve(FloatCurve curveToEdit) { Utils.Log($"Started editing curve {curveToEdit.ToString()}", LogType.UI); curve = curveToEdit; points = GraphUtils.FloatCurveToPoints(curveToEdit); UpdateCurve(out curve); showWindow = true; }
public override void OnLoad(ConfigNode node) { base.OnLoad(node); foreach (ConfigNode n in node.GetNodes("RESOURCE")) { if (n.HasValue("name") && n.HasNode("rate")) { FloatCurve rate = new FloatCurve(); string unitName = ""; if (n.HasValue("unitName")) { unitName = n.GetValue("unitName"); } else { unitName = n.GetValue("name"); } rate.Load(n.GetNode("rate")); inputResources.Add(new ResourceRate(n.GetValue("name"), rate, unitName)); print("adding RESOURCE " + n.GetValue("name") + " = " + rate.ToString()); } } foreach (ConfigNode n in node.GetNodes("OUTPUT_RESOURCE")) { if (n.HasValue("name") && n.HasNode("rate")) { FloatCurve rate = new FloatCurve(); string unitName = ""; if (n.HasValue("unitName")) { unitName = n.GetValue("unitName"); } else { unitName = n.GetValue("name"); } rate.Load(n.GetNode("rate")); outputResources.Add(new ResourceRate(n.GetValue("name"), rate, unitName)); print("adding OUTPUT_RESOURCE " + n.GetValue("name") + " = " + rate.ToString()); } } foreach (ConfigNode c in node.GetNodes("HEATPUMP_NODE")) { print("searching HEATPUMP_NODE"); if (c.HasValue("name")) { string nodeName = c.GetValue("name"); attachNodeNames.Add(nodeName); print("Adding HEATPUMP_NODE " + nodeName); } } }
public void ChangeCurve(FloatCurve curveToEdit, UIModifierWindow modWin, string tag) { modifier = modWin; modifierTag = tag; Utils.Log($"Started editing curve {curveToEdit.ToString()}", LogType.UI); curve = curveToEdit; points = GraphUtils.FloatCurveToPoints(curveToEdit); UpdateCurve(out curve); showWindow = true; }
public UICurveEditWindow(FloatCurve curveToEdit, bool show) : base(show) { Utils.Log($"Started editing curve {curveToEdit.ToString()}"); WindowPosition = new Rect(Screen.width / 2, Screen.height / 2, 678, 600); curve = curveToEdit; points = GraphUtils.FloatCurveToPoints(curveToEdit); UpdateCurve(out curve); }
public UICurveEditWindow(FloatCurve curveToEdit, UIModifierWindow modWin, string tag, bool show) : base(show) { modifier = modWin; modifierTag = tag; Utils.Log($"Started editing curve {curveToEdit.ToString()}", LogType.UI); WindowPosition = new Rect(Screen.width / 2, Screen.height / 2, 678, 600); curve = curveToEdit; points = GraphUtils.FloatCurveToPoints(curveToEdit); UpdateCurve(out curve); }