feat(ui): add CSimpleRegion::SetVertexGradient

This commit is contained in:
fallenoak 2025-12-23 11:40:24 -06:00
parent 066a53e667
commit 2fba6413bc
No known key found for this signature in database
GPG Key ID: 7628F8E61AEA070D
2 changed files with 35 additions and 0 deletions

View File

@ -143,6 +143,40 @@ void CSimpleRegion::SetVertexColor(const CImVector& color) {
this->OnColorChanged(b1); this->OnColorChanged(b1);
} }
void CSimpleRegion::SetVertexGradient(ORIENTATION orientation, const CImVector& minColor, const CImVector& maxColor) {
bool b1 = false;
if (this->m_colorCount != 4) {
this->m_alphaCount = 4;
this->m_colorCount = 4;
b1 = true;
}
if (orientation == ORIENTATION_VERTICAL) {
this->m_alpha[1] = minColor.a;
this->m_color[1] = minColor;
this->m_alpha[3] = minColor.a;
this->m_color[3] = minColor;
this->m_alpha[0] = maxColor.a;
this->m_color[0] = maxColor;
this->m_alpha[2] = maxColor.a;
this->m_color[2] = maxColor;
} else {
this->m_alpha[0] = minColor.a;
this->m_color[0] = minColor;
this->m_alpha[1] = minColor.a;
this->m_color[1] = minColor;
this->m_alpha[2] = maxColor.a;
this->m_color[2] = maxColor;
this->m_alpha[3] = maxColor.a;
this->m_color[3] = maxColor;
}
this->OnColorChanged(b1);
}
void CSimpleRegion::SetFrame(CSimpleFrame* frame, uint32_t drawlayer, int32_t show) { void CSimpleRegion::SetFrame(CSimpleFrame* frame, uint32_t drawlayer, int32_t show) {
if (this->m_parent == frame) { if (this->m_parent == frame) {
if (this->m_drawlayer == drawlayer) { if (this->m_drawlayer == drawlayer) {

View File

@ -34,6 +34,7 @@ class CSimpleRegion : public CScriptRegion {
bool IsShown(); bool IsShown();
void OnRegionChanged(); void OnRegionChanged();
void SetVertexColor(const CImVector& color); void SetVertexColor(const CImVector& color);
void SetVertexGradient(ORIENTATION orientation, const CImVector& minColor, const CImVector& maxColor);
void SetFrame(CSimpleFrame* frame, uint32_t drawlayer, int32_t show); void SetFrame(CSimpleFrame* frame, uint32_t drawlayer, int32_t show);
void Show(); void Show();
void ShowThis(); void ShowThis();