Пример #1
0
        public void AddToTree(WorldTreeNode parentNode)
        {
            // add the world node
            node = app.MakeTreeNode(this, NodeName);
            treeView.Nodes.Add(node);

            // build the menu
            CommandMenuBuilder menuBuilder = new CommandMenuBuilder();

            menuBuilder.Add("Create Object Collection", new CreateWorldCollectionCommandFactory(app, ((IObjectCollectionParent)this)), app.DefaultCommandClickHandler);
            menuBuilder.Add("Copy Description", "", app.copyToClipboardMenuButton_Click);
            menuBuilder.Add("Help", "World_Root", app.HelpClickHandler);
            node.ContextMenuStrip = menuBuilder.Menu;

            // traverse children
            worldTerrain.AddToTree(node);
            ocean.AddToTree(node);
            skybox.AddToTree(node);
            fog.AddToTree(node);
            ambientLight.AddToTree(node);
            directionalLight.AddToTree(node);

//             pathObjectTypes.AddToTree(node);
            foreach (WorldObjectCollection child in worldCollections)
            {
                child.AddToTree(node);
            }

            inTree    = true;
            buttonBar = menuBuilder.ButtonBar;
        }
Пример #2
0
        public void AddToTree(WorldTreeNode parentNode)
        {
            if (parentNode != null)
            {
                this.parentNode = parentNode;

                inTree = true;

                // create a node for the collection and add it to the parent
                node = app.MakeTreeNode(this, NodeName);
                parentNode.Nodes.Add(node);

                foreach (IWorldObject obj in children)
                {
                    obj.AddToTree(node);
                }

                // build the menu
                CommandMenuBuilder menuBuilder = new CommandMenuBuilder();
                menuBuilder.Add("Drag Road", new DragObjectsFromMenuCommandFactory(app), app.DefaultCommandClickHandler);
                menuBuilder.AddDropDown("Move to Collection", menuBuilder.ObjectCollectionDropDown_Opening);
                menuBuilder.FinishDropDown();
                menuBuilder.Add("Copy Description", "", app.copyToClipboardMenuButton_Click);
                menuBuilder.Add("Help", "Road", app.HelpClickHandler);
                menuBuilder.Add("Delete", new DeleteObjectCommandFactory(app, parent, this), app.DefaultCommandClickHandler);
                node.ContextMenuStrip = menuBuilder.Menu;
                buttonBar             = menuBuilder.ButtonBar;
            }
            else
            {
                inTree = false;
            }
        }
Пример #3
0
        public void AddToTree(WorldTreeNode parentNode)
        {
            if (!inTree && parentNode != null)
            {
                this.parentNode = parentNode;

                // add the terrain node
                node = app.MakeTreeNode(this, NodeName);
                parentNode.Nodes.Add(node);

                CommandMenuBuilder menuBuilder = new CommandMenuBuilder();

                menuBuilder.Add("Drag Decal", new DragObjectsFromMenuCommandFactory(app), app.DefaultCommandClickHandler);
                menuBuilder.Add("Copy Description", "", app.copyToClipboardMenuButton_Click);
                menuBuilder.AddDropDown("Move to Collection", menuBuilder.ObjectCollectionDropDown_Opening);
                menuBuilder.Add("Help", ObjectType, app.HelpClickHandler);
                menuBuilder.Add("Delete", new DeleteObjectCommandFactory(app, parent, this), app.DefaultCommandClickHandler);
                node.ContextMenuStrip = menuBuilder.Menu;
                inTree    = true;
                buttonBar = menuBuilder.ButtonBar;
            }
            else
            {
                inTree = false;
            }
        }
Пример #4
0
 private void buildMenu(WorldTreeNode node)
 {
     if (inTree && node != null)
     {
         CommandMenuBuilder menuBuilder = new CommandMenuBuilder();
         if (loaded)
         {
             menuBuilder.Add("Create Object Collection", new CreateWorldCollectionCommandFactory(app, (IObjectCollectionParent)this), app.DefaultCommandClickHandler);
             menuBuilder.Add("Add Object", new AddObjectCommandFactory(app, this), app.DefaultCommandClickHandler);
             menuBuilder.Add("Add Road", new AddRoadCommandFactory(app, this), app.DefaultCommandClickHandler);
             menuBuilder.Add("Add Marker", new AddMarkerCommandFactory(app, this), app.DefaultCommandClickHandler);
             menuBuilder.Add("Add Marker at Camera", new AddMarkerAtCameraCommandFactory(app, this), app.DefaultCommandClickHandler);
             menuBuilder.Add("Add Region", new AddRegionCommandFactory(app, this), app.DefaultCommandClickHandler);
             menuBuilder.Add("Add Point Light", new AddPointLightCommandFactory(app, this), app.DefaultCommandClickHandler);
             menuBuilder.Add("Add Terrain Decal", new AddTerrainDecalCommandFactory(app, this), app.DefaultCommandClickHandler);
             menuBuilder.AddDropDown("Move to Collection", menuBuilder.ObjectCollectionMoveDropDown_Opening);
             menuBuilder.FinishDropDown();
             menuBuilder.Add("Copy Description", "", app.copyToClipboardMenuButton_Click);
             menuBuilder.Add("Unload Collection", new UnloadCollectionCommandFactory(app, this), app.DefaultCommandClickHandler);
             if (inScene)
             {
                 menuBuilder.Add("Remove From Scene", this, app.RemoveCollectionFromSceneClickHandler);
                 node.ImageIndex         = 3;
                 node.SelectedImageIndex = 3;
             }
             else
             {
                 menuBuilder.Add("Add To Scene", this, app.AddCollectionToSceneClickHandler);
                 node.ImageIndex         = 2;
                 node.SelectedImageIndex = 2;
             }
             menuBuilder.Add("Help", "Collection", app.HelpClickHandler);
             menuBuilder.Add("Delete", new DeleteObjectCommandFactory(app, parent, this), app.DefaultCommandClickHandler);
             node.ContextMenuStrip = menuBuilder.Menu;
             buttonBar             = menuBuilder.ButtonBar;
         }
         else
         {
             if (buttonBar != null)
             {
                 buttonBar.Clear();
             }
             menuBuilder.Add("Load Collection", new LoadCollectionCommandFactory(app, this), app.DefaultCommandClickHandler);
             node.ContextMenuStrip   = menuBuilder.Menu;
             node.ImageIndex         = 1;
             node.SelectedImageIndex = 1;
             buttonBar = menuBuilder.ButtonBar;
         }
         app.UpdateButtonBar();
     }
 }
