From f32975f34087ec79818b64c6884b279d0f709305 Mon Sep 17 00:00:00 2001 From: fallenoak Date: Tue, 18 Nov 2025 15:05:32 -0600 Subject: [PATCH] feat(ui): implement CSimpleFontString_GetFontObject --- src/ui/CSimpleFontStringScript.cpp | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/src/ui/CSimpleFontStringScript.cpp b/src/ui/CSimpleFontStringScript.cpp index 10fe668..b7c05be 100644 --- a/src/ui/CSimpleFontStringScript.cpp +++ b/src/ui/CSimpleFontStringScript.cpp @@ -73,7 +73,24 @@ int32_t CSimpleFontString_IsShown(lua_State* L) { } int32_t CSimpleFontString_GetFontObject(lua_State* L) { - WHOA_UNIMPLEMENTED(0); + auto type = CSimpleFontString::GetObjectType(); + auto string = static_cast(FrameScript_GetObjectThis(L, type)); + + auto font = string->GetFontObject(); + + if (!font) { + lua_pushnil(L); + + return 1; + } + + if (!font->lua_registered) { + font->RegisterScriptObject(nullptr); + } + + lua_rawgeti(L, LUA_REGISTRYINDEX, font->lua_objectRef); + + return 1; } int32_t CSimpleFontString_SetFontObject(lua_State* L) {