feat(ui): implement CLayoutFrame::SetProtectFlag

This commit is contained in:
fallenoak 2025-12-02 22:51:57 -06:00
parent fd01435140
commit 6c6e60e8f8
No known key found for this signature in database
GPG Key ID: 7628F8E61AEA070D
2 changed files with 23 additions and 2 deletions

View File

@ -591,7 +591,7 @@ void CLayoutFrame::OnProtectedAttach(CLayoutFrame* frame) {
frame->SetProtectFlag(0x400);
}
if (this->m_flags & 0x300) {
if (this->m_flags & (0x100 | 0x200)) {
frame->SetProtectFlag(0x200);
}
}
@ -821,7 +821,17 @@ void CLayoutFrame::SetPoint(FRAMEPOINT point, CLayoutFrame* relative, FRAMEPOINT
}
void CLayoutFrame::SetProtectFlag(uint32_t flag) {
// TODO
if (this->m_flags & (0x100 | 0x800)) {
return;
}
this->m_flags &= ~0x200;
this->m_flags |= (flag & 0xF7FF | 0x800);
// TODO this->PropagateProtectFlagToParent(flag);
this->Sub489190(flag);
this->m_flags &= ~0x800;
}
void CLayoutFrame::SetWidth(float width) {
@ -876,6 +886,16 @@ int32_t CLayoutFrame::Sub488E40(const FRAMEPOINT* const pointarray, int32_t elem
return 1;
}
void CLayoutFrame::Sub489190(uint32_t flag) {
for (int32_t i = 0; i < FRAMEPOINT_NUMPOINTS; i++) {
auto point = this->m_points[i];
if (point && !(point->m_flags & 0x8)) {
point->m_relative->SetProtectFlag(flag);
}
}
}
float CLayoutFrame::Top() {
if (this->m_guard.top) {
return CFramePoint::UNDEFINED;

View File

@ -86,6 +86,7 @@ class CLayoutFrame {
void SetProtectFlag(uint32_t flag);
int32_t Sub488DB0(const FRAMEPOINT* const pointarray, int32_t elements, float& x);
int32_t Sub488E40(const FRAMEPOINT* const pointarray, int32_t elements, float& y);
void Sub489190(uint32_t flag);
float Top();
void UnflattenFrame(CLayoutFrame* frame);
void UnregisterResize(CLayoutFrame* frame, uint32_t dep);