add show_success lua binding (#3249)

This commit is contained in:
kikkin_yo_azzez
2024-06-19 04:37:38 -05:00
committed by GitHub
parent 501182b10c
commit a40f4a4956
2 changed files with 26 additions and 1 deletions

View File

@ -243,6 +243,17 @@ namespace lua::gui
return new_tab;
}
// Lua API: Function
// Table: gui
// Name: show_success
// Param: title: string
// Param: message: string
// Shows a success to the user with the given title and message.
static void show_success(const std::string& title, const std::string& message)
{
big::g_notification_service.push_success(title, message);
}
// Lua API: Function
// Table: gui
// Name: show_message
@ -317,6 +328,7 @@ namespace lua::gui
auto ns = state["gui"].get_or_create<sol::table>();
ns["get_tab"] = get_tab;
ns["add_tab"] = add_tab;
ns["show_success"] = show_success;
ns["show_message"] = show_message;
ns["show_warning"] = show_warning;
ns["show_error"] = show_error;