Skip to content

Commit

Permalink
feat(lua): add gui.Text:CalcTextSize, :GetTextWidth
Browse files Browse the repository at this point in the history
  • Loading branch information
Silverlan committed Sep 24, 2023
1 parent 6dd504b commit 0479571
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion build_scripts/scripts/external_libs.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,6 @@
get_submodule("util_vmf","https://github.com/Silverlan/util_vmf.git","cdba99d")
get_submodule("util_zip","https://github.com/Silverlan/util_zip.git","63b2609")
get_submodule("vfilesystem","https://github.com/Silverlan/vfilesystem.git","9404f31")
get_submodule("wgui","https://github.com/Silverlan/wgui.git","b2e8b6e9da357d99da11490a9b5bcc2dc952ea1c")
get_submodule("wgui","https://github.com/Silverlan/wgui.git","ae9c1fb5a422cff4db01857d717c8fa8cd89d22f")

os.chdir(curDir)
2 changes: 2 additions & 0 deletions core/client/src/lua/classes/c_lwibase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -750,6 +750,8 @@ void Lua::WIText::register_class(luabind::class_<::WIText, ::WIBase> &classDef)
classDef.def(
"GetText", +[](const ::WIText &text) { return text.GetText().cpp_str(); });
classDef.def("GetTextHeight", &::WIText::GetTextHeight);
classDef.def("CalcTextSize", &::WIText::CalcTextSize);
classDef.def("GetTextWidth", &::WIText::GetTextWidth);
classDef.def("SetFont", static_cast<void (*)(lua_State *, ::WIText &, const std::string &)>([](lua_State *l, ::WIText &hPanel, const std::string &font) { hPanel.SetFont(font); }));
classDef.def(
"GetFont", +[](lua_State *l, ::WIText &hPanel) -> std::optional<std::string> {
Expand Down

0 comments on commit 0479571

Please sign in to comment.