Пример #1
0
        public static void initializeDecalEditor()
        {
            Omni.self.Print(" % - Initializing Decal Editor");
            omni.sGlobal["$decalDataFile"] = "art/decals/managedDecalData.cs";
            gui.DecalEditorGui.initialize();

            // Add ourselves to EditorGui, where all the other tools reside
            DecalEditorGui DecalEditorGui = "DecalEditorGui";

            DecalEditorGui.setVisible(false);

            DecalEditorGui.DecalPreviewWindow DecalPreviewWindow = "DecalPreviewWindow";

            DecalPreviewWindow.setVisible(false);
            DecalEditorGui.DecalEditorWindow DecalEditorWindow = "DecalEditorWindow";
            DecalEditorWindow.setVisible(false);

            EditorGui EditorGui = "EditorGui";

            EditorGui.add(DecalEditorGui);
            EditorGui.add(DecalEditorWindow);
            EditorGui.add(DecalPreviewWindow);

            DecalEditorGui.DecalEditorTabBook DecalEditorTabBook = "DecalEditorTabBook";
            DecalEditorTabBook.selectPage(0);

            ObjectCreator oc = new ObjectCreator("ScriptObject", "DecalEditorPlugin", typeof(DecalEditorPlugin));

            oc["editorGui"] = "DecalEditorGui";
            oc.Create();

            DecalEditorPlugin DecalEditorPlugin = "DecalEditorPlugin";

            DecalEditorPlugin.initialize();
        }
Пример #2
0
        public override void onDeactivated()
        {
            DecalEditorGui        DecalEditorGui     = "DecalEditorGui";
            GuiWindowCollapseCtrl DecalPreviewWindow = "DecalPreviewWindow";
            GuiWindowCollapseCtrl DecalEditorWindow  = "DecalEditorWindow";
            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
            DecalEditorGui.setVisible(false);
            DecalPreviewWindow.setVisible(false);
            DecalEditorWindow.setVisible(false);

            this.map.pop();

            // Remember last palette selection
            this["paletteSelection"] = DecalEditorGui.getMode();

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

            base.onDeactivated();
        }
Пример #3
0
        public override void onEditMenuSelect(string editMenu)
        {
            DecalEditorGui DecalEditorGui = "DecalEditorGui";

            bool hasSelection = DecalEditorGui.getSelectionCount() > 0;

            ((PopupMenu)editMenu).enableItem(3, false);        // Cut
            ((PopupMenu)editMenu).enableItem(4, false);        // Copy
            ((PopupMenu)editMenu).enableItem(5, false);        // Paste
            ((PopupMenu)editMenu).enableItem(6, hasSelection); // Delete
            ((PopupMenu)editMenu).enableItem(8, false);        // Deselect

            // NOTE: If you want to implement Cut, Copy, Paste, or Deselect
            // for this editor simply enable the menu items when it is appropriate
            // and fill in the method stubs below.
        }
Пример #4
0
            public override void undo()
            {
                DecalEditorGui DecalEditorGui = "DecalEditorGui";

                int count = Util.getWordCount(this["oldTransformData"]);

                if (this["instanceId"] != "" && count == 7)
                {
                    string[] data = this["newTransformData"].Split(' ');
                    Point3F  pos  = new Point3F(data[0].AsFloat(), data[1].AsFloat(), data[2].AsFloat());
                    Point3F  tan  = new Point3F(data[3].AsFloat(), data[4].AsFloat(), data[5].AsFloat());
                    float    size = data[6].AsFloat();

                    DecalEditorGui.editDecalDetails(this["instanceId"].AsUint(), pos, tan, size);
                    DecalEditorGui.syncNodeDetails();
                    DecalEditorGui.selectDecal(this["instanceId"].AsUint());
                }
            }
Пример #5
0
        public override void onActivated()
        {
            DecalEditorGui        DecalEditorGui     = "DecalEditorGui";
            EditorGui             EditorGui          = "EditorGui";
            GuiWindowCollapseCtrl DecalPreviewWindow = "DecalPreviewWindow";
            GuiWindowCollapseCtrl DecalEditorWindow  = "DecalEditorWindow";
            GizmoProfile          GlobalGizmoProfile = "GlobalGizmoProfile";

            //Copyright Winterleaf Entertainment L.L.C. 2013
            this["isActive"] = true.AsString();
            //Copyright Winterleaf Entertainment L.L.C. 2013
            EditorGui.bringToFront(DecalEditorGui);
            DecalEditorGui.setVisible(true);
            DecalEditorGui.makeFirstResponder(true);
            DecalPreviewWindow.setVisible(true);
            DecalEditorWindow.setVisible(true);

            this.map.push();

            //WORKAROUND: due to the gizmo mode being stored on its profile (which may be shared),
            //  we may end up with a mismatch between the editor mode and gizmo mode here.
            //  Reset mode explicitly here to work around this.
            DecalEditorGui.setMode(DecalEditorGui.getMode());

            // Set the current palette selection
            DecalEditorGui.paletteSync(this["paletteSelection"]);

            // 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";

            DecalEditorGui.rebuildInstanceTree();

            // These could perhaps be the node details like the shape editor
            //ShapeEdPropWindow.syncNodeDetails(-1);

            base.onActivated();
        }
Пример #6
0
        public override void handleDelete()
        {
            DecalEditorGui DecalEditorGui = "DecalEditorGui";

            DecalEditorGui.deleteSelectedDecal();
        }