Exemplo n.º 1
0
        private void SaveGuiSettings(bool importVMap, bool importColMap)
        {
            var guiInputSettings = new GuiInputPreferences();

            guiInputSettings.Scaling                 = NUD_Scaling.Value;
            guiInputSettings.ReduceDupVerts          = SwitchButton_EnableReduceVertices.Value;
            guiInputSettings.ResizeTextures          = SwitchButton_ResizeTextures.Value;
            guiInputSettings.CenterModel             = SwitchButton_CenterModel.Value;
            guiInputSettings.Shading.AmbientColor    = ColorPickerButton_ShadingAmbient.SelectedColor;
            guiInputSettings.Shading.DiffuseColor    = ColorPickerButton_ShadingDiffuse.SelectedColor;
            guiInputSettings.Shading.DiffusePosition = curDiffusePos;
            if (SwitchButton_EnableFog.Value)
            {
                guiInputSettings.Fog = new Fog()
                {
                    Color = ColorPickerButton_FogColor.SelectedColor, Type = (FogPreset)ComboBox_FogTyp.SelectedIndex
                };
            }
            else
            {
                guiInputSettings.Fog = null;
            }

            if (importVMap)
            {
                guiInputSettings.Save(curModelFile + EXT_CONVERSION_PREFERENCES);
            }

            if (importColMap)
            {
                guiInputSettings.Save(curCollisionFile + EXT_CONVERSION_PREFERENCES);
            }
        }