コード例 #1
0
ファイル: RenderCommands.cs プロジェクト: trizdreaming/XLE
        public virtual void Initialize()
        {
            m_commandService.RegisterCommand(
                Command.Screenshot, StandardMenu.View,
                m_commandGroup, "Screenshot".Localize(), "Take screenshot".Localize(),
                Keys.None, null, CommandVisibility.Menu,
                this);

            m_rsPropertyGrid = new MultiPropControl();
            m_controlHostService.RegisterControl(
                m_rsPropertyGrid,
                new ControlInfo("Render settings", "Per viewport render settings", StandardControlGroup.Hidden), null);

            if (m_scriptingService != null)
            {
                m_scriptingService.SetVariable("renderCommands", this);
            }
        }
コード例 #2
0
ファイル: RenderCommands.cs プロジェクト: coreafive/XLE
        public virtual void Initialize()
        {
            // register a custom menu without any commands, so it won't appear in the main menu bar
            MenuInfo  menuInfo = m_commandService.RegisterMenu(this, "RenderModes", "Rendering modes");
            ToolStrip strip    = null; // menuInfo.GetToolStrip(); (disabling this tool strip, because it feels a bit redundant)

            CommandInfo cmdInfo = m_commandService.RegisterCommand(
                Command.RenderSmooth,
                StandardMenu.View,
                m_commandGroup,
                "Solid".Localize(),
                "Solid rendering".Localize(),
                Keys.None,
                LevelEditorCore.Resources.SmoothImage,
                CommandVisibility.Menu,
                this);

            if (strip != null)
            {
                strip.Items.Add(cmdInfo.GetButton());
            }

            cmdInfo = m_commandService.RegisterCommand(
                Command.RenderWireFrame,
                StandardMenu.View,
                m_commandGroup,
                "Wireframe".Localize(),
                "Wireframe rendering".Localize(),
                Keys.None,
                LevelEditorCore.Resources.WireframeImage,
                CommandVisibility.Menu,
                this);
            if (strip != null)
            {
                strip.Items.Add(cmdInfo.GetButton());
            }

            cmdInfo = m_commandService.RegisterCommand(
                Command.RenderOutlined,
                StandardMenu.View,
                m_commandGroup,
                "SolidOverWire",
                "Solid over wireframe rendering".Localize(),
                Keys.None,
                LevelEditorCore.Resources.OutlinedImage,
                CommandVisibility.Menu,
                this);
            if (strip != null)
            {
                strip.Items.Add(cmdInfo.GetButton());
            }

            cmdInfo = m_commandService.RegisterCommand(
                Command.RenderTextured,
                StandardMenu.View,
                m_commandGroup,
                "Textured".Localize(),
                "Textured rendering".Localize(),
                Keys.T,
                LevelEditorCore.Resources.TexturedImage,
                CommandVisibility.Menu,
                this);
            if (strip != null)
            {
                strip.Items.Add(cmdInfo.GetButton());
            }


            cmdInfo = m_commandService.RegisterCommand(
                Command.RenderLight,
                StandardMenu.View,
                m_commandGroup,
                "Lighting".Localize(),
                "Lighting".Localize(),
                Keys.L,
                LevelEditorCore.Resources.LightImage,
                CommandVisibility.Menu,
                this);
            if (strip != null)
            {
                strip.Items.Add(cmdInfo.GetButton());
            }

            cmdInfo = m_commandService.RegisterCommand(
                Command.RenderBackFace,
                StandardMenu.View,
                m_commandGroup,
                "BackFace".Localize(),
                "Render back faces".Localize(),
                Keys.B,
                LevelEditorCore.Resources.BackfaceImage,
                CommandVisibility.Menu,
                this);
            if (strip != null)
            {
                strip.Items.Add(cmdInfo.GetButton());
            }

            cmdInfo = m_commandService.RegisterCommand(
                Command.RenderShadow,
                StandardMenu.View,
                m_commandGroup,
                "Shadow".Localize(),
                "Render shadow".Localize(),
                Keys.None,
                LevelEditorCore.Resources.ShadowImage,
                CommandVisibility.Menu,
                this);
            if (strip != null)
            {
                strip.Items.Add(cmdInfo.GetButton());
            }


            cmdInfo = m_commandService.RegisterCommand(
                Command.RenderNormals,
                StandardMenu.View,
                m_commandGroup,
                "Normals".Localize(),
                "Render Normals".Localize(),
                Keys.None,
                LevelEditorCore.Resources.NormalImage,
                CommandVisibility.Menu,
                this);
            if (strip != null)
            {
                strip.Items.Add(cmdInfo.GetButton());
            }

            m_commandService.RegisterCommand(
                Command.RenderCycle,
                StandardMenu.View,
                m_commandGroup,
                "CycleRenderModes".Localize(),
                "Cycle render modes".Localize(),
                Keys.Space,
                null,
                CommandVisibility.Menu,
                this);

            //cmdInfo = m_commandService.RegisterCommand(
            //  Command.RealTime,
            //  StandardMenu.View,
            //  m_commandGroup,
            //  "RealTime".Localize(),
            //  "Toggle real time rendering".Localize(),
            //  Keys.None,
            //  Resources.RealTimeImage,
            //  CommandVisibility.Menu,
            //  this);
            //strip.Items.Add(cmdInfo.GetButton());

            m_rsPropertyGrid = new MultiPropControl();
            m_controlHostService.RegisterControl(m_rsPropertyGrid,
                                                 new ControlInfo("Render settings", "Per viewport render settings", StandardControlGroup.Hidden), null);

            if (m_scriptingService != null)
            {
                m_scriptingService.SetVariable("renderCommands", this);
            }
        }
