public override void LoadFromXML(System.Xml.XmlNode node, ListView scene, ref Dictionary <uint, List <uint> > Depends) { XTools tools = new XTools(X); XEnvironmentParameters param = new XEnvironmentParameters(X); param.AutoDraw = bool.Parse(node.Attributes["AutoDraw"].InnerText); param.ComponentID = uint.Parse(node.Attributes["ComponentID"].InnerText); param.dayFile = node.Attributes["dayFile"].InnerText; param.dayToSunsetSharpness = float.Parse(node.Attributes["dayToSunsetSharpness"].InnerText); param.DrawOrder = int.Parse(node.Attributes["DrawOrder"].InnerText); param.fogColor = tools.ConvertVector3ToVector4(tools.ParseXMLVector3(node.Attributes["fogColor"].InnerText)); param.fogDensity = float.Parse(node.Attributes["fogDensity"].InnerText); param.hazeTopAltitude = float.Parse(node.Attributes["hazeTopAltitude"].InnerText); param.largeSunLightness = float.Parse(node.Attributes["largeSunLightness"].InnerText); param.largeSunRadiusAttenuation = float.Parse(node.Attributes["largeSunRadiusAttentuation"].InnerText); param.lightColor = new Vector4(tools.ParseXMLVector3(node.Attributes["lightColor"].InnerText), 1); param.lightColorAmbient = new Vector4(tools.ParseXMLVector3(node.Attributes["lightColorAmbient"].InnerText), 1); param.lightDirection = new Vector4(tools.ParseXMLVector3(node.Attributes["lightDirection"].InnerText), 1); param.Name = node.Attributes["Name"].InnerText; param.nightFile = node.Attributes["nightFile"].InnerText; param.shadows = bool.Parse(node.Attributes["shadows"].InnerText); param.sunLightness = float.Parse(node.Attributes["sunLightness"].InnerText); param.sunRadiusAttenuation = float.Parse(node.Attributes["sunRadiusAttentuation"].InnerText); param.sunsetFile = node.Attributes["sunsetFile"].InnerText; ListViewItem sceneitem = new ListViewItem(); if (!string.IsNullOrEmpty(param.DayFile) && !string.IsNullOrEmpty(param.NightFile) && !string.IsNullOrEmpty(param.SunsetFile)) { param.Load(X.Content); } X_Editor.Tools.AddXComponentToSceneList(scene, param, group); }
public override void LoadFromXML(System.Xml.XmlNode node, ListView scene, ref Dictionary <uint, List <uint> > Depends) { XTools tools = new XTools(X); XTree actor = new XTree(ref X, null, tools.ParseXMLVector3(node.Attributes["Translation"].InnerText), tools.ParseXMLVector3(node.Attributes["Scale"].InnerText) ); actor.AutoDraw = bool.Parse(node.Attributes["AutoDraw"].InnerText); actor.DrawOrder = int.Parse(node.Attributes["DrawOrder"].InnerText); actor.Immovable = bool.Parse(node.Attributes["Immovable"].InnerText); actor.Rotation = tools.ParseXMLQuaternion(node.Attributes["Rotation"].InnerText); actor.ComponentID = uint.Parse(node.Attributes["ComponentID"].InnerText); actor.Mass = float.Parse(node.Attributes["Mass"].InnerText); actor.Velocity = tools.ParseVector3(node.Attributes["Velocity"].InnerText); actor.Name = node.Attributes["Name"].InnerText; actor.Scale = tools.ParseXMLVector3(node.Attributes["Scale"].InnerText); actor.CollisionEnabled = bool.Parse(node.Attributes["CollisionEnabled"].InnerText); actor.RenderLeaves = bool.Parse(node.Attributes["RenderLeaves"].InnerText); List <uint> dep = new List <uint>(); dep.Add(uint.Parse(node.Attributes["model_editor"].InnerText)); Depends.Add(actor.ComponentID, dep); X_Editor.Tools.AddXComponentToSceneList(scene, actor, group); }
public override void LoadFromXML(System.Xml.XmlNode node, ListView scene, ref Dictionary <uint, List <uint> > Depends) { XTools tools = new XTools(X); XProp actor = new XProp(ref X, null, tools.ParseXMLVector3(node.Attributes["Translation"].InnerText), tools.ParseXMLVector3(node.Attributes["ModelOffset_editor"].InnerText), Matrix.CreateFromQuaternion(tools.ParseXMLQuaternion(node.Attributes["Rotation"].InnerText)), tools.ParseXMLVector3(node.Attributes["Scale"].InnerText)); actor.NoCull = true; actor.AutoDraw = bool.Parse(node.Attributes["AutoDraw"].InnerText); actor.DrawOrder = int.Parse(node.Attributes["DrawOrder"].InnerText); actor.ComponentID = uint.Parse(node.Attributes["ComponentID"].InnerText); actor.Name = node.Attributes["Name"].InnerText; List <uint> dep = new List <uint>(); dep.Add(uint.Parse(node.Attributes["model_editor"].InnerText)); Depends.Add(actor.ComponentID, dep); X_Editor.Tools.AddXComponentToSceneList(scene, actor, group); }