Пример #5
0
        public void AddToTree(WorldTreeNode parentNode)
        {
            this.parentNode = parentNode;

            // add the Path Object Types node
            node = app.MakeTreeNode(this, "Path Object Type " + pathObjectType.name);
            parentNode.Nodes.Add(node);

            CommandMenuBuilder menuBuilder = new CommandMenuBuilder();

            menuBuilder.Add("Edit Path Object Type", new EditPathObjectTypeCommandFactory(app, parent, this), app.DefaultCommandClickHandler);
            menuBuilder.Add("Copy Description", "", app.copyToClipboardMenuButton_Click);
            menuBuilder.Add("Delete Path Object Type", new DeletePathObjectTypeCommandFactory(app, parent, this), app.DefaultCommandClickHandler);
            node.ContextMenuStrip = menuBuilder.Menu;
            buttonBar             = menuBuilder.ButtonBar;
        }
        public void AddToTree(WorldTreeNode parentNode)
        {
            this.parentNode = parentNode;

            // add the Fog node
            node = app.MakeTreeNode(this, "Directional Light");
            parentNode.Nodes.Add(node);

            CommandMenuBuilder menuBuilder = new CommandMenuBuilder();

            menuBuilder.Add("Copy Description", "", app.copyToClipboardMenuButton_Click);
            menuBuilder.Add("Help", "Directional_Light", app.HelpClickHandler);
            menuBuilder.Add("Delete", new DeleteObjectCommandFactory(app, parent, this), app.DefaultCommandClickHandler);
            node.ContextMenuStrip = menuBuilder.Menu;
            buttonBar             = menuBuilder.ButtonBar;
        }
Пример #7
0
        public void AddToTree(WorldTreeNode parentNode)
        {
            this.parentNode = parentNode;

            // add the Fog node
            node = app.MakeTreeNode(this, "Global Fog");
            parentNode.Nodes.Add(node);

            CommandMenuBuilder menuBuilder = new CommandMenuBuilder();

            menuBuilder.Add("Copy Description", "", app.copyToClipboardMenuButton_Click);
            menuBuilder.Add("Help", "Global_Fog", app.HelpClickHandler);

            node.ContextMenuStrip = menuBuilder.Menu;
            buttonBar             = menuBuilder.ButtonBar;
        }
        public void AddToTree(WorldTreeNode parentNode)
        {
            this.parentNode = parentNode;

            // add the terrain node
            node = app.MakeTreeNode(this, "Terrain Display");
            parentNode.Nodes.Add(node);

            CommandMenuBuilder menuBuilder = new CommandMenuBuilder();

            menuBuilder.Add("Copy Description", "", app.copyToClipboardMenuButton_Click);
            menuBuilder.Add("Help", "Alpha_Splat_Terrain_Display", app.HelpClickHandler);

            node.ContextMenuStrip = menuBuilder.Menu;
            inTree    = true;
            buttonBar = menuBuilder.ButtonBar;
        }
        public void AddToTree(WorldTreeNode parentNode)
        {
            this.parentNode = parentNode;
            inTree          = true;

            // create a node for the collection and add it to the parent
            node = new WorldTreeNode(this, NodeName);

            parentNode.Nodes.Add(node);

            points.AddToTree(node);
            // build the menu
            CommandMenuBuilder menuBuilder = new CommandMenuBuilder();

            menuBuilder.Add("Delete Path", new DeleteInteriorPathCommandFactory(app, parent, this), app.DefaultCommandClickHandler);
            node.ContextMenuStrip = menuBuilder.Menu;
        }
