예제 #1
0
 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;
 }
예제 #2
0
        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);
                }
            }
        }
예제 #3
0
 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;
 }
예제 #4
0
        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);
        }
예제 #5
0
        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);
        }