示例#1
0
        public override void UpdateAfterSimulation()
        {
            base.UpdateAfterSimulation();
            if (IsBeingHacked)
            {
                PrivateDescription.Clear();
                SendChangeDescriptionMessage(PrivateDescription, false);
            }
            ResourceSink.Update();
            if (IsFunctional && IsWorking)
            {
                if (ShowTextOnScreen && IsInRange() == false)
                {
                    if (!m_isOutofRange)
                    {
                        m_isOutofRange = true;
                        ReleaseRenderTexture();
                    }
                    return;
                }

                if (ShowTextOnScreen && (NeedsToDrawText() || m_isOutofRange || m_forceUpdateText))
                {
                    m_descriptionChanged     = false;
                    m_forceUpdateText        = false;
                    m_fontColorChanged       = false;
                    m_fontSizeChanged        = false;
                    m_backgroundColorChanged = false;
                    m_fontChanged            = false;
                    Render.RenderTextToTexture(ShowTextFlag == ShowTextOnScreenFlag.PUBLIC ? m_publicDescription.ToString() : m_privateDescription.ToString(),
                                               FontSize * BlockDefinition.TextureResolution / DEFAULT_RESOLUTION, FontColor, BackgroundColor,
                                               BlockDefinition.TextureResolution, BlockDefinition.TextureAspectRadio);
                    FailedToRenderTexture = false;
                }

                m_isOutofRange = false;

                if (ShowTextOnScreen == false)
                {
                    UpdateTexture();
                }
            }
            else if (IsOpen)
            {
                SendChangeOpenMessage(false);
                if (m_textBox != null)
                {
                    m_textBox.CloseScreen();
                    //m_textBox = null;
                }
                MyScreenManager.CloseScreen(typeof(MyGuiScreenTerminal));
            }
        }
示例#2
0
        public override void UpdateAfterSimulation()
        {
            base.UpdateAfterSimulation();
            if (IsBeingHacked)
            {
                PrivateDescription.Clear();
                SyncObject.SendChangeDescriptionMessage(PrivateDescription, false);
            }
            PowerReceiver.Update();
            if (IsFunctional && IsWorking)
            {
                if (ShowTextOnScreen && IsInRange() == false)
                {
                    if (!m_isOutofRange)
                    {
                        m_isOutofRange = true;
                        ReleaseRenderTexture();
                    }
                    return;
                }

                if (ShowTextOnScreen && (NeedsToDrawText() || m_isOutofRange || m_forceUpdateText))
                {
                    m_descriptionChanged     = false;
                    m_forceUpdateText        = false;
                    m_fontColorChanged       = false;
                    m_fontSizeChanged        = false;
                    m_backgroundColorChanged = false;
                    Render.RenderTextToTexture(EntityId, ShowTextFlag == ShowTextOnScreenFlag.PUBLIC ? m_publicDescription.ToString() : m_privateDescription.ToString(), FontSize * BlockDefinition.TextureResolution / DEFAULT_RESOLUTION, FontColor, BackgroundColor, BlockDefinition.TextureResolution, BlockDefinition.TextureAspectRadio);
                    FailedToRenderTexture = false;
                }

                m_isOutofRange = false;

                if (ShowTextOnScreen == false)
                {
                    UpdateTexture();
                }
            }
        }