CHollingworth / Lampray

Linux Application Modding Platform. A native Linux mod manager.
https://www.nexusmods.com/baldursgate3/mods/2169
The Unlicense
174 stars 16 forks source link

feat: Add a basic notification system #114

Closed SnazzyPanda closed 8 months ago

SnazzyPanda commented 8 months ago

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:

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: notifs-1 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.

CHollingworth commented 8 months ago

How does the user dismiss notifications?

SnazzyPanda commented 8 months ago

The get dismissed when the user clicks them.