public override void Create(FormHolder Parent)
        {
            SetSize(ValueField.Size + new Vector2(Font.MeasureString(Name).X, 0));

            if (!NoValue)
            {
                LinkedList <Form> Forms = new LinkedList <Form>();
                Dictionary <string, LinkedList <BasicEffectParameter> > Values = new Dictionary <string, LinkedList <BasicEffectParameter> >();

                foreach (EffectValue e in ReferenceValues)
                {
                    foreach (BasicEffectParameter v in e.Parameters.Values)
                    {
                        LinkedList <BasicEffectParameter> Vlist = null;
                        if (!Values.Keys.Contains(v.Name))
                        {
                            Values.Add(v.Name, Vlist = new LinkedList <BasicEffectParameter>());
                        }
                        else
                        {
                            Vlist = Values[v.Name];
                        }

                        Vlist.AddLast(v);
                    }
                }

                foreach (string s in Values.Keys)
                {
                    Parent.AddForm(Values[s].First.Value.GetForm(Values[s]));
                }
            }

            base.Create(Parent);
        }
예제 #2
0
        public static LinkedList <Form> CreateValueEditors(LinkedList <GameObject> Selected)
        {
            LinkedList <Form> Forms = new LinkedList <Form>();
            Dictionary <string, LinkedList <Value> > Values = new Dictionary <string, LinkedList <Value> >();

            foreach (GameObject o in Selected)
            {
                foreach (Value v in o.Values)
                {
                    if (v.Editable)
                    {
                        LinkedList <Value> Vlist = null;
                        if (!Values.Keys.Contains(v.Name))
                        {
                            Values.Add(v.Name, Vlist = new LinkedList <Value>());
                        }
                        else
                        {
                            Vlist = Values[v.Name];
                        }

                        Vlist.AddLast(v);
                    }
                }
            }

            foreach (string s in Values.Keys)
            {
                if (Values[s].Count >= Selected.Count)
                {
                    Form f = Values[s].First.Value.GetForm(Values[s]);
                    if (f != null)
                    {
                        Forms.AddLast(f);
                    }
                }
            }
            return(Forms);
        }