fix(lua): better exception handling (#1734)

This commit is contained in:
Quentin
2023-07-16 23:32:34 +02:00
committed by GitHub
parent 2a81a041cf
commit 5a76164d43
8 changed files with 60 additions and 51 deletions

View File

@ -5,7 +5,7 @@
namespace lua::gui
{
button::button(std::string text, sol::function callback) :
button::button(std::string text, sol::protected_function callback) :
base_text_element(text),
m_callback(callback)
{

View File

@ -10,11 +10,11 @@ namespace lua::gui
// Class representing a gui button.
class button : public base_text_element
{
sol::function m_callback;
sol::protected_function m_callback;
bool m_execute_in_fiber_pool = true;
public:
button(std::string text, sol::function callback);
button(std::string text, sol::protected_function callback);
void draw() override;
};