Beispiel #1
0
        private void OpenMenu_Click(object sender, EventArgs e)
        {
            var openFileDialog = new OpenFileDialog()
            {
                Filter = @"SHMD File (*.shmd)|*.shmd"
            };

            if (openFileDialog.ShowDialog() == DialogResult.OK)
            {
                Path    = openFileDialog.FileName;
                SHMD    = SHMD.Load(Path);
                General = new General(SHMD.Header, SHMD.GlobalLight, SHMD.Fog, SHMD.BackGroundColor, SHMD.Frustum, SHMD.DirectionLightAmbient, SHMD.DirectionLightDiffuse);

                GeneralProperties.SelectedObject = General;
                GeneralProperties.ExpandAllGridItems();

                SkyBox.DataSource           = SHMD.Sky.MapElements;
                WaterBox.DataSource         = SHMD.Water.MapElements;
                GroundObjectsBox.DataSource = SHMD.GroundObject.MapElements;
                MapObjectsBox.DataSource    = SHMD.MapObjects;

                CheckComponents(true);
                Refresh();
            }
        }
Beispiel #2
0
        public void InitializeSHMD()
        {
            AddSkyObjectTextBox.AutoSize = false;
            AddSkyObjectTextBox.Height   = 22;

            AddWaterObjectTextBox.AutoSize = false;
            AddWaterObjectTextBox.Height   = 22;

            AddGroundObjectTextBox.AutoSize = false;
            AddGroundObjectTextBox.Height   = 22;

            AddMapObjectTextBox.AutoSize = false;
            AddMapObjectTextBox.Height   = 22;

            General = new General(MBI.SHMD.Header, MBI.SHMD.GlobalLight, MBI.SHMD.Fog, MBI.SHMD.BackGroundColor, MBI.SHMD.Frustum, MBI.SHMD.DirectionLightAmbient, MBI.SHMD.DirectionLightDiffuse);

            GeneralProperties.SelectedObject = General;
            GeneralProperties.ExpandAllGridItems();

            SkyBox.DataSource           = MBI.SHMD.Sky.MapElements;
            WaterBox.DataSource         = MBI.SHMD.Water.MapElements;
            GroundObjectsBox.DataSource = MBI.SHMD.GroundObject.MapElements;
            MapObjectsBox.DataSource    = MBI.SHMD.MapObjects;

            CheckSHMDComponents(true);
            Refresh();
        }