Defines a debug information window class.
Наследование: EControl
        protected override void OnAttach()
        {
            base.OnAttach();

            EngineApp.Instance.Config.RegisterClassParameters( GetType() );

            instance = this;

            window = ControlDeclarationManager.Instance.CreateControl(
                "Gui\\DebugInformationWindow.gui" );
            Controls.Add( window );

            backgroundCheckBox = (ECheckBox)window.Controls[ "Background" ];
            backgroundCheckBox.Checked = background;
            backgroundCheckBox.CheckedChange += Background_CheckedChange;

            ( (EButton)window.Controls[ "Close" ] ).Click += delegate( EButton sender )
            {
                SetShouldDetach();
            };

            EControl tabControl = window.Controls[ "TabControl" ];

            pages.Add( new GeneralPage( tabControl.Controls[ "General" ] ) );
            pages.Add( new RenderPage( tabControl.Controls[ "Render" ] ) );
            pages.Add( new PhysicsPage( tabControl.Controls[ "Physics" ] ) );
            pages.Add( new SoundPage( tabControl.Controls[ "Sound" ] ) );
            pages.Add( new EntitiesPage( tabControl.Controls[ "Entities" ] ) );
            pages.Add( new MemoryPage( tabControl.Controls[ "Memory" ] ) );
            pages.Add( new DLLPage( tabControl.Controls[ "DLL" ] ) );
            pages.Add( new NetworkPage( tabControl.Controls[ "Network" ] ) );

            UpdateColorMultiplier();
        }
Пример #2
0
        protected override void OnAttach()
        {
            base.OnAttach();

            EngineApp.Instance.Config.RegisterClassParameters(GetType());

            instance = this;

            window = ControlDeclarationManager.Instance.CreateControl(
                "Gui\\DebugInformationWindow.gui");
            Controls.Add(window);

            backgroundCheckBox                = (ECheckBox)window.Controls["Background"];
            backgroundCheckBox.Checked        = background;
            backgroundCheckBox.CheckedChange += Background_CheckedChange;

            ((EButton)window.Controls["Close"]).Click += delegate(EButton sender)
            {
                SetShouldDetach();
            };

            EControl tabControl = window.Controls["TabControl"];

            pages.Add(new GeneralPage(tabControl.Controls["General"]));
            pages.Add(new RenderPage(tabControl.Controls["Render"]));
            pages.Add(new PhysicsPage(tabControl.Controls["Physics"]));
            pages.Add(new SoundPage(tabControl.Controls["Sound"]));
            pages.Add(new EntitiesPage(tabControl.Controls["Entities"]));
            pages.Add(new MemoryPage(tabControl.Controls["Memory"]));
            pages.Add(new DLLPage(tabControl.Controls["DLL"]));
            pages.Add(new NetworkPage(tabControl.Controls["Network"]));

            UpdateColorMultiplier();
        }
Пример #3
0
        protected override void OnDetach()
        {
            foreach (Page page in pages)
            {
                page.OnDestroy();
            }
            pages.Clear();

            instance = null;

            base.OnDetach();
        }
        protected override void OnDetach()
        {
            foreach( Page page in pages )
                page.OnDestroy();
            pages.Clear();

            instance = null;

            base.OnDetach();
        }
Пример #5
0
 static void ShowDebugInformationWindow( bool show )
 {
     if( show )
     {
         if( DebugInformationWindow.Instance == null )
         {
             DebugInformationWindow window = new DebugInformationWindow();
             Instance.ControlManager.Controls.Add( window );
         }
     }
     else
     {
         if( DebugInformationWindow.Instance != null )
             DebugInformationWindow.Instance.SetShouldDetach();
     }
 }
Пример #6
0
        protected override bool OnKeyDown( KeyEvent e )
        {
            if( EngineConsole.Instance.OnKeyDown( e ) )
                return true;

            if( ScreenControlManager.Instance != null )
                if( ScreenControlManager.Instance.DoKeyDown( e ) )
                    return true;

            //Debug information window
            if( e.Key == EKeys.F11 )
            {
                if( DebugInformationWindow.Instance == null )
                {
                    DebugInformationWindow window = new DebugInformationWindow();
                    ScreenControlManager.Instance.Controls.Add( window );
                }
                else
                {
                    DebugInformationWindow.Instance.SetShouldDetach();
                }
                return true;
            }

            //make screenshot
            if( e.Key == EKeys.F12 )
            {
                if( !Directory.Exists( "Screenshots" ) )
                    Directory.CreateDirectory( "Screenshots" );

                string format = "Screenshots\\Screenshot{0}.tga";

                for( int n = 1; n < 1000; n++ )
                {
                    string v = n.ToString();
                    if( n < 10 )
                        v = "0" + v;
                    if( n < 100 )
                        v = "0" + v;

                    string fileName = string.Format( format, v );

                    if( !File.Exists( fileName ) )
                    {
                        RendererWorld.Instance.RenderWindow.WriteContentsToFile( fileName );
                        break;
                    }
                }

                return true;
            }

            return base.OnKeyDown( e );
        }