feat(ui): implement CSimpleTexture_SetDrawLayer
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-03 16:24:09 -06:00
parent 0681e432e2
commit 3bf95af10c
No known key found for this signature in database
GPG Key ID: 7628F8E61AEA070D

View File

@ -19,7 +19,25 @@ int32_t CSimpleTexture_GetDrawLayer(lua_State* L) {
}
int32_t CSimpleTexture_SetDrawLayer(lua_State* L) {
WHOA_UNIMPLEMENTED(0);
auto type = CSimpleTexture::GetObjectType();
auto texture = static_cast<CSimpleTexture*>(FrameScript_GetObjectThis(L, type));
if (!lua_isstring(L, 2)) {
luaL_error(L, "Usage: %s:SetDrawLayer(\"layer\")", texture->GetDisplayName());
return 0;
}
auto drawlayerStr = lua_tostring(L, 2);
int32_t drawlayer = texture->m_drawlayer;
if (!StringToDrawLayer(drawlayerStr, drawlayer)) {
luaL_error(L, "Usage: %s:SetDrawLayer(\"layer\")", texture->GetDisplayName());
return 0;
}
texture->SetFrame(texture->m_parent, drawlayer, texture->m_shown);
return 0;
}
int32_t CSimpleTexture_GetBlendMode(lua_State* L) {