public EditableValue[] GetValues() { var ret = new List <EditableValue>(); EditableValue ev = new EditableValue(); ev.Value = Type; { if (Core.Language == Language.English) { ev.Title = "ForceField" + number.ToString(); } if (Core.Language == Language.Japanese) { ev.Title = "力場" + number.ToString(); } ev.Description = ""; } ev.IsShown = true; ev.IsUndoEnabled = true; ev.SelfSelectorID = 10; ret.Add(ev); ret.Add(EditableValue.Create(Turbulence, this.GetType().GetProperty("Turbulence"))); return(ret.ToArray()); }
public EditableValue[] GetValues() { var ret = new List <EditableValue>(); EditableValue ev = new EditableValue(); ev.Value = CustomData; if (Name != string.Empty) { ev.Title = Name; ev.Description = Desc; } else { ev.Title = MultiLanguageTextProvider.GetText("CustomData_Name") + customDataNum.ToString(); ev.Description = ""; } ev.IsShown = true; ev.IsUndoEnabled = true; ev.SelfSelectorID = 10; ret.Add(ev); ret.Add(EditableValue.Create(Fixed, this.GetType().GetProperty("Fixed"))); ret.Add(EditableValue.Create(Random, this.GetType().GetProperty("Random"))); ret.Add(EditableValue.Create(Easing, this.GetType().GetProperty("Easing"))); ret.Add(EditableValue.Create(FCurve, this.GetType().GetProperty("FCurve"))); ret.Add(EditableValue.Create(Fixed4, this.GetType().GetProperty("Fixed4"))); ret.Add(EditableValue.Create(FCurveColor, this.GetType().GetProperty("FCurveColor"))); return(ret.ToArray()); }
public EditableValue[] GetValues() { var ret = new List <EditableValue>(); // self { EditableValue ev = new EditableValue(); ev.Value = this; ev.Title = ""; ev.Description = ""; ev.IsShown = true; ev.IsUndoEnabled = false; //ret.Add(ev); } // need to filter var propPath = EditableValue.Create(Path, this.GetType().GetProperty("Path")); ret.Add(propPath); foreach (var kv in keyToValues) { EditableValue ev = new EditableValue(); var status = kv.Value as ValueStatus; ev.Value = status.Value; ev.Title = status.Name; ev.Description = status.Description; ev.IsShown = status.IsShown; ev.IsUndoEnabled = true; ret.Add(ev); } return(ret.ToArray()); }
public EditableValue[] GetValues() { List <EditableValue> ret = new List <EditableValue>(); if (selected == null) { return(ret.ToArray()); } EditableValue vn = new EditableValue(); vn.Value = selected.Name; vn.Title = "Name"; vn.IsUndoEnabled = true; ret.Add(vn); EditableValue vx = new EditableValue(); vx.Value = selected.Code; vx.Title = "Code"; vx.IsUndoEnabled = true; ret.Add(vx); return(ret.ToArray()); }
public DynamicEquationCollection() { ElementMax = 16; CreateValue += () => { var value = new DynamicEquation(); value.Name.SetValue("New Expression"); value.Code.SetValue("@O.x = @In0\[email protected] = @In1"); return(value); }; GetEditableValues += (v) => { List <EditableValue> ret = new List <EditableValue>(); EditableValue vn = new EditableValue(); vn.Value = v.Name; vn.Title = Resources.GetString("DynamicName"); vn.IsUndoEnabled = true; ret.Add(vn); EditableValue vx = new EditableValue(); vx.Value = v.Code; vx.Title = Resources.GetString("DynamicEq"); vx.IsUndoEnabled = true; ret.Add(vx); return(ret.ToArray()); }; }
public EditableValue[] GetValues() { List <EditableValue> ret = new List <EditableValue>(); if (selected == null) { return(ret.ToArray()); } EditableValue vn = new EditableValue(); vn.Value = selected.Name; vn.Title = Resources.GetString("DynamicName"); vn.IsUndoEnabled = true; ret.Add(vn); EditableValue vx = new EditableValue(); vx.Value = selected.Code; vx.Title = Resources.GetString("DynamicEq"); vx.IsUndoEnabled = true; ret.Add(vx); return(ret.ToArray()); }
public static EditableValue Create(object o, System.Reflection.PropertyInfo info) { var ret = new EditableValue(); ret.Value = o; var p = info; var attributes = p.GetCustomAttributes(false); var undo = attributes.Where(_ => _.GetType() == typeof(UndoAttribute)).FirstOrDefault() as UndoAttribute; if (undo != null && !undo.Undo) { ret.IsUndoEnabled = false; } else { ret.IsUndoEnabled = true; } var shown = attributes.Where(_ => _.GetType() == typeof(ShownAttribute)).FirstOrDefault() as ShownAttribute; if (shown != null && !shown.Shown) { ret.IsShown = false; } var selector_attribute = (from a in attributes where a is Data.SelectorAttribute select a).FirstOrDefault() as Data.SelectorAttribute; if (selector_attribute != null) { ret.SelfSelectorID = selector_attribute.ID; } // collect selected values var selectedAttributes = attributes.OfType <Data.SelectedAttribute>(); if (selectedAttributes.Count() > 0) { if (selectedAttributes.Select(_ => _.ID).Distinct().Count() > 1) { throw new Exception("Same IDs are required."); } ret.TargetSelectorID = selectedAttributes.First().ID; ret.RequiredSelectorValues = selectedAttributes.Select(_ => _.Value).ToArray(); } ret.Title = NameAttribute.GetName(attributes); ret.Description = DescriptionAttribute.GetDescription(attributes); return(ret); }
public EditableValue[] GetValues() { List <EditableValue> ret = new List <EditableValue>(); for (int i = 0; i < values.Count; i++) { EditableValue v = new EditableValue(); v.Value = values[i].Input; v.Title = (i + 1).ToString(); v.IsUndoEnabled = false; ret.Add(v); } return(ret.ToArray()); }
public static EditableValue Create(object o, System.Reflection.PropertyInfo info) { var ret = new EditableValue(); ret.Value = o; var p = info; var attributes = p.GetCustomAttributes(false); ret.Title = NameAttribute.GetName(attributes); ret.Description = DescriptionAttribute.GetDescription(attributes); var undo = attributes.Where(_ => _.GetType() == typeof(Effekseer.Data.UndoAttribute)).FirstOrDefault() as Effekseer.Data.UndoAttribute; if (undo != null && !undo.Undo) { ret.IsUndoEnabled = false; } else { ret.IsUndoEnabled = true; } var shown = attributes.Where(_ => _.GetType() == typeof(Effekseer.Data.ShownAttribute)).FirstOrDefault() as Effekseer.Data.ShownAttribute; if (shown != null && !shown.Shown) { ret.IsShown = false; } var selector_attribute = (from a in attributes where a is Data.SelectorAttribute select a).FirstOrDefault() as Data.SelectorAttribute; if (selector_attribute != null) { ret.SelectorID = selector_attribute.ID; } var selected_attribute = (from a in attributes where a is Data.SelectedAttribute select a).FirstOrDefault() as Data.SelectedAttribute; if (selected_attribute != null) { ret.SelectedID = selected_attribute.ID; ret.SelectedValue = selected_attribute.Value; } return(ret); }
public EditableValue[] GetValues() { var ret = new List <EditableValue>(); // self { EditableValue ev = new EditableValue(); ev.Value = this; ev.Title = ""; ev.Description = ""; ev.IsShown = true; ev.IsUndoEnabled = false; //ret.Add(ev); } var propPath = EditableValue.Create(Path, this.GetType().GetProperty("Path")); if (!string.IsNullOrEmpty(selfSummary)) { propPath.Title = selfSummary; } if (!string.IsNullOrEmpty(selfDetail)) { propPath.Description = selfDetail; } ret.Add(propPath); foreach (var v in valueStatuses.OrderBy(_ => (_ as ValueStatus).Priority)) { EditableValue ev = new EditableValue(); var status = v as ValueStatus; ev.Value = status.Value; ev.Title = status.Name; ev.Description = status.Description; ev.IsShown = status.IsShown; ev.IsUndoEnabled = true; ret.Add(ev); } return(ret.ToArray()); }
public EditableValue[] GetValues() { var ret = new List <EditableValue>(); EditableValue ev = new EditableValue(); ev.Value = Type; { if (Core.Language == Language.English) { ev.Title = "ForceField" + number.ToString(); } if (Core.Language == Language.Japanese) { ev.Title = "力場" + number.ToString(); } ev.Description = ""; } ev.IsShown = true; ev.IsUndoEnabled = true; ev.SelfSelectorID = 10; ret.Add(ev); ret.Add(EditableValue.Create(Position, this.GetType().GetProperty("Position"))); ret.Add(EditableValue.Create(Rotation, this.GetType().GetProperty("Rotation"))); ret.Add(EditableValue.Create(Power, this.GetType().GetProperty("Power"))); ret.Add(EditableValue.Create(Force, this.GetType().GetProperty("Force"))); ret.Add(EditableValue.Create(Wind, this.GetType().GetProperty("Wind"))); ret.Add(EditableValue.Create(Vortex, this.GetType().GetProperty("Vortex"))); ret.Add(EditableValue.Create(Turbulence, this.GetType().GetProperty("Turbulence"))); ret.Add(EditableValue.Create(Drag, this.GetType().GetProperty("Drag"))); ret.Add(EditableValue.Create(Gravity, this.GetType().GetProperty("Gravity"))); ret.Add(EditableValue.Create(AttractiveForce, this.GetType().GetProperty("AttractiveForce"))); ret.Add(EditableValue.Create(Falloff, this.GetType().GetProperty("Falloff"))); return(ret.ToArray()); }
public ProcedualModelCollection() { CreateValue += () => { return(new ProcedualModelParameter()); }; GetEditableValues += (v) => { List <EditableValue> ret = new List <EditableValue>(); EditableValue value = new EditableValue(); value.Value = v; value.Title = Resources.GetString("ProcedualModel"); value.IsUndoEnabled = true; ret.Add(value); return(ret.ToArray()); }; }
public EditableValue[] GetValues() { var ret = new List <EditableValue>(); EditableValue ev = new EditableValue(); ev.Value = CustomData; if (Name != string.Empty) { ev.Title = Name; ev.Description = Desc; } else { if (Core.Language == Language.English) { ev.Title = "CustomData" + customDataNum.ToString(); } if (Core.Language == Language.Japanese) { ev.Title = "カスタムデータ" + customDataNum.ToString(); } ev.Description = ""; } ev.IsShown = true; ev.IsUndoEnabled = true; ev.SelfSelectorID = 10; ret.Add(ev); ret.Add(EditableValue.Create(Fixed, this.GetType().GetProperty("Fixed"))); ret.Add(EditableValue.Create(Easing, this.GetType().GetProperty("Easing"))); ret.Add(EditableValue.Create(FCurve, this.GetType().GetProperty("FCurve"))); ret.Add(EditableValue.Create(Fixed4, this.GetType().GetProperty("Fixed4"))); ret.Add(EditableValue.Create(FCurveColor, this.GetType().GetProperty("FCurveColor"))); return(ret.ToArray()); }
public static EditableValue Create(object o, System.Reflection.PropertyInfo info) { var ret = new EditableValue(); ret.Value = o; var p = info; var attributes = p.GetCustomAttributes(false); var undo = attributes.Where(_ => _.GetType() == typeof(UndoAttribute)).FirstOrDefault() as UndoAttribute; if (undo != null && !undo.Undo) { ret.IsUndoEnabled = false; } else { ret.IsUndoEnabled = true; } var shown = attributes.Where(_ => _.GetType() == typeof(ShownAttribute)).FirstOrDefault() as ShownAttribute; if (shown != null && !shown.Shown) { ret.IsShown = false; } var selector_attribute = (from a in attributes where a is Data.SelectorAttribute select a).FirstOrDefault() as Data.SelectorAttribute; if (selector_attribute != null) { ret.SelfSelectorID = selector_attribute.ID; } // collect selected values var selectedAttributes = attributes.OfType <Data.SelectedAttribute>(); if (selectedAttributes.Count() > 0) { if (selectedAttributes.Select(_ => _.ID).Distinct().Count() > 1) { throw new Exception("Same IDs are required."); } ret.TargetSelectorID = selectedAttributes.First().ID; ret.RequiredSelectorValues = selectedAttributes.Select(_ => _.Value).ToArray(); } var key = KeyAttribute.GetKey(attributes); var nameKey = key + "_Name"; if (string.IsNullOrEmpty(key)) { nameKey = info.ReflectedType.Name + "_" + info.Name + "_Name"; } if (MultiLanguageTextProvider.HasKey(nameKey)) { ret.Title = new MultiLanguageString(nameKey); } else { ret.Title = NameAttribute.GetName(attributes); //if (!string.IsNullOrEmpty(ret.Title.ToString())) //{ // System.IO.File.AppendAllText("kv.csv", nameKey + "," + "\"" + ret.Title.ToString() + "\"" + "\r\n"); //} } var descKey = key + "_Desc"; if (string.IsNullOrEmpty(key)) { descKey = info.ReflectedType.Name + "_" + info.Name + "_Desc"; } if (MultiLanguageTextProvider.HasKey(descKey)) { ret.Description = new MultiLanguageString(descKey); } else { ret.Description = DescriptionAttribute.GetDescription(attributes); //if(!string.IsNullOrEmpty(ret.Description.ToString())) //{ // System.IO.File.AppendAllText("kv.csv", descKey + "," + "\"" + ret.Description.ToString() + "\"" + "\r\n"); //} } var treeNode = attributes.OfType <TreeNodeAttribute>().FirstOrDefault(); if (treeNode != null) { ret.TreeNodeID = treeNode.id; if (MultiLanguageTextProvider.HasKey(treeNode.key)) { ret.Title = new MultiLanguageString(treeNode.key); } } return(ret); }