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 override void onControlDropped(GuiControl payload, string position) { if (!payload.parentGroup.isInNamespaceHierarchy("GuiDragAndDropControlType_ColorSwatch")) { return; } // If dropped on same button whence we came from, // do nothing. if (payload["dragSourceControl"] == this) { return; } // If a swatch button control is dropped onto this control, // copy it's color. if (payload.isMemberOfClass("GuiSwatchButtonCtrl")) { // If the swatch button is part of a color-type inspector field, // remember the inspector field so we can later set the color // through it. if (this.parentGroup.isMemberOfClass("GuiInspectorTypeColorI")) { ((GuiInspectorTypeColorI)this.parentGroup).apply(ColorPickerDlg.ColorFloatToInt(payload["color"])); } else if (this.parentGroup.isMemberOfClass("GuiInspectorTypeColorF")) { ((GuiInspectorTypeColorF)this.parentGroup).apply(payload["color"]); } else { this.setColor(payload["color"]); } } }
public override void onClick(string SelectedidString) { string colorfloattoint = ColorPickerDlg.ColorFloatToInt(this["color"]); ColorPickerDlg.GetColorI(colorfloattoint, getId() + ".apply", getRoot(), "", ""); }