Esempio n. 1
0
 void boolParameter_CheckedChange(ECheckBox sender)
 {
     if (!noPostEffectUpdate)
     {
         UpdateCurrentPostEffect();
     }
 }
Esempio n. 2
0
        void Defaults_Click(EButton sender)
        {
            foreach (EControl control in window.Controls)
            {
                ECheckBox checkBox = control as ECheckBox;
                if (checkBox == null)
                {
                    continue;
                }

                PropertyInfo property = checkBox.UserData as PropertyInfo;
                if (property == null)
                {
                    continue;
                }

                DefaultValueAttribute[] attributes = (DefaultValueAttribute[])property.
                                                     GetCustomAttributes(typeof(DefaultValueAttribute), true);

                if (attributes.Length == 0)
                {
                    continue;
                }

                checkBox.Checked = (bool)attributes[0].Value;
            }
        }
Esempio n. 3
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();
        }
        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();
        }
Esempio n. 5
0
        void checkBoxEnabled_Click(ECheckBox sender)
        {
            EButton itemButton = listBox.ItemButtons[listBox.SelectedIndex];

            ((ECheckBox)itemButton.Controls["CheckBox"]).Checked = sender.Checked;

            UpdateCurrentPostEffect();
        }
Esempio n. 6
0
        bool IsCustomShaderModeEnabled()
        {
            ECheckBox checkBox = window.Controls["CustomShaderMode"] as ECheckBox;

            if (checkBox != null && checkBox.Checked)
            {
                return(true);
            }
            return(false);
        }
Esempio n. 7
0
        void checkBoxAllowToConnectDuringGame_CheckedChange(ECheckBox sender)
        {
            //send AllowToConnectDuringGame to clients
            GameNetworkServer server = GameNetworkServer.Instance;

            if (server != null)
            {
                server.CustomMessagesService.SendToAllClients("Lobby_AllowToConnectDuringGame",
                                                              checkBoxAllowToConnectDuringGame.Checked.ToString());
            }
        }
Esempio n. 8
0
            public PhysicsPage(EControl pageControl)
                : base(pageControl)
            {
                PageControl.Controls["Library"].Text = string.Format("{0} ({1})",
                                                                     PhysicsWorld.Instance.DriverName, PhysicsWorld.Instance.DriverAssemblyFileName);

                ECheckBox hardwareAccelecatedCheckBox = (ECheckBox)PageControl.Controls[
                    "HardwareAccelerated"];

                hardwareAccelecatedCheckBox.Enable  = false;
                hardwareAccelecatedCheckBox.Checked = PhysicsWorld.Instance.HardwareAccelerated;
            }
Esempio n. 9
0
        void InitCheckBox(string name, PropertyInfo property)
        {
            ECheckBox checkBox = (ECheckBox)window.Controls[name];

            checkBox.UserData = property;

            checkBox.Checked = (bool)property.GetValue(null, null);

            checkBox.CheckedChange += delegate(ECheckBox sender)
            {
                PropertyInfo p = (PropertyInfo)sender.UserData;
                p.SetValue(null, !(bool)p.GetValue(null, null), null);
            };
        }
Esempio n. 10
0
        void listBoxCheckBox_Click(ECheckBox sender)
        {
            //set listBox current item
            for (int n = 0; n < listBox.Items.Count; n++)
            {
                EButton itemButton = listBox.ItemButtons[n];
                if (itemButton.Controls["CheckBox"] == sender)
                {
                    listBox.SelectedIndex = n;
                }
            }

            checkBoxEnabled.Checked = sender.Checked;
            checkBoxEnabled.Enable  = (sender.Parent.Text != "HDR");

            UpdateCurrentPostEffect();
        }
