Пример #1
0
        public override void onDeactivated()
        {
            GuiMeshRoadEditorCtrl MeshRoadEditorGui           = "MeshRoadEditorGui";
            GuiControl            MeshRoadEditorToolbar       = "MeshRoadEditorToolbar";
            GuiWindowCollapseCtrl MeshRoadEditorOptionsWindow = "MeshRoadEditorOptionsWindow";

            MeshRoadEditorGui.MeshRoadEditorTreeWindow MeshRoadEditorTreeWindow = "MeshRoadEditorTreeWindow";
            GizmoProfile GlobalGizmoProfile = "GlobalGizmoProfile";

            //Copyright Winterleaf Entertainment L.L.C. 2013
            if (!this["isActive"].AsBool())
            {
                return;
            }
            this["isActive"] = false.AsString();
            //Copyright Winterleaf Entertainment L.L.C. 2013
            this.writeSettings();

            MeshRoadEditorGui.setVisible(false);
            MeshRoadEditorOptionsWindow.setVisible(false);
            MeshRoadEditorToolbar.setVisible(false);
            MeshRoadEditorTreeWindow.setVisible(false);
            this.map.pop();

            // Restore the previous Gizmo
            // alignment settings.
            GlobalGizmoProfile["alignment"] = this["prevGizmoAlignment"];

            base.onDeactivated();
        }
Пример #2
0
        public override void onActivated()
        {
            GuiMeshRoadEditorCtrl MeshRoadEditorGui           = "MeshRoadEditorGui";
            GuiControl            MeshRoadEditorToolbar       = "MeshRoadEditorToolbar";
            GuiWindowCollapseCtrl MeshRoadEditorOptionsWindow = "MeshRoadEditorOptionsWindow";

            MeshRoadEditorGui.MeshRoadEditorTreeWindow MeshRoadEditorTreeWindow = "MeshRoadEditorTreeWindow";
            GuiTreeViewCtrl MeshRoadTreeView = "MeshRoadTreeView";

            EditorGui.EditorGuiStatusBar EditorGuiStatusBar = "EditorGuiStatusBar";
            GizmoProfile GlobalGizmoProfile = "GlobalGizmoProfile";
            EditorGui    EditorGui          = "EditorGui";

            //Copyright Winterleaf Entertainment L.L.C. 2013
            this["isActive"] = true.AsString();
            //Copyright Winterleaf Entertainment L.L.C. 2013
            this.readSettings();

            ((GuiBitmapButtonCtrl)
             ((GuiDynamicCtrlArrayControl)"ToolsPaletteArray").findObjectByInternalName(
                 "MeshRoadEditorAddRoadMode", false)).performClick();
            EditorGui.bringToFront("MeshRoadEditorGui");
            MeshRoadEditorGui.setVisible(true);
            MeshRoadEditorGui.makeFirstResponder(true);
            MeshRoadEditorOptionsWindow.setVisible(true);
            MeshRoadEditorToolbar.setVisible(true);
            MeshRoadEditorTreeWindow.setVisible(true);
            MeshRoadTreeView.open("ServerMeshRoadSet", true);
            this.map.push();

            // Store this on a dynamic field
            // in order to restore whatever setting
            // the user had before.
            this["prevGizmoAlignment"] = GlobalGizmoProfile["alignment"];

            // The DecalEditor always uses Object alignment.
            GlobalGizmoProfile["alignment"] = "Object";

            // Set the status bar here until all tool have been hooked up
            EditorGuiStatusBar.setInfo("Mesh road editor.");
            EditorGuiStatusBar.setSelection("");

            base.onActivated();
        }
Пример #3
0
        public void writeSettings()
        {
            Settings EditorSettings = "EditorSettings";
            GuiMeshRoadEditorCtrl MeshRoadEditorGui = "MeshRoadEditorGui";

            EditorSettings.beginGroup("MeshRoadEditor", true);

            EditorSettings.setValue("DefaultWidth", MeshRoadEditorGui["DefaultWidth"]);
            EditorSettings.setValue("DefaultDepth", MeshRoadEditorGui["DefaultDepth"]);
            EditorSettings.setValue("DefaultNormal", MeshRoadEditorGui["DefaultNormal"]);
            EditorSettings.setValue("HoverSplineColor", MeshRoadEditorGui["HoverSplineColor"]);
            EditorSettings.setValue("SelectedSplineColor", MeshRoadEditorGui["SelectedSplineColor"]);
            EditorSettings.setValue("HoverNodeColor", MeshRoadEditorGui["HoverNodeColor"]);
            EditorSettings.setValue("TopMaterialName", MeshRoadEditorGui["topMaterialName"]);
            EditorSettings.setValue("BottomMaterialName", MeshRoadEditorGui["bottomMaterialName"]);
            EditorSettings.setValue("SideMaterialName", MeshRoadEditorGui["sideMaterialName"]);

            EditorSettings.endGroup();
        }