Пример #10
0
        public void AddToTree(WorldTreeNode parentNode)
        {
            this.parentNode = parentNode;
            inTree          = true;

            // create a node for the collection and add it to the parent
            this.node = app.MakeTreeNode(this, "Fog");
            parentNode.Nodes.Add(node);

            // build the menu
            CommandMenuBuilder menuBuilder = new CommandMenuBuilder();

            menuBuilder.Add("Copy Description", "", app.copyToClipboardMenuButton_Click);
            menuBuilder.Add("Help", "Fog", app.HelpClickHandler);
            menuBuilder.Add("Delete", new DeleteObjectCommandFactory(app, parent, this), app.DefaultCommandClickHandler);
            node.ContextMenuStrip = menuBuilder.Menu;
            buttonBar             = menuBuilder.ButtonBar;
        }
        public void AddToTree(WorldTreeNode parentNode)
        {
            if (parentNode != null && !inTree)
            {
                this.parentNode = parentNode;
                inTree          = true;

                // create a node for the collection and add it to the parent
                node = app.MakeTreeNode(this, NodeName);
                parentNode.Nodes.Add(node);

                // build the menu
                CommandMenuBuilder menuBuilder = new CommandMenuBuilder();
                menuBuilder.Add("Attach Particle Effect", new AddWaypointParticleEffectCommandFactory(app, this), app.DefaultCommandClickHandler);
                menuBuilder.Add("Add Spawn Generator", new AddSpawnGenToMarkerCommandFactory(app, this), app.DefaultCommandClickHandler);
                menuBuilder.Add("Add Sound", new AddSoundCommandFactory(app, this), app.DefaultCommandClickHandler);
                menuBuilder.AddDropDown("View From");
                menuBuilder.Add("Above", new DirectionAndMarker(CameraDirection.Above, this), app.CameraMarkerDirClickHandler);
                menuBuilder.Add("North", new DirectionAndMarker(CameraDirection.North, this), app.CameraMarkerDirClickHandler);
                menuBuilder.Add("South", new DirectionAndMarker(CameraDirection.South, this), app.CameraMarkerDirClickHandler);
                menuBuilder.Add("West", new DirectionAndMarker(CameraDirection.West, this), app.CameraMarkerDirClickHandler);
                menuBuilder.Add("East", new DirectionAndMarker(CameraDirection.East, this), app.CameraMarkerDirClickHandler);
                menuBuilder.FinishDropDown();
                menuBuilder.Add("Drag Marker", new DragObjectsFromMenuCommandFactory(app), app.DefaultCommandClickHandler);
                menuBuilder.AddDropDown("Move to Collection", menuBuilder.ObjectCollectionDropDown_Opening);
                menuBuilder.FinishDropDown();
                menuBuilder.Add("Copy Description", "", app.copyToClipboardMenuButton_Click);
                menuBuilder.Add("Help", "Marker", app.HelpClickHandler);
                menuBuilder.Add("Delete", new DeleteObjectCommandFactory(app, parent, this), app.DefaultCommandClickHandler);
                node.ContextMenuStrip = menuBuilder.Menu;

                foreach (IWorldObject child in children)
                {
                    child.AddToTree(node);
                }
                buttonBar = menuBuilder.ButtonBar;
            }
            else
            {
                inTree = false;
            }
        }
        public void AddToTree(WorldTreeNode parentNode)
        {
            this.parentNode = parentNode;
            if (!inTree)
            {
                inTree = true;

                // create a node for the collection and add it to the parent
                node = app.MakeTreeNode(this, Name);
                parentNode.Nodes.Add(this.Node);

                // build the menu
                CommandMenuBuilder menuBuilder = new CommandMenuBuilder();
                menuBuilder.Add("Copy Description", "", app.copyToClipboardMenuButton_Click);
                menuBuilder.Add("Drag Point", new DragMPPointCommandFactory(app, this), app.DefaultCommandClickHandler);
                menuBuilder.Add("Insert new points", new InsertPointsCommandFactory(app, (IWorldContainer)parent, this.PointNum), app.DefaultCommandClickHandler);
                menuBuilder.Add("Delete", new DeletePointCommandFactory(app, parent, this), app.DefaultCommandClickHandler);
                node.ContextMenuStrip = menuBuilder.Menu;
                buttonBar             = menuBuilder.ButtonBar;
            }
        }
        public void AddToTree(WorldTreeNode parentNode)
        {
            this.parentNode = parentNode;

            // add the terrain node
            node = app.MakeTreeNode(this, "Terrain");
            parentNode.Nodes.Add(node);

            CommandMenuBuilder menuBuilder = new CommandMenuBuilder();

            menuBuilder.Add("Load Terrain", new LoadTerrainCommandFactory(app), app.DefaultCommandClickHandler);
            menuBuilder.Add("Copy Description", "", app.copyToClipboardMenuButton_Click);
            menuBuilder.Add("Help", "Terrain", app.HelpClickHandler);

            node.ContextMenuStrip = menuBuilder.Menu;

            terrainDisplay.AddToTree(node);

            inTree    = true;
            buttonBar = menuBuilder.ButtonBar;
        }
Пример #14
0
        public void AddToTree(WorldTreeNode parentNode)
        {
            this.parentNode = parentNode;

            // add the Creature Classes node
            node = app.MakeTreeNode(this, "Path Object Types");
            parentNode.Nodes.Add(node);

            CommandMenuBuilder menuBuilder = new CommandMenuBuilder();

            menuBuilder.Add("Add Path Object Type", new AddPathObjectTypeCommandFactory(app, this), app.DefaultCommandClickHandler);
            menuBuilder.Add("Copy Description", "", app.copyToClipboardMenuButton_Click);
            node.ContextMenuStrip = menuBuilder.Menu;

            foreach (PathObjectTypeNode pathObjectType in pathObjectTypes)
            {
                pathObjectType.AddToTree(node);
            }

            inTree    = true;
            buttonBar = menuBuilder.ButtonBar;
        }
