Exemplo n.º 1
0
            public override void onWake()
            {
                Settings EditorSettings = "EditorSettings";
                string   color          = EditorSettings.value(((SimObject)getParent())["editorSettingsValue"]);

                this["color"] = ColorPickerDlg.ColorIntToFloat(color);
            }
Exemplo n.º 2
0
            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);
            }
Exemplo n.º 3
0
        private void ColorPanel_DoubleClick(object sender, EventArgs e)
        {
            if (ColorPickerDlg.ShowDialog() == DialogResult.OK)
            {
                this.DisplayColor = ColorPickerDlg.Color;
            }

            if (DisplayColorChanged != null)
            {
                DisplayColorChanged(this, EventArgs.Empty);
            }
        }
Exemplo n.º 4
0
 public static void initialize()
 {
     //omni.Util.exec("tools/gui/fileDialogBase.ed.cs",false,false);
     MessageBoxSaveChangesDlg.initialize();
     simViewDlg.initialize();
     ColorPickerDlg.initialize();
     MaterialSelector.initialize();
     ScriptEditorDlg.initialize();
     ColladaImportDlg.initialize();
     EditorLoadingGui.initialize();
     GuiEaseEditDlg.initialize();
     GuiObjectInspector.initialize();
     UVEditorOverlay.initialize();
 }
        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();
        }
Exemplo n.º 7
0
        public void transparentCheck(GuiControl ctrl, string colorName)
        {
            bool transparent = ctrl.transparentControlCheck();

            if (transparent)
            {
                return;
            }

            if (colorName == "fillColor")
            {
                ColorPickerDlg.GetColorI(ctrl.controlFillColor.AsString(), ctrl + ".setControlFillColor", ctrl.getRoot(), ctrl + ".setControlFillColor", ctrl + ".setControlFillColor");
            }
            else if (colorName == "backColor")
            {
                ColorPickerDlg.GetColorI(ctrl.backgroundColor.AsString(), ctrl + ".setControlBackgroundColor", ctrl.getRoot(), ctrl + ".setControlBackgroundColor", ctrl + ".setControlBackgroundColor");
            }
        }
Exemplo n.º 8
0
        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"]);
                }
            }
        }
Exemplo n.º 9
0
            public override void onClick(string SelectedidString)
            {
                string colorfloattoint = ColorPickerDlg.ColorFloatToInt(this["color"]);

                ColorPickerDlg.GetColorI(colorfloattoint, getId() + ".apply", getRoot(), "", "");
            }