Exemplo n.º 1
0
        /// <summary>
        /// InitPluginModule : called at plugin initialization time: Add the relevant shape creators here
        /// </summary>
        public override bool InitPluginModule()
        {
            EDITOR_PLUGIN_INFO.NativePluginNames = new string[] { "Fmod" };
            FmodManaged.ManagedModule.InitManagedModule();

            creators = new IShapeCreatorPlugin[]
            {
                new FmodSoundShapeCreator(),
                new FmodEventShapeCreator(),
                new FmodCollisionMeshShapeCreator(),
                new FmodReverbShapeCreator()
            };

            // add them to the editor
            foreach (IShapeCreatorPlugin plugin in creators)
            {
                EditorManager.ShapeCreatorPlugins.Add(plugin);
            }

            EditorManager.SceneChanged    += new SceneChangedEventHandler(EditorManager_SceneChanged);
            IScene.EngineInstancesChanged += new EngineInstancesChangedEventHandler(IScene_EngineInstancesChanged);

            _launchDesignerPlugin = new LaunchDesignerPlugin();
            EditorManager.AddMenuItemPlugin(_launchDesignerPlugin);
            return(true);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Overridden function that gets called when the plugin is loaded. Registers all creator plugins
        /// </summary>
        /// <returns></returns>
        public override bool InitPluginModule()
        {
            EDITOR_PLUGIN_INFO.NativePluginNames = new string[] { "Havok" };
            HavokManaged.ManagedModule.InitManagedModule();

            StaticMeshShape.UsesCollisionGroups = true; // switch to displaying collision groups

            // register shape classes
            creators = new IShapeCreatorPlugin[]
            {
                new HavokConstraintShapeCreator(),
                new HavokConstraintChainShapeCreator(),
                new HavokResourceShapeCreator()
            };

            foreach (IShapeCreatorPlugin plugin in creators)
            {
                EditorManager.ShapeCreatorPlugins.Add(plugin);
            }

            // create and activate panel
            _panel = new HavokPhysicsPanel(EditorManager.ApplicationLayout.DockingArea);
            _panel.ShowDockable();

            // Register automated tests
            TestSuiteBuilder testBuilder = new TestSuiteBuilder();
            TestSuite        testSuite   = testBuilder.Build(typeof(EditorPlugin).Assembly.FullName);

            TestManager.AddTestSuite(testSuite);

            IProject.ProjectUnloaded += new EventHandler(IProject_ProjectUnloaded);

            return(true);
        }
Exemplo n.º 3
0
        /// <summary>
        /// InitPluginModule : called at plugin initialisation time: Add the relevant shape creators here
        /// </summary>
        public override bool InitPluginModule()
        {
            NodeManaged.ManagedModule.InitManagedModule();

            EDITOR_PLUGIN_INFO.NativePluginNames = new string[] { "CustomShapeEditorPlugin" };

            // we only have one type of shape in this plugin
            creators = new IShapeCreatorPlugin[]
            {
                new NodeShapeCreator()
            };

            // add them to the editor
            foreach (IShapeCreatorPlugin plugin in creators)
            {
                EditorManager.ShapeCreatorPlugins.Add(plugin);
            }

/*
 *    // register tests (optional)
 *    TestSuite suite = new  TestSuite("Node Shape Plugin Tests");
 *    suite.Add( new TestFixture(typeof(Tests.EntityShapeTest)) );
 *    TestManager.AddTestSuite( suite );
 */
            return(true);
        }
Exemplo n.º 4
0
        /// <summary>
        /// InitPluginModule : called at plugin initialisation time: Add the relevant shape creators here
        /// </summary>
        public override bool InitPluginModule()
        {
            // we only have one type of shape in this plugin
            creators = new IShapeCreatorPlugin[]
            {
                new RenderShapeNodeCreator()
            };

            // add them to the editor
            foreach (IShapeCreatorPlugin plugin in creators)
            {
                EditorManager.ShapeCreatorPlugins.Add(plugin);
            }
            return(true);
        }
Exemplo n.º 5
0
        /// <summary>
        /// InitPluginModule : called at plugin initialization time: Add the relevant shape m_shapeCreators here
        /// </summary>
        public override bool InitPluginModule()
        {
            Toolset2D_Managed.ManagedModule.InitManagedModule();

            EDITOR_PLUGIN_INFO.NativePluginNames = new string[] { "Toolset2D" };

            m_shapeCreators = new IShapeCreatorPlugin[]
            {
                new SpriteShapeCreator(),
                new Camera2dShapeCreator()
            };

            // add them to the editor
            foreach (IShapeCreatorPlugin plugin in m_shapeCreators)
            {
                EditorManager.ShapeCreatorPlugins.Add(plugin);
            }

            EditorManager.QueryDragDropContext += new QueryDragDropContextEventHandler(QueryDragDropContext);

            return(true);
        }
        private void UpdateRecentShapesList(object creatorObj)
        {
            const int maximum = 8;

            //Prefabs cannot be casted to IShapeCreatorPlugin. So we have to check first if the cast is possible to avoid an exception. [#4743]
            IShapeCreatorPlugin shapeCreatorPlugin = creatorObj as IShapeCreatorPlugin;

            if (shapeCreatorPlugin == null)
            {
                return;
            }
            CSharpFramework.EditorManager.PluginToolStripMenuItem shapeItem = new CSharpFramework.EditorManager.PluginToolStripMenuItem(shapeCreatorPlugin.Name, (IEditorPlugin)creatorObj);
            // return if item exists
            foreach (CSharpFramework.EditorManager.PluginToolStripMenuItem item in recentShapesContextMenu.Items)
            {
                if (item.m_plugin.Name == shapeItem.m_plugin.Name)
                {
                    // add to top
                    recentShapesContextMenu.Items.Insert(0, item);
                    return;
                }
            }
            // remove first if maximum is reached
            if (recentShapesContextMenu.Items.Count >= maximum)
            {
                ToolStripItem toRemove = recentShapesContextMenu.Items[maximum - 1];
                toRemove.MouseDown  -= shapeItem_MouseDown;
                toRemove.MouseUp    -= shapeItem_MouseUp;
                toRemove.MouseLeave -= shapeItem_MouseLeave;
                recentShapesContextMenu.Items.Remove(toRemove);
            }

            // add new
            recentShapesContextMenu.Items.Insert(0, shapeItem);
            shapeItem.MouseDown  += new MouseEventHandler(shapeItem_MouseDown);
            shapeItem.MouseLeave += new EventHandler(shapeItem_MouseLeave);
            shapeItem.MouseUp    += new MouseEventHandler(shapeItem_MouseUp);
        }
Exemplo n.º 7
0
        /// <summary>
        /// InitPluginModule : called at plugin initialization time: Add the relevant shape m_shapeCreators here
        /// </summary>
        public override bool InitPluginModule()
        {
            Toolset2D_Managed.ManagedModule.InitManagedModule();

            EDITOR_PLUGIN_INFO.NativePluginNames = new string[] { "Toolset2D" };

            m_shapeCreators = new IShapeCreatorPlugin[]
                 {
                   new SpriteShapeCreator(),
                   new Camera2dShapeCreator()
                 };

            // add them to the editor
            foreach (IShapeCreatorPlugin plugin in m_shapeCreators)
            {
                EditorManager.ShapeCreatorPlugins.Add(plugin);
            }
            
            EditorManager.QueryDragDropContext += new QueryDragDropContextEventHandler(QueryDragDropContext);

            return true;
        }
        /// <summary>
        /// Overridden function that gets called when the plugin is loaded. Registers all creator plugins
        /// </summary>
        /// <returns></returns>
        public override bool InitPluginModule()
        {
            VisionManaged.ManagedModule.InitManagedModule();
            EDITOR_PLUGIN_INFO.NativePluginNames = new string[] { "VisionEnginePlugin" };

            // listen to the following events
            IProject.NewProjectLoaded             += new EventHandler(IProject_NewProjectLoaded);
            IProject.ProjectUnloaded              += new EventHandler(IProject_ProjectUnloaded);
            EditorManager.SceneChanged            += new SceneChangedEventHandler(EditorManager_SceneChanged);
            EditorManager.SceneEvent              += new SceneEventHandler(EditorManager_SceneEvent);
            EditorManager.ProcessExternalFileDrop += new ExternalFileDropHandler(EditorManager_ProcessExternalFileDrop);
            EditorManager.QueryDragDropContext    += new QueryDragDropContextEventHandler(EditorManager_QueryDragDropContext);

            // make this globally available
            PrefabDesc.PrefabInstanceCreator = new PrefabShapeCreator();

            // register shape classes
            creators = new IShapeCreatorPlugin[]
            {
                new EntityCreator(),
                new OmniLightCreator(false),
                new SpotLightCreator(false),
                new DirectionalLightCreator(false),
                new OmniLightCreator(true),
                new SpotLightCreator(true),
                new DirectionalLightCreator(true),
                new TimeOfDaySunCreator(),

                new ParticleSystemCreator(),
                new ConstraintCreator(EngineInstanceConstraint.ConstraintType_e.GroundPlane),
                new ConstraintCreator(EngineInstanceConstraint.ConstraintType_e.Plane),
                new ConstraintCreator(EngineInstanceConstraint.ConstraintType_e.Sphere),
                new ConstraintCreator(EngineInstanceConstraint.ConstraintType_e.AABox),
                new ConstraintCreator(EngineInstanceConstraint.ConstraintType_e.XAxis),
                new ConstraintCreator(EngineInstanceConstraint.ConstraintType_e.YAxis),
                new ConstraintCreator(EngineInstanceConstraint.ConstraintType_e.ZAxis),
                new ConstraintCreator(EngineInstanceConstraint.ConstraintType_e.Fan),
                new ConstraintCreator(EngineInstanceConstraint.ConstraintType_e.Cyclone),
                new ConstraintCreator(EngineInstanceConstraint.ConstraintType_e.Point),
                new ConstraintCreator(EngineInstanceConstraint.ConstraintType_e.GravityPoint),
                new ConstraintCreator(EngineInstanceConstraint.ConstraintType_e.Terrain),
                new ConstraintCreator(EngineInstanceConstraint.ConstraintType_e.CameraBox),

                new ProjectorShapeCreator(),
                new ClothObjectCreator(),
                new MirrorCreator(),
                new VisibilityObjectCreator(),
                new LightGridBoxCreator(),
                new LightGridDetailBoxCreator(),
                new LightGridIndicatorCreator(),
                new PathShapeCreator(),
                new CircleShapeCreator(),
                new PathCameraShapeCreator(),
                new CameraPositionShapeCreator(),

                //new RenderTargetShapeCreator(), // still port engine instance
                new CubemapShapeCreator(),
                //new PostProcessingShapeCreator(),

                PrefabDesc.PrefabInstanceCreator,
                new StaticMeshShapeCreator(),
                new StaticMeshGroupShapeCreator(),
                new TriggerBoxShapeCreator(),
                new BillboardGroupShapeCreator(),
                new CustomVolumeShapeCreator(),

#if !HK_ANARCHY
                new CloudLayerCreator(),
                new DecorationGroupCreator(),
                new WaterCreator(),
                new SunglareCreator(),
                new VolumetricConeCreator(),
                new FogObjectCreator(),
                new ProjectedDecalCreator(),
#endif
            };

            foreach (IShapeCreatorPlugin plugin in creators)
            {
                EditorManager.ShapeCreatorPlugins.Add(plugin);
            }

            // Add lightmap tweaking menu item
            // this is not supported ATM, because lightmaps are not in a central place anymore
            //lightmapMenuItemPlugin = new LightmapMenuItemPlugin();
            //EditorManager.AddMenuItemPlugin(lightmapMenuItemPlugin);

            _colorGradingTool = new ColorGradingToolPlugin();
            EditorManager.AddMenuItemPlugin(_colorGradingTool);

            PrefabManager.BINARY_SAVER = new VisionPrefabBinarySaver();
            VisionEngineManager.EntityClassManagerType = typeof(EntityClassManager);

            // register tests
            TestSuiteBuilder testBuilder = new TestSuiteBuilder();
            TestSuite        testSuite   = testBuilder.Build(typeof(EditorPlugin).Assembly.FullName);
            TestManager.AddTestSuite(testSuite);
            return(true);
        }