feat(ui): add CSimpleFrame::GetAttribute
Some checks are pending
Push / ${{ matrix.build.system_name }} / ${{ matrix.build.build_type }} / ${{ matrix.build.compiler_name }} (map[build_type:Release cc:cl compiler_name:MSVC cxx:cl os:windows-latest system_name:Windows test_path:WhoaTest]) (push) Waiting to run
Push / ${{ matrix.build.system_name }} / ${{ matrix.build.build_type }} / ${{ matrix.build.compiler_name }} (map[build_type:Release cc:clang compiler_name:Clang cxx:clang++ os:macos-latest system_name:macOS test_path:WhoaTest]) (push) Waiting to run
Push / ${{ matrix.build.system_name }} / ${{ matrix.build.build_type }} / ${{ matrix.build.compiler_name }} (map[build_type:Release cc:gcc compiler_name:GCC cxx:g++ os:ubuntu-latest system_name:Linux test_path:WhoaTest]) (push) Waiting to run

This commit is contained in:
fallenoak 2026-02-02 22:29:26 -06:00
parent ae64833a5c
commit c099226cd2
No known key found for this signature in database
GPG Key ID: 7628F8E61AEA070D
2 changed files with 13 additions and 0 deletions

View File

@ -522,6 +522,18 @@ void CSimpleFrame::PreLoadXML(XMLNode* node, CStatus* status) {
} }
} }
bool CSimpleFrame::GetAttribute(const char* name, int32_t& luaRef) {
auto attr = this->m_attributes.Ptr(name);
if (!attr || attr->luaRef == -1) {
return false;
}
luaRef = attr->luaRef;
return true;
}
int32_t CSimpleFrame::GetBoundsRect(CRect& bounds) { int32_t CSimpleFrame::GetBoundsRect(CRect& bounds) {
if (this->IsResizePending()) { if (this->IsResizePending()) {
this->Resize(1); this->Resize(1);

View File

@ -132,6 +132,7 @@ class CSimpleFrame : public CScriptRegion {
void DisableEvent(CSimpleEventType eventType); void DisableEvent(CSimpleEventType eventType);
void EnableDrawLayer(uint32_t drawlayer); void EnableDrawLayer(uint32_t drawlayer);
void EnableEvent(CSimpleEventType eventType, int32_t priority); void EnableEvent(CSimpleEventType eventType, int32_t priority);
bool GetAttribute(const char* name, int32_t& luaRef);
int32_t GetHitRect(CRect& rect); int32_t GetHitRect(CRect& rect);
void Hide(); void Hide();
void LoadXML_Attributes(const XMLNode* node, CStatus* status); void LoadXML_Attributes(const XMLNode* node, CStatus* status);