コード例 #3
0
ファイル: RenderCommands.cs プロジェクト: ldh9451/XLE
        public virtual void Initialize()
        {
            // register a custom menu without any commands, so it won't appear in the main menu bar
            MenuInfo menuInfo = m_commandService.RegisterMenu(this, "RenderModes", "Rendering modes");
            ToolStrip strip = null; // menuInfo.GetToolStrip(); (disabling this tool strip, because it feels a bit redundant)

             CommandInfo cmdInfo = m_commandService.RegisterCommand(
                Command.RenderSmooth,
                StandardMenu.View,
                m_commandGroup,
                "Solid".Localize(),
                "Solid rendering".Localize(),
                Keys.None,
                LevelEditorCore.Resources.SmoothImage,
                CommandVisibility.Menu,
                this);
             if (strip != null) strip.Items.Add(cmdInfo.GetButton());

             cmdInfo = m_commandService.RegisterCommand(
                Command.RenderWireFrame,
                StandardMenu.View,
                m_commandGroup,
                "Wireframe".Localize(),
                "Wireframe rendering".Localize(),
                Keys.None,
                LevelEditorCore.Resources.WireframeImage,
                CommandVisibility.Menu,
                this);
             if (strip != null) strip.Items.Add(cmdInfo.GetButton());

            cmdInfo = m_commandService.RegisterCommand(
                Command.RenderOutlined,
                StandardMenu.View,
                m_commandGroup,
                "SolidOverWire",
                "Solid over wireframe rendering".Localize(),
                Keys.None,
                LevelEditorCore.Resources.OutlinedImage,
                CommandVisibility.Menu,
                this);
            if (strip != null) strip.Items.Add(cmdInfo.GetButton());

            cmdInfo = m_commandService.RegisterCommand(
                Command.RenderTextured,
                StandardMenu.View,
                m_commandGroup,
                "Textured".Localize(),
                "Textured rendering".Localize(),
                Keys.T,
                LevelEditorCore.Resources.TexturedImage,
                CommandVisibility.Menu,
                this);
            if (strip != null) strip.Items.Add(cmdInfo.GetButton());

            cmdInfo = m_commandService.RegisterCommand(
                Command.RenderLight,
                StandardMenu.View,
                m_commandGroup,
                "Lighting".Localize(),
                "Lighting".Localize(),
                Keys.L,
                LevelEditorCore.Resources.LightImage,
                CommandVisibility.Menu,
                this);
            if (strip != null) strip.Items.Add(cmdInfo.GetButton());

            cmdInfo = m_commandService.RegisterCommand(
                Command.RenderBackFace,
                StandardMenu.View,
                m_commandGroup,
                "BackFace".Localize(),
                "Render back faces".Localize(),
                Keys.B,
                LevelEditorCore.Resources.BackfaceImage,
                CommandVisibility.Menu,
                this);
            if (strip != null) strip.Items.Add(cmdInfo.GetButton());

            cmdInfo = m_commandService.RegisterCommand(
               Command.RenderShadow,
               StandardMenu.View,
               m_commandGroup,
               "Shadow".Localize(),
               "Render shadow".Localize(),
               Keys.None,
               LevelEditorCore.Resources.ShadowImage,
               CommandVisibility.Menu,
               this);
            if (strip != null) strip.Items.Add(cmdInfo.GetButton());

            cmdInfo = m_commandService.RegisterCommand(
             Command.RenderNormals,
             StandardMenu.View,
             m_commandGroup,
             "Normals".Localize(),
             "Render Normals".Localize(),
             Keys.None,
             LevelEditorCore.Resources.NormalImage,
             CommandVisibility.Menu,
             this);
            if (strip != null) strip.Items.Add(cmdInfo.GetButton());

            m_commandService.RegisterCommand(
                Command.RenderCycle,
                StandardMenu.View,
                m_commandGroup,
                "CycleRenderModes".Localize(),
                "Cycle render modes".Localize(),
                Keys.Space,
                null,
                CommandVisibility.Menu,
                this);

            //cmdInfo = m_commandService.RegisterCommand(
            //  Command.RealTime,
            //  StandardMenu.View,
            //  m_commandGroup,
            //  "RealTime".Localize(),
            //  "Toggle real time rendering".Localize(),
            //  Keys.None,
            //  Resources.RealTimeImage,
            //  CommandVisibility.Menu,
            //  this);
            //strip.Items.Add(cmdInfo.GetButton());

            m_rsPropertyGrid = new MultiPropControl();
            m_controlHostService.RegisterControl(m_rsPropertyGrid,
                new ControlInfo("Render settings", "Per viewport render settings", StandardControlGroup.Hidden), null);

            if (m_scriptingService != null)
                m_scriptingService.SetVariable("renderCommands", this);
        }