diff --git a/src/engine/client/text.cpp b/src/engine/client/text.cpp index fd0e8ece0..af6c5bc0b 100644 --- a/src/engine/client/text.cpp +++ b/src/engine/client/text.cpp @@ -1590,14 +1590,6 @@ public: const STextContainer &TextContainer = GetTextContainer(TextContainerIndex); const CFont *pFont = TextContainer.m_pFont; - if(TextContainer.m_StringInfo.m_SelectionQuadContainerIndex != -1 && TextContainer.m_HasSelection) - { - Graphics()->TextureClear(); - Graphics()->SetColor(m_SelectionColor); - Graphics()->RenderQuadContainerEx(TextContainer.m_StringInfo.m_SelectionQuadContainerIndex, TextContainer.m_HasCursor ? 2 : 0, -1, 0, 0); - Graphics()->SetColor(1.0f, 1.0f, 1.0f, 1.0f); - } - if(TextContainer.m_StringInfo.m_QuadNum > 0) { if(Graphics()->IsTextBufferingEnabled()) @@ -1653,21 +1645,32 @@ public: } } - if(TextContainer.m_StringInfo.m_SelectionQuadContainerIndex != -1 && TextContainer.m_HasCursor) + if(TextContainer.m_StringInfo.m_SelectionQuadContainerIndex != -1) { - const auto CurTime = time_get_nanoseconds(); - - Graphics()->TextureClear(); - if((CurTime - m_CursorRenderTime) > 500ms) + if(TextContainer.m_HasSelection) { - Graphics()->SetColor(TextOutlineColor); - Graphics()->RenderQuadContainerEx(TextContainer.m_StringInfo.m_SelectionQuadContainerIndex, 0, 1, 0, 0); - Graphics()->SetColor(TextColor); - Graphics()->RenderQuadContainerEx(TextContainer.m_StringInfo.m_SelectionQuadContainerIndex, 1, 1, 0, 0); + Graphics()->TextureClear(); + Graphics()->SetColor(m_SelectionColor); + Graphics()->RenderQuadContainerEx(TextContainer.m_StringInfo.m_SelectionQuadContainerIndex, TextContainer.m_HasCursor ? 2 : 0, -1, 0, 0); + Graphics()->SetColor(1.0f, 1.0f, 1.0f, 1.0f); + } + + if(TextContainer.m_HasCursor) + { + const auto CurTime = time_get_nanoseconds(); + + Graphics()->TextureClear(); + if((CurTime - m_CursorRenderTime) > 500ms) + { + Graphics()->SetColor(TextOutlineColor); + Graphics()->RenderQuadContainerEx(TextContainer.m_StringInfo.m_SelectionQuadContainerIndex, 0, 1, 0, 0); + Graphics()->SetColor(TextColor); + Graphics()->RenderQuadContainerEx(TextContainer.m_StringInfo.m_SelectionQuadContainerIndex, 1, 1, 0, 0); + } + if((CurTime - m_CursorRenderTime) > 1s) + m_CursorRenderTime = time_get_nanoseconds(); + Graphics()->SetColor(1.0f, 1.0f, 1.0f, 1.0f); } - if((CurTime - m_CursorRenderTime) > 1s) - m_CursorRenderTime = time_get_nanoseconds(); - Graphics()->SetColor(1.0f, 1.0f, 1.0f, 1.0f); } } diff --git a/src/engine/textrender.h b/src/engine/textrender.h index 05ee344de..ad62634b7 100644 --- a/src/engine/textrender.h +++ b/src/engine/textrender.h @@ -233,7 +233,7 @@ public: ColorRGBA DefaultTextColor() const { return ColorRGBA(1, 1, 1, 1); } ColorRGBA DefaultTextOutlineColor() const { return ColorRGBA(0, 0, 0, 0.3f); } - ColorRGBA DefaultTextSelectionColor() const { return ColorRGBA(0, 0, 1.0f, 1.0f); } + ColorRGBA DefaultTextSelectionColor() const { return ColorRGBA(1.0f, 1.0f, 1.0f, 0.5f); } // virtual void TextEx(CTextCursor *pCursor, const char *pText, int Length = -1) = 0;