Пример #15
0
        public void AddToTree(WorldTreeNode parentNode)
        {
            if (parentNode != null)
            {
                this.parentNode = parentNode;
                inTree          = true;

                // create a node for the collection and add it to the parent
                node = app.MakeTreeNode(this, NodeName);

                parentNode.Nodes.Add(node);
                CommandMenuBuilder menuBuilder = new CommandMenuBuilder();
                menuBuilder.Add("Add Forest", new AddForestCommandFactory(app, parent, this), app.DefaultCommandClickHandler);
                menuBuilder.Add("Add Water", new AddWaterCommandFactory(app, parent, this), app.DefaultCommandClickHandler);
                menuBuilder.Add("Add Fog", new AddFogCommandFactory(app, parent, this), app.DefaultCommandClickHandler);
                menuBuilder.Add("Add Sound", new AddSoundCommandFactory(app, (IWorldContainer)this), app.DefaultCommandClickHandler);
                menuBuilder.Add("Add Vegetation", new AddGrassCommandFactory(app, parent, this), app.DefaultCommandClickHandler);
                menuBuilder.Add("Add Spawn Generator", new AddSpawnGenToRegionCommandFactory(app, this), app.DefaultCommandClickHandler);
                menuBuilder.Add("Add Ambient Light", new AddAmbientLightCommandFactory(app, this), app.DefaultCommandClickHandler);
                menuBuilder.Add("Add Directional Light", new AddDirectionalLightCommandFactory(app, this), app.DefaultCommandClickHandler);
                menuBuilder.Add("Drag Region", new DragObjectsFromMenuCommandFactory(app), app.DefaultCommandClickHandler);
                menuBuilder.AddDropDown("Move to Collection", menuBuilder.ObjectCollectionDropDown_Opening);
                menuBuilder.FinishDropDown();
                menuBuilder.Add("Copy Description", "", app.copyToClipboardMenuButton_Click);
                menuBuilder.Add("Help", "Region", app.HelpClickHandler);
                menuBuilder.Add("Delete", new DeleteObjectCommandFactory(app, parent, this), app.DefaultCommandClickHandler);

                node.ContextMenuStrip = menuBuilder.Menu;

                //			points.AddToTree(node);

                foreach (IWorldObject child in children)
                {
                    child.AddToTree(node);
                }
                buttonBar = menuBuilder.ButtonBar;
            }
        }
        public void AddToTree(WorldTreeNode parentNode)
        {
            if (!inTree)
            {
                // save parentNode for use later when removing from the tree
                this.parentNode = parentNode;



                // create a node for the collection and add it to the parent
                node = app.MakeTreeNode(this, "Points");
                CommandMenuBuilder menuBuilder = new CommandMenuBuilder();
                parentNode.Nodes.Add(node); menuBuilder.Add("Copy Description", "", app.copyToClipboardMenuButton_Click);
                menuBuilder.Add("Help", "Plant_Type", app.HelpClickHandler);
                node.ContextMenuStrip = menuBuilder.Menu;
                buttonBar             = menuBuilder.ButtonBar;// mark this object as being in the tree
                inTree = true;
            }
            // add any children to the tree
            foreach (MPPoint pt in points)
            {
                pt.AddToTree(node);
            }
        }
Пример #17
0
        public void AddToTree(WorldTreeNode parentNode)
        {
            this.parentNode = parentNode;
            inTree          = true;

            // create a node for the collection and add it to the parent
            node = app.MakeTreeNode(this, NodeName);

            parentNode.Nodes.Add(node);
            Grass grass = this;
            CommandMenuBuilder menuBuilder = new CommandMenuBuilder();

            menuBuilder.Add("Add Plant Type", new AddPlantTypeCommandFactory(app, grass), app.DefaultCommandClickHandler);
            menuBuilder.Add("Copy Description", "", app.copyToClipboardMenuButton_Click);
            menuBuilder.Add("Help", "Grass", app.HelpClickHandler);
            menuBuilder.Add("Delete", new DeleteObjectCommandFactory(app, parent, this), app.DefaultCommandClickHandler);
            node.ContextMenuStrip = menuBuilder.Menu;

            foreach (IWorldObject plant in plantList)
            {
                plant.AddToTree(node);
            }
            buttonBar = menuBuilder.ButtonBar;
        }
Пример #18
0
        public void AddToTree(WorldTreeNode parentNode)
        {
            // add the world node
            node = app.MakeTreeNode(this, NodeName);
            treeView.Nodes.Add(node);

            // build the menu
            CommandMenuBuilder menuBuilder = new CommandMenuBuilder();
            menuBuilder.Add("Create Object Collection", new CreateWorldCollectionCommandFactory(app,((IObjectCollectionParent) this)), app.DefaultCommandClickHandler);
            menuBuilder.Add("Copy Description", "", app.copyToClipboardMenuButton_Click);
            menuBuilder.Add("Help", "World_Root", app.HelpClickHandler);
            node.ContextMenuStrip = menuBuilder.Menu;

            // traverse children
            worldTerrain.AddToTree(node);
            ocean.AddToTree(node);
            skybox.AddToTree(node);
            fog.AddToTree(node);
            ambientLight.AddToTree(node);
            directionalLight.AddToTree(node);

            //             pathObjectTypes.AddToTree(node);
            foreach (WorldObjectCollection child in worldCollections)
            {
                child.AddToTree(node);
            }

            inTree = true;
            buttonBar = menuBuilder.ButtonBar;
        }
        public void AddToTree(WorldTreeNode parentNode)
        {
            this.parentNode = parentNode;
            inTree = true;

            // create a node for the collection and add it to the parent
            node = new WorldTreeNode(this, NodeName);

            parentNode.Nodes.Add(node);

            points.AddToTree(node);
            // build the menu
            CommandMenuBuilder menuBuilder = new CommandMenuBuilder();
            menuBuilder.Add("Delete Path", new DeleteInteriorPathCommandFactory(app, parent, this), app.DefaultCommandClickHandler);
            node.ContextMenuStrip = menuBuilder.Menu;
        }