Esempio n. 11
0
        ///////////////////////////////////////////

        protected override void OnAttach()
        {
            base.OnAttach();

            //register config fields
            EngineApp.Instance.Config.RegisterClassParameters(GetType());

            //create window
            window = ControlDeclarationManager.Instance.CreateControl(
                "Gui\\MultiplayerLobbyWindow.gui");
            Controls.Add(window);

            ((EButton)window.Controls["Exit"]).Click += Exit_Click;

            buttonStart = (EButton)window.Controls["Start"];
            if (GameNetworkServer.Instance != null)
            {
                buttonStart.Click += Start_Click;
            }
            if (GameNetworkClient.Instance != null)
            {
                buttonStart.Enable = false;
            }

            listBoxUsers = (EListBox)window.Controls["Users"];

            editBoxChatMessage             = (EEditBox)window.Controls["ChatMessage"];
            editBoxChatMessage.PreKeyDown += editBoxChatMessage_PreKeyDown;

            //comboBoxMaps
            {
                comboBoxMaps = (EComboBox)window.Controls["Maps"];

                if (GameNetworkServer.Instance != null)
                {
                    //dynamic map example
                    comboBoxMaps.Items.Add(new MapItem(dynamicMapExampleText, false));
                    if (lastMapName == dynamicMapExampleText)
                    {
                        comboBoxMaps.SelectedIndex = comboBoxMaps.Items.Count - 1;
                    }

                    string[] mapList = VirtualDirectory.GetFiles("", "*.map",
                                                                 SearchOption.AllDirectories);

                    foreach (string mapName in mapList)
                    {
                        //check for network support
                        if (VirtualFile.Exists(string.Format("{0}\\NoNetworkSupport.txt",
                                                             Path.GetDirectoryName(mapName))))
                        {
                            continue;
                        }

                        bool recommended =
                            mapName.Contains("JigsawPuzzleGame") ||
                            mapName.Contains("TankDemo") ||
                            mapName.Contains("DeathmatchDemo");

                        comboBoxMaps.Items.Add(new MapItem(mapName, recommended));
                        if (mapName == lastMapName)
                        {
                            comboBoxMaps.SelectedIndex = comboBoxMaps.Items.Count - 1;
                        }
                    }

                    comboBoxMaps.SelectedIndexChange += comboBoxMaps_SelectedIndexChange;

                    if (comboBoxMaps.Items.Count != 0 && comboBoxMaps.SelectedIndex == -1)
                    {
                        comboBoxMaps.SelectedIndex = 0;
                    }
                }
                else
                {
                    comboBoxMaps.Enable = false;
                }
            }

            //checkBoxAllowToConnectDuringGame
            {
                checkBoxAllowToConnectDuringGame = (ECheckBox)window.Controls[
                    "AllowToConnectDuringGame"];

                if (GameNetworkServer.Instance != null)
                {
                    checkBoxAllowToConnectDuringGame.CheckedChange +=
                        checkBoxAllowToConnectDuringGame_CheckedChange;
                }
                else
                {
                    checkBoxAllowToConnectDuringGame.Enable = false;
                }
            }

            //server specific
            GameNetworkServer server = GameNetworkServer.Instance;

            if (server != null)
            {
                //for receive map name
                server.UserManagementService.AddUserEvent += Server_UserManagementService_AddUserEvent;

                //for chat support
                server.ChatService.ReceiveText += Server_ChatService_ReceiveText;
            }

            //client specific
            GameNetworkClient client = GameNetworkClient.Instance;

            if (client != null)
            {
                //for receive map name
                client.CustomMessagesService.ReceiveMessage +=
                    Client_CustomMessagesService_ReceiveMessage;

                //for chat support
                client.ChatService.ReceiveText += Client_ChatService_ReceiveText;

                AddMessage(string.Format("Connected to server: \"{0}\"", client.RemoteServerName));
                foreach (string serviceName in client.ServerConnectedNode.RemoteServices)
                {
                    AddMessage(string.Format("Server service: \"{0}\"", serviceName));
                }
            }

            UpdateControls();
        }
 void Background_CheckedChange( ECheckBox sender )
 {
     background = backgroundCheckBox.Checked;
     UpdateColorMultiplier();
 }
Esempio n. 13
0
        //
        protected override void OnAttach()
        {
            base.OnAttach();

            viewport = RendererWorld.Instance.DefaultViewport;

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

            for( int n = 0; n < scrollBarFloatParameters.Length; n++ )
            {
                scrollBarFloatParameters[ n ] = (EScrollBar)window.Controls[
                    "FloatParameter" + n.ToString() ];
                scrollBarFloatParameters[ n ].ValueChange += floatParameter_ValueChange;
            }
            for( int n = 0; n < checkBoxBoolParameters.Length; n++ )
            {
                checkBoxBoolParameters[ n ] = (ECheckBox)window.Controls[ "BoolParameter" + n.ToString() ];
                checkBoxBoolParameters[ n ].CheckedChange += boolParameter_CheckedChange;
            }

            listBox = (EListBox)window.Controls[ "List" ];
            listBox.Items.Add( "HDR" );
            listBox.Items.Add( "Glass" );
            listBox.Items.Add( "OldTV" );
            listBox.Items.Add( "HeatVision" );
            listBox.Items.Add( "MotionBlur" );
            listBox.Items.Add( "RadialBlur" );
            listBox.Items.Add( "Blur" );
            listBox.Items.Add( "Grayscale" );
            listBox.Items.Add( "Invert" );
            listBox.Items.Add( "Tiling" );

            listBox.SelectedIndexChange += listBox_SelectedIndexChange;

            checkBoxEnabled = (ECheckBox)window.Controls[ "Enabled" ];
            checkBoxEnabled.Click += checkBoxEnabled_Click;

            for( int n = 0; n < listBox.Items.Count; n++ )
            {
                EButton itemButton = listBox.ItemButtons[ n ];
                ECheckBox checkBox = (ECheckBox)itemButton.Controls[ "CheckBox" ];

                string name = GetListCompositorItemName( (string)listBox.Items[ n ] );

                CompositorInstance instance = viewport.GetCompositorInstance( name );
                if( instance != null && instance.Enabled )
                    checkBox.Checked = true;

                if( itemButton.Text == "HDR" )
                    checkBox.Enable = false;

                checkBox.Click += listBoxCheckBox_Click;
            }

            listBox.SelectedIndex = 0;

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

            //ApplyToTheScreenGUI
            {
                ECheckBox checkBox = (ECheckBox)window.Controls[ "ApplyToTheScreenGUI" ];
                checkBox.Checked = EngineApp.Instance.ScreenGuiRenderer.ApplyPostEffectsToScreenRenderer;
                checkBox.Click += delegate( ECheckBox sender )
                {
                    EngineApp.Instance.ScreenGuiRenderer.ApplyPostEffectsToScreenRenderer = sender.Checked;
                };
            }
        }
