From 728ad2242d976da4d7e8e2694a2f1b13ef3a069b Mon Sep 17 00:00:00 2001 From: fallenoak Date: Tue, 21 Feb 2023 17:39:04 -0600 Subject: [PATCH] feat(ui): handle border colors in backdrop generator --- src/ui/CBackdropGenerator.cpp | 38 +++++++++++++++++++++++++++++++++-- 1 file changed, 36 insertions(+), 2 deletions(-) diff --git a/src/ui/CBackdropGenerator.cpp b/src/ui/CBackdropGenerator.cpp index b586081..5be5ac0 100644 --- a/src/ui/CBackdropGenerator.cpp +++ b/src/ui/CBackdropGenerator.cpp @@ -137,7 +137,9 @@ void CBackdropGenerator::LoadXML(XMLNode* node, CStatus* status) { // TODO } else if (!SStrCmpI(child->GetName(), "BorderColor", STORM_MAX_STR)) { - // TODO + CImVector borderColor = { 0 }; + LoadXML_Color(child, borderColor); + this->SetBorderVertexColor(borderColor); } else { status->Add( @@ -151,7 +153,39 @@ void CBackdropGenerator::LoadXML(XMLNode* node, CStatus* status) { } void CBackdropGenerator::SetBorderVertexColor(const CImVector& borderColor) { - // TODO + this->m_borderColor = borderColor; + + if (this->m_leftTexture) { + this->m_leftTexture->SetVertexColor(borderColor); + } + + if (this->m_rightTexture) { + this->m_rightTexture->SetVertexColor(borderColor); + } + + if (this->m_topTexture) { + this->m_topTexture->SetVertexColor(borderColor); + } + + if (this->m_bottomTexture) { + this->m_bottomTexture->SetVertexColor(borderColor); + } + + if (this->m_topLeftTexture) { + this->m_topLeftTexture->SetVertexColor(borderColor); + } + + if (this->m_topRightTexture) { + this->m_topRightTexture->SetVertexColor(borderColor); + } + + if (this->m_bottomLeftTexture) { + this->m_bottomLeftTexture->SetVertexColor(borderColor); + } + + if (this->m_bottomRightTexture) { + this->m_bottomRightTexture->SetVertexColor(borderColor); + } } void CBackdropGenerator::SetOutput(CSimpleFrame* frame) {