Пример #20
0
        public void AddToTree(WorldTreeNode parentNode)
        {
            if (parentNode != null)
            {
                this.parentNode = parentNode;
                inTree = true;

                // create a node for the collection and add it to the parent
                node = app.MakeTreeNode(this, NodeName);

                parentNode.Nodes.Add(node);
                CommandMenuBuilder menuBuilder = new CommandMenuBuilder();
                menuBuilder.Add("Add Forest", new AddForestCommandFactory(app, parent, this), app.DefaultCommandClickHandler);
                menuBuilder.Add("Add Water", new AddWaterCommandFactory(app, parent, this), app.DefaultCommandClickHandler);
                menuBuilder.Add("Add Fog", new AddFogCommandFactory(app, parent, this), app.DefaultCommandClickHandler);
                menuBuilder.Add("Add Sound", new AddSoundCommandFactory(app, (IWorldContainer)this), app.DefaultCommandClickHandler);
                menuBuilder.Add("Add Vegetation", new AddGrassCommandFactory(app, parent, this), app.DefaultCommandClickHandler);
                menuBuilder.Add("Add Spawn Generator", new AddSpawnGenToRegionCommandFactory(app, this), app.DefaultCommandClickHandler);
                menuBuilder.Add("Add Ambient Light", new AddAmbientLightCommandFactory(app, this), app.DefaultCommandClickHandler);
                menuBuilder.Add("Add Directional Light", new AddDirectionalLightCommandFactory(app, this), app.DefaultCommandClickHandler);
                menuBuilder.Add("Drag Region", new DragObjectsFromMenuCommandFactory(app), app.DefaultCommandClickHandler);
                menuBuilder.AddDropDown("Move to Collection", menuBuilder.ObjectCollectionDropDown_Opening);
                menuBuilder.FinishDropDown();
                menuBuilder.Add("Copy Description", "", app.copyToClipboardMenuButton_Click);
                menuBuilder.Add("Help", "Region", app.HelpClickHandler);
                menuBuilder.Add("Delete", new DeleteObjectCommandFactory(app, parent, this), app.DefaultCommandClickHandler);

                node.ContextMenuStrip = menuBuilder.Menu;

                //			points.AddToTree(node);

                foreach (IWorldObject child in children)
                {
                    child.AddToTree(node);
                }
                buttonBar = menuBuilder.ButtonBar;
            }
        }
 public void UpdateButtonBar()
 {
     for (int i = toolStrip1.Items.Count - 1; i >= 0; i--)
     {
         ToolStripItem item = toolStrip1.Items[i];
         if (item.Alignment == System.Windows.Forms.ToolStripItemAlignment.Right)
         {
             toolStrip1.Items.Remove(item);
         }
     }
     if (SelectedObject.Count == 1)
     {
         if (SelectedObject[0].ButtonBar != null)
         {
             for (int i = SelectedObject[0].ButtonBar.Count - 1; i >= 0; i--)
             {
                 ToolStripItem button = (ToolStripItem)(SelectedObject[0].ButtonBar[i]);
                 toolStrip1.Items.Add(button);
             }
         }
     }
     else
     {
         if (SelectedObject.Count > 1)
         {
             CommandMenuBuilder menuBuilder = new CommandMenuBuilder();
             foreach (ToolStripButton button in menuBuilder.MultiSelectButtonBar())
             {
                 toolStrip1.Items.Add(button);
             }
         }
     }
 }
 private void buildMenu(WorldTreeNode node)
 {
     if (inTree && node != null)
     {
         CommandMenuBuilder menuBuilder = new CommandMenuBuilder();
         if (loaded)
         {
             menuBuilder.Add("Create Object Collection", new CreateWorldCollectionCommandFactory(app, (IObjectCollectionParent)this), app.DefaultCommandClickHandler);
             menuBuilder.Add("Add Object", new AddObjectCommandFactory(app, this), app.DefaultCommandClickHandler);
             menuBuilder.Add("Add Road", new AddRoadCommandFactory(app, this), app.DefaultCommandClickHandler);
             menuBuilder.Add("Add Marker", new AddMarkerCommandFactory(app, this), app.DefaultCommandClickHandler);
             menuBuilder.Add("Add Marker at Camera", new AddMarkerAtCameraCommandFactory(app, this), app.DefaultCommandClickHandler);
             menuBuilder.Add("Add Region", new AddRegionCommandFactory(app, this), app.DefaultCommandClickHandler);
             menuBuilder.Add("Add Point Light", new AddPointLightCommandFactory(app, this), app.DefaultCommandClickHandler);
             menuBuilder.Add("Add Terrain Decal", new AddTerrainDecalCommandFactory(app, this), app.DefaultCommandClickHandler);
             menuBuilder.AddDropDown("Move to Collection", menuBuilder.ObjectCollectionMoveDropDown_Opening);
             menuBuilder.FinishDropDown();
             menuBuilder.Add("Copy Description", "", app.copyToClipboardMenuButton_Click);
             menuBuilder.Add("Unload Collection", new UnloadCollectionCommandFactory(app, this), app.DefaultCommandClickHandler);
             if (inScene)
             {
                 menuBuilder.Add("Remove From Scene", this, app.RemoveCollectionFromSceneClickHandler);
                 node.ImageIndex = 3;
                 node.SelectedImageIndex = 3;
             }
             else
             {
                 menuBuilder.Add("Add To Scene", this, app.AddCollectionToSceneClickHandler);
                 node.ImageIndex = 2;
                 node.SelectedImageIndex = 2;
             }
             menuBuilder.Add("Help", "Collection", app.HelpClickHandler);
             menuBuilder.Add("Delete", new DeleteObjectCommandFactory(app, parent, this), app.DefaultCommandClickHandler);
             node.ContextMenuStrip = menuBuilder.Menu;
             buttonBar = menuBuilder.ButtonBar;
         }
         else
         {
             if (buttonBar != null)
             {
                 buttonBar.Clear();
             }
             menuBuilder.Add("Load Collection", new LoadCollectionCommandFactory(app, this), app.DefaultCommandClickHandler);
             node.ContextMenuStrip = menuBuilder.Menu;
             node.ImageIndex = 1;
             node.SelectedImageIndex = 1;
             buttonBar = menuBuilder.ButtonBar;
         }
         app.UpdateButtonBar();
     }
 }
        public void AddToTree(WorldTreeNode parentNode)
        {
            this.parentNode = parentNode;

            // add the Fog node
            node = app.MakeTreeNode(this, "Directional Light");
            parentNode.Nodes.Add(node);

            CommandMenuBuilder menuBuilder = new CommandMenuBuilder();
            menuBuilder.Add("Copy Description", "", app.copyToClipboardMenuButton_Click);
            menuBuilder.Add("Help", "Directional_Light", app.HelpClickHandler);
            menuBuilder.Add("Delete", new DeleteObjectCommandFactory(app, parent, this), app.DefaultCommandClickHandler);
            node.ContextMenuStrip = menuBuilder.Menu;
            buttonBar = menuBuilder.ButtonBar;
        }
