예제 #1
0
        public override void UpdateObjectProperties(object Input, PropertyGrid Properties, ListView Scene)
        {
            XHeightMap heightmap = (XHeightMap)Input;

            if (!string.IsNullOrEmpty(heightmap.HeightMap) && !string.IsNullOrEmpty(heightmap.TextureMap) && heightmap.Params != null)
            {
                try
                {
                    heightmap.Load(X.Content);
                }
                catch
                {
                    MessageBox.Show("There was a problem loading one of the heightmap's files. Check that the file exists and has been built with the Texture importer and processor.", "File Error");
                }
            }

            base.UpdateObjectProperties(Input, Properties, Scene);
        }
예제 #2
0
        public override void LoadFromXML(System.Xml.XmlNode node, ListView scene, ref Dictionary <uint, List <uint> > Depends)
        {
            XHeightMap heightmap = new XHeightMap(ref X, node.Attributes["HeightMap"].InnerText, null, node.Attributes["RTexture"].InnerText, node.Attributes["GTexture"].InnerText, node.Attributes["BTexture"].InnerText, node.Attributes["TextureMap"].InnerText);

            heightmap.AutoDraw    = bool.Parse(node.Attributes["AutoDraw"].InnerText);
            heightmap.DrawOrder   = int.Parse(node.Attributes["DrawOrder"].InnerText);
            heightmap.ComponentID = uint.Parse(node.Attributes["ComponentID"].InnerText);
            heightmap.Name        = node.Attributes["Name"].InnerText;

            List <uint> dep = new List <uint>();

            dep.Add(uint.Parse(node.Attributes["Params"].InnerText));
            Depends.Add(heightmap.ComponentID, dep);

            if (!string.IsNullOrEmpty(heightmap.TextureMap) && !string.IsNullOrEmpty(heightmap.HeightMap) && heightmap.Params != null)
            {
                heightmap.Load(X.Content);
            }

            X_Editor.Tools.AddXComponentToSceneList(scene, heightmap, group);
        }