public override void onWake() { Settings EditorSettings = "EditorSettings"; string color = EditorSettings.value(((SimObject)getParent())["editorSettingsValue"]); this["color"] = ColorPickerDlg.ColorIntToFloat(color); }
public void apply(string color) { Settings EditorSettings = "EditorSettings"; EditorSettings.setValue(this["editorSettingsValue"], color); Util.eval(this["editorSettingsRead"]); ((GuiTextEditCtrl)this.findObjectByInternalName("ColorEdit", true)).setText(color); ((GuiSwatchButtonCtrl)this.findObjectByInternalName("ColorButton", true))["color"] = ColorPickerDlg.ColorIntToFloat(color); }
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(); }