Пример #24
0
        public void AddToTree(WorldTreeNode parentNode)
        {
            this.parentNode = parentNode;
            inTree = true;

            // create a node for the collection and add it to the parent
            node = app.MakeTreeNode(this, name);

            parentNode.Nodes.Add(node);
            Forest forest = this;
            CommandMenuBuilder menuBuilder = new CommandMenuBuilder();
            menuBuilder.Add("Add Tree", new AddTreeCommandFactory(app, forest), app.DefaultCommandClickHandler);
            menuBuilder.Add("Copy Description", "", app.copyToClipboardMenuButton_Click);
            menuBuilder.Add("Help", "Forest", app.HelpClickHandler);
            menuBuilder.Add("Delete", new DeleteObjectCommandFactory(app, parent, this), app.DefaultCommandClickHandler);
            node.ContextMenuStrip = menuBuilder.Menu;

            foreach (IWorldObject tree in treeTypes)
            {
                tree.AddToTree(node);
            }
            buttonBar = menuBuilder.ButtonBar;
        }
        public void AddToTree(WorldTreeNode parentNode)
        {
            this.parentNode = parentNode;

            // add the Path Object Types node
            node = app.MakeTreeNode(this, "Path Object Type " + pathObjectType.name);
            parentNode.Nodes.Add(node);

            CommandMenuBuilder menuBuilder = new CommandMenuBuilder();
            menuBuilder.Add("Edit Path Object Type", new EditPathObjectTypeCommandFactory(app, parent, this), app.DefaultCommandClickHandler);
            menuBuilder.Add("Copy Description", "", app.copyToClipboardMenuButton_Click);
            menuBuilder.Add("Delete Path Object Type", new DeletePathObjectTypeCommandFactory(app, parent, this), app.DefaultCommandClickHandler);
            node.ContextMenuStrip = menuBuilder.Menu;
            buttonBar = menuBuilder.ButtonBar;
        }
        public void AddToTree(WorldTreeNode parentNode)
        {
            if (!inTree && parentNode != null)
            {
                this.parentNode = parentNode;

                // add the terrain node
                node = app.MakeTreeNode(this, NodeName);
                parentNode.Nodes.Add(node);

                CommandMenuBuilder menuBuilder = new CommandMenuBuilder();

                menuBuilder.Add("Drag Decal", new DragObjectsFromMenuCommandFactory(app), app.DefaultCommandClickHandler);
                menuBuilder.Add("Copy Description", "", app.copyToClipboardMenuButton_Click);
                menuBuilder.AddDropDown("Move to Collection", menuBuilder.ObjectCollectionDropDown_Opening);
                menuBuilder.Add("Help", ObjectType, app.HelpClickHandler);
                menuBuilder.Add("Delete", new DeleteObjectCommandFactory(app, parent, this), app.DefaultCommandClickHandler);
                node.ContextMenuStrip = menuBuilder.Menu;
                inTree = true;
                buttonBar = menuBuilder.ButtonBar;
            }
            else
            {
                inTree = false;
            }
        }
        public void AddToTree(WorldTreeNode parentNode)
        {
            this.parentNode = parentNode;

            // add the Creature Classes node
            node = app.MakeTreeNode(this, "Path Object Types");
            parentNode.Nodes.Add(node);

            CommandMenuBuilder menuBuilder = new CommandMenuBuilder();
            menuBuilder.Add("Add Path Object Type", new AddPathObjectTypeCommandFactory(app, this), app.DefaultCommandClickHandler);
            menuBuilder.Add("Copy Description", "", app.copyToClipboardMenuButton_Click);
            node.ContextMenuStrip = menuBuilder.Menu;

            foreach (PathObjectTypeNode pathObjectType in pathObjectTypes)
                pathObjectType.AddToTree(node);

            inTree = true;
            buttonBar = menuBuilder.ButtonBar;
        }
        private void worldTreeView_AfterSelect(object sender, TreeViewEventArgs e)
        {
            for (int i = toolStrip1.Items.Count - 1; i >= 0; i--)
            {
                ToolStripItem item = toolStrip1.Items[i];
                if (item.Alignment == System.Windows.Forms.ToolStripItemAlignment.Right)
                {
                    toolStrip1.Items.Remove(item);
                }
            }
            if (SelectedObject.Count == 1)
            {
                WorldTreeNode node = SelectedNodes[0];

                if (SelectedObject[0].ButtonBar != null)
                {
                    for (int i = SelectedObject[0].ButtonBar.Count - 1; i >= 0; i--)
                    {
                        ToolStripItem button = (ToolStripItem)(SelectedObject[0].ButtonBar[i]);
                        toolStrip1.Items.Add(button);
                    }
                }
                // set the propertyGrid to the selected object
                nodePropertyGrid.SelectedObject = SelectedObject[0];

                // enable and update position panel
                if (SelectedObject[0] is IObjectPosition)
                {
                    positionPanel.Enabled = true;

                    // enable/disable y up/down buttons
                    yUpButton.Enabled = SelectedPositionObject.AllowYChange;
                    yDownButton.Enabled = SelectedPositionObject.AllowYChange;
                    positionYTextBox.Enabled = SelectedPositionObject.AllowYChange;

                    UpdatePositionPanel(SelectedPositionObject.Position);
                }
                else
                {
                    positionPanel.Enabled = false;
                    UpdatePositionPanel(Vector3.Zero);
                }

                // enable and update scale panel
                if (SelectedObject[0] is IObjectScale)
                {
                    scalePanel.Enabled = true;
                    UpdateScalePanel(SelectedScaleObject.Scale);
                }
                else
                {
                    scalePanel.Enabled = false;
                    UpdateScalePanel(1);
                }

                // enable and update rotation panel
                if (SelectedObject[0] is IObjectRotation)
                {
                    rotationPanel.Enabled = true;
                    UpdateRotationPanel(SelectedRotationObject.Rotation);
                }
                else
                {
                    rotationPanel.Enabled = false;
                    UpdateRotationPanel(0);
                }

                // enable and update Orientation panel
                if (SelectedObject[0] is IObjectOrientation)
                {
                    orientationPanel.Enabled = true;
                    UpdateOrientationPanel(SelectedOrientationObject.Azimuth, SelectedOrientationObject.Zenith);
                }
                else
                {
                    orientationPanel.Enabled = false;
                    UpdateOrientationPanel(0, 0);
                }
                if (SelectedObject[0] is IObjectCameraLockable && lockCameraToObject)
                {
                    PositionCameraToObject(SelectedObject[0]);
                }
            }
            else
            {
                if (SelectedObject.Count > 1 || SelectedObject.Count == 0)
                {
                    nodePropertyGrid.SelectedObject = null;
                    orientationPanel.Enabled = false;
                    UpdateOrientationPanel(0, 0);
                    rotationPanel.Enabled = false;
                    UpdateRotationPanel(0);
                    scalePanel.Enabled = false;
                    UpdateScalePanel(1);
                    positionPanel.Enabled = false;
                    UpdatePositionPanel(Vector3.Zero);
                    CommandMenuBuilder menuBuilder = new CommandMenuBuilder();
                    foreach (ToolStripButton button in menuBuilder.MultiSelectButtonBar())
                    {
                        toolStrip1.Items.Add(button);
                    }
                }
            }
        }
        public void AddToTree(WorldTreeNode parentNode)
        {
            this.parentNode = parentNode;

            // add the Fog node
            node = app.MakeTreeNode(this, "Global Ambient Light");
            parentNode.Nodes.Add(node);

            CommandMenuBuilder menuBuilder = new CommandMenuBuilder();
            menuBuilder.Add("Copy Description", "", app.copyToClipboardMenuButton_Click);
            menuBuilder.Add("Help", "Global_Ambient_Light", app.HelpClickHandler);

            node.ContextMenuStrip = menuBuilder.Menu;
            buttonBar = menuBuilder.ButtonBar;
        }
