From 9d7e5893c6138e00faf0858608ef15780a101878 Mon Sep 17 00:00:00 2001 From: Quentin Date: Tue, 14 Nov 2023 20:20:45 +0100 Subject: [PATCH] fix(lua): small lua / lau doc fixes (#2415) * fix(lua): small lua / lau doc fixes: expose stats.get_character_index like intended. also add a bit of doc to button and sameline pages so that the user is correctly refered to the tab class doc --- docs/lua/classes/button.md | 1 + docs/lua/classes/sameline.md | 1 + src/lua/bindings/gui/button.hpp | 1 + src/lua/bindings/gui/sameline.hpp | 1 + src/lua/bindings/stats.cpp | 2 ++ 5 files changed, 6 insertions(+) diff --git a/docs/lua/classes/button.md b/docs/lua/classes/button.md index 81854cd1..12c0fc96 100644 --- a/docs/lua/classes/button.md +++ b/docs/lua/classes/button.md @@ -3,4 +3,5 @@ ## Inherit from 1 class: base_text_element Class representing a gui button. +Refer to the tab class documentation for more info (tab:add_button(name, callback)) diff --git a/docs/lua/classes/sameline.md b/docs/lua/classes/sameline.md index 561c0c66..d4e4c106 100644 --- a/docs/lua/classes/sameline.md +++ b/docs/lua/classes/sameline.md @@ -1,4 +1,5 @@ # Class: sameline Class for ImGui::SameLine() - Puts a sameline between widgets or groups to layout them horizontally. +Refer to the tab class documentation for more info (tab:add_sameline()) diff --git a/src/lua/bindings/gui/button.hpp b/src/lua/bindings/gui/button.hpp index 6dce6ff4..b6ec7580 100644 --- a/src/lua/bindings/gui/button.hpp +++ b/src/lua/bindings/gui/button.hpp @@ -8,6 +8,7 @@ namespace lua::gui // Name: button // Inherit: base_text_element // Class representing a gui button. + // Refer to the tab class documentation for more info (tab:add_button(name, callback)) class button : public base_text_element { sol::protected_function m_callback; diff --git a/src/lua/bindings/gui/sameline.hpp b/src/lua/bindings/gui/sameline.hpp index e396f3ea..09e4d6e0 100644 --- a/src/lua/bindings/gui/sameline.hpp +++ b/src/lua/bindings/gui/sameline.hpp @@ -6,6 +6,7 @@ namespace lua::gui // Lua API: Class // Name: sameline // Class for ImGui::SameLine() - Puts a sameline between widgets or groups to layout them horizontally. + // Refer to the tab class documentation for more info (tab:add_sameline()) class sameline : public gui_element { public: diff --git a/src/lua/bindings/stats.cpp b/src/lua/bindings/stats.cpp index a6eb1d4d..f1241da2 100644 --- a/src/lua/bindings/stats.cpp +++ b/src/lua/bindings/stats.cpp @@ -277,6 +277,8 @@ namespace lua::stats { auto ns = state["stats"].get_or_create(); + ns["get_character_index"] = get_character_index; + ns["get_bool"] = sol::overload(get_bool_hash, get_bool_name); ns["get_bool_masked"] = sol::overload(get_bool_masked_hash, get_bool_masked_name); ns["get_float"] = sol::overload(get_float_hash, get_float_name);