Esempio n. 14
0
        void listBoxCheckBox_Click( ECheckBox sender )
        {
            //set listBox current item
            for( int n = 0; n < listBox.Items.Count; n++ )
            {
                EButton itemButton = listBox.ItemButtons[ n ];
                if( itemButton.Controls[ "CheckBox" ] == sender )
                    listBox.SelectedIndex = n;
            }

            checkBoxEnabled.Checked = sender.Checked;
            checkBoxEnabled.Enable = ( sender.Parent.Text != "HDR" );

            UpdateCurrentPostEffect();
        }
Esempio n. 15
0
        void checkBoxEnabled_Click( ECheckBox sender )
        {
            EButton itemButton = listBox.ItemButtons[ listBox.SelectedIndex ];
            ( (ECheckBox)itemButton.Controls[ "CheckBox" ] ).Checked = sender.Checked;

            UpdateCurrentPostEffect();
        }
Esempio n. 16
0
 void boolParameter_CheckedChange( ECheckBox sender )
 {
     if( !noPostEffectUpdate )
         UpdateCurrentPostEffect();
 }
Esempio n. 17
0
 void Background_CheckedChange(ECheckBox sender)
 {
     background = backgroundCheckBox.Checked;
     UpdateColorMultiplier();
 }
        ///////////////////////////////////////////
        protected override void OnAttach()
        {
            base.OnAttach();

            //register config fields
            EngineApp.Instance.Config.RegisterClassParameters( GetType() );

            //create window
            window = ControlDeclarationManager.Instance.CreateControl(
                "Gui\\MultiplayerLobbyWindow.gui" );
            Controls.Add( window );

            ( (EButton)window.Controls[ "Exit" ] ).Click += Exit_Click;

            buttonStart = (EButton)window.Controls[ "Start" ];
            if( GameNetworkServer.Instance != null )
                buttonStart.Click += Start_Click;
            if( GameNetworkClient.Instance != null )
                buttonStart.Enable = false;

            listBoxUsers = (EListBox)window.Controls[ "Users" ];

            editBoxChatMessage = (EEditBox)window.Controls[ "ChatMessage" ];
            editBoxChatMessage.PreKeyDown += editBoxChatMessage_PreKeyDown;

            //comboBoxMaps
            {
                comboBoxMaps = (EComboBox)window.Controls[ "Maps" ];

                if( GameNetworkServer.Instance != null )
                {
                    //dynamic map example
                    comboBoxMaps.Items.Add( new MapItem( dynamicMapExampleText, false ) );
                    if( lastMapName == dynamicMapExampleText )
                        comboBoxMaps.SelectedIndex = comboBoxMaps.Items.Count - 1;

                    string[] mapList = VirtualDirectory.GetFiles( "", "*.map",
                        SearchOption.AllDirectories );

                    foreach( string mapName in mapList )
                    {
                        //check for network support
                        if( VirtualFile.Exists( string.Format( "{0}\\NoNetworkSupport.txt",
                            Path.GetDirectoryName( mapName ) ) ) )
                        {
                            continue;
                        }

                        bool recommended =
                            mapName.Contains( "JigsawPuzzleGame" ) ||
                            mapName.Contains( "TankDemo" ) ||
                            mapName.Contains( "DeathmatchDemo" );

                        comboBoxMaps.Items.Add( new MapItem( mapName, recommended ) );
                        if( mapName == lastMapName )
                            comboBoxMaps.SelectedIndex = comboBoxMaps.Items.Count - 1;
                    }

                    comboBoxMaps.SelectedIndexChange += comboBoxMaps_SelectedIndexChange;

                    if( comboBoxMaps.Items.Count != 0 && comboBoxMaps.SelectedIndex == -1 )
                        comboBoxMaps.SelectedIndex = 0;
                }
                else
                {
                    comboBoxMaps.Enable = false;
                }
            }

            //checkBoxAllowToConnectDuringGame
            {
                checkBoxAllowToConnectDuringGame = (ECheckBox)window.Controls[
                    "AllowToConnectDuringGame" ];

                if( GameNetworkServer.Instance != null )
                {
                    checkBoxAllowToConnectDuringGame.CheckedChange +=
                        checkBoxAllowToConnectDuringGame_CheckedChange;
                }
                else
                {
                    checkBoxAllowToConnectDuringGame.Enable = false;
                }
            }

            //server specific
            GameNetworkServer server = GameNetworkServer.Instance;
            if( server != null )
            {
                //for receive map name
                server.UserManagementService.AddUserEvent += Server_UserManagementService_AddUserEvent;

                //for chat support
                server.ChatService.ReceiveText += Server_ChatService_ReceiveText;
            }

            //client specific
            GameNetworkClient client = GameNetworkClient.Instance;
            if( client != null )
            {
                //for receive map name
                client.CustomMessagesService.ReceiveMessage +=
                    Client_CustomMessagesService_ReceiveMessage;

                //for chat support
                client.ChatService.ReceiveText += Client_ChatService_ReceiveText;

                AddMessage( string.Format( "Connected to server: \"{0}\"", client.RemoteServerName ) );
                foreach( string serviceName in client.ServerConnectedNode.RemoteServices )
                    AddMessage( string.Format( "Server service: \"{0}\"", serviceName ) );
            }

            UpdateControls();
        }
 void checkBoxAllowToConnectDuringGame_CheckedChange( ECheckBox sender )
 {
     //send AllowToConnectDuringGame to clients
     GameNetworkServer server = GameNetworkServer.Instance;
     if( server != null )
     {
         server.CustomMessagesService.SendToAllClients( "Lobby_AllowToConnectDuringGame",
             checkBoxAllowToConnectDuringGame.Checked.ToString() );
     }
 }