Пример #30
0
        public void AddToTree(WorldTreeNode parentNode)
        {
            this.parentNode = parentNode;
            inTree = true;

            // create a node for the collection and add it to the parent
            this.node = app.MakeTreeNode(this, "Spawn Generator");

            parentNode.Nodes.Add(node);

            // build the menu
            CommandMenuBuilder menuBuilder = new CommandMenuBuilder();
            menuBuilder.Add("Copy Description", "", app.copyToClipboardMenuButton_Click);
            menuBuilder.Add("Help", "Spawn_Generator", app.HelpClickHandler);
            menuBuilder.Add("Delete", new DeleteObjectCommandFactory(app, parent, this), app.DefaultCommandClickHandler);
            node.ContextMenuStrip = menuBuilder.Menu;
            buttonBar = menuBuilder.ButtonBar;
        }
Пример #31
0
        public void AddToTree(WorldTreeNode parentNode)
        {
            if (parentNode != null)
            {
                this.parentNode = parentNode;

                inTree = true;

                // create a node for the collection and add it to the parent
                node = app.MakeTreeNode(this, NodeName);
                parentNode.Nodes.Add(node);

                foreach (IWorldObject obj in children)
                {
                    obj.AddToTree(node);
                }

                // build the menu
                CommandMenuBuilder menuBuilder = new CommandMenuBuilder();
                menuBuilder.Add("Drag Road", new DragObjectsFromMenuCommandFactory(app), app.DefaultCommandClickHandler);
                menuBuilder.AddDropDown("Move to Collection", menuBuilder.ObjectCollectionDropDown_Opening);
                menuBuilder.FinishDropDown();
                menuBuilder.Add("Copy Description", "", app.copyToClipboardMenuButton_Click);
                menuBuilder.Add("Help", "Road", app.HelpClickHandler);
                menuBuilder.Add("Delete", new DeleteObjectCommandFactory(app, parent, this), app.DefaultCommandClickHandler);
                node.ContextMenuStrip = menuBuilder.Menu;
                buttonBar = menuBuilder.ButtonBar;
            }
            else
            {
                inTree = false;
            }
        }
        public void AddToTree(WorldTreeNode parentNode)
        {
            this.parentNode = parentNode;

            // add the terrain node
            node = app.MakeTreeNode(this, "Terrain");
            parentNode.Nodes.Add(node);

            CommandMenuBuilder menuBuilder = new CommandMenuBuilder();

            menuBuilder.Add("Load Terrain", new LoadTerrainCommandFactory(app), app.DefaultCommandClickHandler);
            menuBuilder.Add("Copy Description", "", app.copyToClipboardMenuButton_Click);
            menuBuilder.Add("Help", "Terrain", app.HelpClickHandler);

            node.ContextMenuStrip = menuBuilder.Menu;

            terrainDisplay.AddToTree(node);

            inTree = true;
            buttonBar = menuBuilder.ButtonBar;
        }
        public void AddToTree(WorldTreeNode parentNode)
        {
            this.parentNode = parentNode;

            // add the terrain node
            node = app.MakeTreeNode(this, "Terrain Display");
            parentNode.Nodes.Add(node);

            CommandMenuBuilder menuBuilder = new CommandMenuBuilder();

            menuBuilder.Add("Copy Description", "", app.copyToClipboardMenuButton_Click);
            menuBuilder.Add("Help", "Auto_Splat_Terrain_Display", app.HelpClickHandler);

            node.ContextMenuStrip = menuBuilder.Menu;
            inTree = true;
            buttonBar = menuBuilder.ButtonBar;
        }
