public void writeSettings()
        {
            Settings EditorSettings = "EditorSettings";

            ShapeEditor.ShapeEdPreviewGui ShapeEdPreviewGui  = "ShapeEdPreviewGui";
            ShapeEditor.ShapeEdMaterials  ShapeEdMaterials   = "ShapeEdMaterials";
            ShapeEditorToolbar            ShapeEditorToolbar = "ShapeEditorToolbar";

            ShapeEditor.ShapeEdMountWindow ShapeEdMountWindow = "ShapeEdMountWindow";
            ShapeEditor.ShapeEdShapeView   ShapeEdShapeView   = "ShapeEdShapeView";

            GuiSwatchButtonCtrl previewBackground = ShapeEdPreviewGui.FOT("previewBackground");
            GuiCheckBoxCtrl     highlightMaterial = ShapeEdMaterials.FOT("highlightMaterial");
            GuiBitmapButtonCtrl showNodes         = ShapeEditorToolbar.FOT("showNodes");
            GuiBitmapButtonCtrl showBounds        = ShapeEditorToolbar.FOT("showBounds");
            GuiBitmapButtonCtrl showObjBox        = ShapeEditorToolbar.FOT("showObjBox");
            GuiBitmapButtonCtrl showAdvanced      = ShapeEditorToolbar.FOT("showAdvanced");
            GuiBitmapButtonCtrl showGridBtn       = ShapeEditorToolbar.FOT("showGridBtn");
            GuiBitmapButtonCtrl renderColMeshes   = ShapeEditorToolbar.FOT("renderColMeshes");
            GuiCheckBoxCtrl     renderMounts      = ShapeEdMountWindow.FOT("renderMounts");

            EditorSettings.beginGroup("ShapeEditor", true);

            // Display options
            EditorSettings.setValue("BackgroundColor", ColorPickerDlg.ColorFloatToInt(previewBackground["color"]));
            EditorSettings.setValue("HighlightMaterial", highlightMaterial.getValue());
            EditorSettings.setValue("ShowNodes", showNodes.getValue());
            EditorSettings.setValue("ShowBounds", showBounds.getValue());
            EditorSettings.setValue("ShowObjBox", showObjBox.getValue());
            EditorSettings.setValue("RenderCollision", renderColMeshes.getValue());
            EditorSettings.setValue("RenderMounts", renderMounts.getValue());

            // Grid
            EditorSettings.setValue("ShowGrid", showGridBtn.getValue());
            EditorSettings.setValue("GridSize", ShapeEdShapeView["gridSize"]);
            EditorSettings.setValue("GridDimension", ShapeEdShapeView["gridDimension"]);

            // Sun
            EditorSettings.setValue("SunDiffuseColor", ShapeEdShapeView["sunDiffuse"]);
            EditorSettings.setValue("SunAmbientColor", ShapeEdShapeView["sunAmbient"]);
            EditorSettings.setValue("SunAngleX", ShapeEdShapeView["sunAngleX"]);
            EditorSettings.setValue("SunAngleZ", ShapeEdShapeView["sunAngleZ"]);

            // Sub-windows
            EditorSettings.setValue("AdvancedWndVisible", showAdvanced.getValue());

            EditorSettings.endGroup();
        }
        public void readSettings()
        {
            Settings EditorSettings = "EditorSettings";

            ShapeEditor.ShapeEdPreviewGui ShapeEdPreviewGui  = "ShapeEdPreviewGui";
            ShapeEditor.ShapeEdMaterials  ShapeEdMaterials   = "ShapeEdMaterials";
            ShapeEditorToolbar            ShapeEditorToolbar = "ShapeEditorToolbar";

            ShapeEditor.ShapeEdMountWindow ShapeEdMountWindow = "ShapeEdMountWindow";
            ShapeEditor.ShapeEdShapeView   ShapeEdShapeView   = "ShapeEdShapeView";

            GuiSwatchButtonCtrl previewBackground = ShapeEdPreviewGui.FOT("previewBackground");
            GuiCheckBoxCtrl     highlightMaterial = ShapeEdMaterials.FOT("highlightMaterial");
            GuiBitmapButtonCtrl showNodes         = ShapeEditorToolbar.FOT("showNodes");
            GuiBitmapButtonCtrl showBounds        = ShapeEditorToolbar.FOT("showBounds");
            GuiBitmapButtonCtrl showObjBox        = ShapeEditorToolbar.FOT("showObjBox");
            GuiBitmapButtonCtrl showAdvanced      = ShapeEditorToolbar.FOT("showAdvanced");
            GuiBitmapButtonCtrl showGridBtn       = ShapeEditorToolbar.FOT("showGridBtn");
            GuiBitmapButtonCtrl renderColMeshes   = ShapeEditorToolbar.FOT("renderColMeshes");
            GuiCheckBoxCtrl     renderMounts      = ShapeEdMountWindow.FOT("renderMounts");

            EditorSettings.beginGroup("ShapeEditor", true);

            // Display options
            previewBackground["color"] = ColorPickerDlg.ColorIntToFloat(EditorSettings.value("BackgroundColor"));
            SetToggleButtonValue(highlightMaterial, EditorSettings.value("HighlightMaterial"));
            SetToggleButtonValue(showNodes, EditorSettings.value("ShowNodes"));
            SetToggleButtonValue(showBounds, EditorSettings.value("ShowBounds"));
            SetToggleButtonValue(showObjBox, EditorSettings.value("ShowObjBox"));
            SetToggleButtonValue(renderColMeshes, EditorSettings.value("RenderCollision"));
            SetToggleButtonValue(renderMounts, EditorSettings.value("RenderMounts"));

            // Grid
            SetToggleButtonValue(showGridBtn, EditorSettings.value("ShowGrid"));
            ShapeEdShapeView["gridSize"]      = EditorSettings.value("GridSize");
            ShapeEdShapeView["gridDimension"] = EditorSettings.value("GridDimension");

            // Sun
            ShapeEdShapeView["sunDiffuse"] = EditorSettings.value("SunDiffuseColor");
            ShapeEdShapeView["sunAmbient"] = EditorSettings.value("SunAmbientColor");

            // Sub-windows
            SetToggleButtonValue(showAdvanced, EditorSettings.value("AdvancedWndVisible"));

            EditorSettings.endGroup();
        }