Esempio n. 20
0
        //

        protected override void OnAttach()
        {
            base.OnAttach();

            instance = this;

            viewport = RendererWorld.Instance.DefaultViewport;

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

            for (int n = 0; n < scrollBarFloatParameters.Length; n++)
            {
                scrollBarFloatParameters[n] = (EScrollBar)window.Controls[
                    "FloatParameter" + n.ToString()];
                scrollBarFloatParameters[n].ValueChange += floatParameter_ValueChange;
            }
            for (int n = 0; n < checkBoxBoolParameters.Length; n++)
            {
                checkBoxBoolParameters[n] = (ECheckBox)window.Controls["BoolParameter" + n.ToString()];
                checkBoxBoolParameters[n].CheckedChange += boolParameter_CheckedChange;
            }

            listBox = (EListBox)window.Controls["List"];
            listBox.Items.Add("HDR");
            listBox.Items.Add("LDRBloom");
            listBox.Items.Add("Glass");
            listBox.Items.Add("OldTV");
            listBox.Items.Add("HeatVision");
            listBox.Items.Add("MotionBlur");
            listBox.Items.Add("RadialBlur");
            listBox.Items.Add("Blur");
            listBox.Items.Add("Grayscale");
            listBox.Items.Add("Invert");
            listBox.Items.Add("Tiling");

            listBox.SelectedIndexChange += listBox_SelectedIndexChange;

            checkBoxEnabled        = (ECheckBox)window.Controls["Enabled"];
            checkBoxEnabled.Click += checkBoxEnabled_Click;

            for (int n = 0; n < listBox.Items.Count; n++)
            {
                EButton   itemButton = listBox.ItemButtons[n];
                ECheckBox checkBox   = (ECheckBox)itemButton.Controls["CheckBox"];

                string name = GetListCompositorItemName((string)listBox.Items[n]);

                CompositorInstance compositorInstance = viewport.GetCompositorInstance(name);
                if (compositorInstance != null && compositorInstance.Enabled)
                {
                    checkBox.Checked = true;
                }

                if (itemButton.Text == "HDR")
                {
                    checkBox.Enable = false;
                }

                checkBox.Click += listBoxCheckBox_Click;
            }

            listBox.SelectedIndex = 0;

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

            //ApplyToTheScreenGUI
            {
                ECheckBox checkBox = (ECheckBox)window.Controls["ApplyToTheScreenGUI"];
                checkBox.Checked = EngineApp.Instance.ScreenGuiRenderer.ApplyPostEffectsToScreenRenderer;
                checkBox.Click  += delegate(ECheckBox sender)
                {
                    EngineApp.Instance.ScreenGuiRenderer.ApplyPostEffectsToScreenRenderer = sender.Checked;
                };
            }
        }