Пример #34
0
        public void AddToTree(WorldTreeNode parentNode)
        {
            this.parentNode = parentNode;
            if (!inTree)
            {
                inTree = true;

                // create a node for the collection and add it to the parent
                node = app.MakeTreeNode(this, Name);
                parentNode.Nodes.Add(this.Node);

                // build the menu
                CommandMenuBuilder menuBuilder = new CommandMenuBuilder();
                menuBuilder.Add("Copy Description", "", app.copyToClipboardMenuButton_Click);
                menuBuilder.Add("Drag Point", new DragMPPointCommandFactory(app, this), app.DefaultCommandClickHandler);
                menuBuilder.Add("Insert new points", new InsertPointsCommandFactory(app, (IWorldContainer)parent, this.PointNum), app.DefaultCommandClickHandler);
                menuBuilder.Add("Delete", new DeletePointCommandFactory(app, parent, this), app.DefaultCommandClickHandler);
                node.ContextMenuStrip = menuBuilder.Menu;
                buttonBar = menuBuilder.ButtonBar;
            }
        }
        public void AddToTree(WorldTreeNode parentNode)
        {
            if (parentNode != null)
            {
                this.parentNode = parentNode;
                inTree = true;

                // create a node for the collection and add it to the parent
                node = app.MakeTreeNode(this, NodeName);
                parentNode.Nodes.Add(node);

                // build the menu
                CommandMenuBuilder menuBuilder = new CommandMenuBuilder();

                if (AttachmentPoints.Count > 0)
                {
                    menuBuilder.Add("Attach Particle Effect", new AddObjectParticleEffectCommandFactory(app, this), app.DefaultCommandClickHandler);
                }
                menuBuilder.Add("Add Sound", new AddSoundCommandFactory(app, this), app.DefaultCommandClickHandler);
                menuBuilder.AddDropDown("View From");
                menuBuilder.Add("Above", new DirectionAndObject(CameraDirection.Above, this), app.CameraObjectDirClickHandler);
                menuBuilder.Add("North", new DirectionAndObject(CameraDirection.North, this), app.CameraObjectDirClickHandler);
                menuBuilder.Add("South", new DirectionAndObject(CameraDirection.South, this), app.CameraObjectDirClickHandler);
                menuBuilder.Add("West", new DirectionAndObject(CameraDirection.West, this), app.CameraObjectDirClickHandler);
                menuBuilder.Add("East", new DirectionAndObject(CameraDirection.East, this), app.CameraObjectDirClickHandler);
                menuBuilder.FinishDropDown();
                menuBuilder.Add("Drag Object", new DragObjectsFromMenuCommandFactory(app), app.DefaultCommandClickHandler);
                menuBuilder.AddDropDown("Move to Collection", menuBuilder.ObjectCollectionDropDown_Opening);
                menuBuilder.FinishDropDown();
                menuBuilder.Add("Copy Description", "", app.copyToClipboardMenuButton_Click);
                menuBuilder.Add("Help", "Object", app.HelpClickHandler);
                menuBuilder.Add("Delete", new DeleteObjectCommandFactory(app, parent, this), app.DefaultCommandClickHandler);
                //             menuBuilder.Add("Generate Model Paths", new GenerateModelPathsCommandFactory(this), app.DefaultCommandClickHandler);
                node.ContextMenuStrip = menuBuilder.Menu;

                foreach (IWorldObject child in children)
                {
                    child.AddToTree(node);
                }
                buttonBar = menuBuilder.ButtonBar;
            }
        }