feat(ui): implement CSimpleFontString_IsVisible

This commit is contained in:
fallenoak 2026-01-27 08:20:56 -06:00
parent e872450202
commit ba5006a4d8
No known key found for this signature in database
GPG Key ID: 7628F8E61AEA070D
3 changed files with 15 additions and 1 deletions

View File

@ -73,7 +73,16 @@ int32_t CSimpleFontString_Hide(lua_State* L) {
} }
int32_t CSimpleFontString_IsVisible(lua_State* L) { int32_t CSimpleFontString_IsVisible(lua_State* L) {
WHOA_UNIMPLEMENTED(0); auto type = CSimpleFontString::GetObjectType();
auto string = static_cast<CSimpleFontString*>(FrameScript_GetObjectThis(L, type));
if (string->IsVisible()) {
lua_pushnumber(L, 1.0);
} else {
lua_pushnil(L);
}
return 1;
} }
int32_t CSimpleFontString_IsShown(lua_State* L) { int32_t CSimpleFontString_IsShown(lua_State* L) {

View File

@ -49,6 +49,10 @@ bool CSimpleRegion::IsShown() {
return this->m_shown == 1; return this->m_shown == 1;
} }
bool CSimpleRegion::IsVisible() {
return this->m_visible == 1;
}
void CSimpleRegion::OnColorChanged(bool a2) { void CSimpleRegion::OnColorChanged(bool a2) {
if (this->m_parent) { if (this->m_parent) {
uint8_t effectiveAlpha = this->m_parent->m_alpha * this->m_parent->alphaBD / 255; uint8_t effectiveAlpha = this->m_parent->m_alpha * this->m_parent->alphaBD / 255;

View File

@ -32,6 +32,7 @@ class CSimpleRegion : public CScriptRegion {
void Hide(); void Hide();
void HideThis(); void HideThis();
bool IsShown(); bool IsShown();
bool IsVisible();
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 SetVertexGradient(ORIENTATION orientation, const CImVector& minColor, const CImVector& maxColor);