예제 #1
0
        private void CreateProperties()
        {
            if (m_controllerProperties == null)
                m_controllerProperties = new MyTerminalPropertiesController();
            else
                m_controllerProperties.Close();

            m_controllerProperties.Init(m_propertiesTopMenuParent, m_propertiesTableParent, InteractedEntity, m_openInventoryInteractedEntity);
            if(m_propertiesTableParent != null)
                m_propertiesTableParent.Visible = m_initialPage == MyTerminalPageEnum.Properties;
        }
예제 #2
0
        private void CreateFixedTerminalElements()
        {
            m_terminalNotConnected = CreateErrorLabel(MySpaceTexts.ScreenTerminalError_ShipHasBeenDisconnected, "DisconnectedMessage");
            m_terminalNotConnected.Visible = false;

            var captionLabel = new MyGuiControlLabel()
            {
                Position = new Vector2(0f, -0.42f),
                Size = new Vector2(0.06918918f, 0.0266666654f),
                Name = "CaptionLabel",
                OriginAlign = MyGuiDrawAlignEnum.HORISONTAL_CENTER_AND_VERTICAL_CENTER,
                TextEnum = MySpaceTexts.Terminal
            };

            Controls.Add(m_terminalNotConnected);
            Controls.Add(captionLabel);
            if (MyFakes.ENABLE_TERMINAL_PROPERTIES)
            {

                //Inits of temporary panels
                m_propertiesTopMenuParent = new MyGuiControlParent()
                {
                    Position = new Vector2(-0.614f, -0.487f),
                    Size = new Vector2(0.3f, 0.15f),
                    Name = "PropertiesPanel",
                    OriginAlign = MyGuiDrawAlignEnum.HORISONTAL_LEFT_AND_VERTICAL_TOP,
                };

                m_propertiesTableParent = new MyGuiControlParent()
                {
                    Position = new Vector2(-0.02f, -0.67f),
                    Size = new Vector2(0.93f, 0.78f),
                    Name = "PropertiesTable",
                    OriginAlign = MyGuiDrawAlignEnum.HORISONTAL_CENTER_AND_VERTICAL_TOP,
                };

                //populate them
                CreatePropertiesPageControls(m_propertiesTopMenuParent, m_propertiesTableParent);

                //pass them onto the properties class
                if (m_controllerProperties == null)
                    m_controllerProperties = new MyTerminalPropertiesController();
                else
                    m_controllerProperties.Close();

                //adds event handlers
                m_controllerProperties.ButtonClicked += PropertiesButtonClicked;
                
                //Add to screen
                Controls.Add(m_propertiesTableParent);
                Controls.Add(m_propertiesTopMenuParent);
            }

        }