refactor!: Rewrite of the old notification service (#2866)
The main goal was improving the readability of the original code however some ugliness remains. - Swapped from pointer singleton to instance singleton - Actually make use of the alpha logic that used to be present - Added a counter to notifications to indicate if something is being spammed - Notification timeouts reset if they're sent to the queue again
This commit is contained in:
@ -251,7 +251,7 @@ namespace lua::gui
|
||||
// Shows a message to the user with the given title and message.
|
||||
static void show_message(const std::string& title, const std::string& message)
|
||||
{
|
||||
big::g_notification_service->push(title, message);
|
||||
big::g_notification_service.push(title, message);
|
||||
}
|
||||
|
||||
// Lua API: Function
|
||||
@ -262,7 +262,7 @@ namespace lua::gui
|
||||
// Shows a warning to the user with the given title and message.
|
||||
static void show_warning(const std::string& title, const std::string& message)
|
||||
{
|
||||
big::g_notification_service->push_warning(title, message);
|
||||
big::g_notification_service.push_warning(title, message);
|
||||
}
|
||||
|
||||
// Lua API: Function
|
||||
@ -273,7 +273,7 @@ namespace lua::gui
|
||||
// Shows an error to the user with the given title and message.
|
||||
static void show_error(const std::string& title, const std::string& message)
|
||||
{
|
||||
big::g_notification_service->push_error(title, message);
|
||||
big::g_notification_service.push_error(title, message);
|
||||
}
|
||||
|
||||
// Lua API: Function
|
||||
@ -373,4 +373,4 @@ namespace lua::gui
|
||||
tab_ut["add_input_string"] = &tab::add_input_string;
|
||||
tab_ut["add_imgui"] = &tab::add_imgui;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user