Adds a basic notification system to help us notify users of various errors, warnings, etc.
As part of this change, I had to bump the ImGui version to 1.90, and I have not fully re-tested the interface.
Some of the main changes include:
Adding a new file at Lampray/Control/lampNotification.h to provide functionality
Bumping the ImGui version to 1.90 to make use of recently added ChildWindow flags for auto-height resizing.
Fixing an issue with changing the font scale (the bug likely showed itself due to the ImGui update)
Added an error notification for when we fail to find the 7z.so file.
Usage
To add a notification for display, you would just need to include the Lampray/Control/lampNotification.h file and then call the related function with your notification message:
Currently, notifications only get displayed on the main modlist screen. To display them somewhere else, you would need to move or add Lamp::Core::lampNotification::getInstance().DisplayNotifications();. Perhaps in the future, we could also find some way to specify notification location (such as "top", "bottom", etc) to have multiple, separate notification areas.
The colors used are not currently user configurable, but should be exposed for modifying if needed.
I also implemented a word-wrapping function to try to support longer notification messages. I think it should work fine, but feel free to try to throw some stuff at it to make sure it holds up.
Here is an example of what this currently looks like:
In the screenshot, there are 2 info notifications ("Test Info" and a notification I was using to test longer strings with minimal spaces in them). The error notification at the bottom is showing a more standard message (with spaces throughout) that needs wrapping due to its length.
Adds a basic notification system to help us notify users of various errors, warnings, etc.
As part of this change, I had to bump the ImGui version to 1.90, and I have not fully re-tested the interface.
Some of the main changes include:
Lampray/Control/lampNotification.h
to provide functionalityUsage
To add a notification for display, you would just need to include the
Lampray/Control/lampNotification.h
file and then call the related function with your notification message:Lamp::Core::lampNotification::getInstance().pushErrorNotification("Error");
Lamp::Core::lampNotification::getInstance().pushInfoNotification("Info");
Lamp::Core::lampNotification::getInstance().pushWarningNotification("Warning");
Lamp::Core::lampNotification::getInstance().pushSuccessNotification("Success");
type
is a string representation of the notification type ("info", "warning", "success", "error"):Lamp::Core::lampNotification::getInstance().pushNotification("type", "message");
Currently, notifications only get displayed on the main modlist screen. To display them somewhere else, you would need to move or add
Lamp::Core::lampNotification::getInstance().DisplayNotifications();
. Perhaps in the future, we could also find some way to specify notification location (such as "top", "bottom", etc) to have multiple, separate notification areas.The colors used are not currently user configurable, but should be exposed for modifying if needed.
I also implemented a word-wrapping function to try to support longer notification messages. I think it should work fine, but feel free to try to throw some stuff at it to make sure it holds up.
Here is an example of what this currently looks like:
In the screenshot, there are 2 info notifications ("Test Info" and a notification I was using to test longer strings with minimal spaces in them). The error notification at the bottom is showing a more standard message (with spaces throughout) that needs wrapping due to its length.