goatcorp / Dalamud

FFXIV plugin framework and API
GNU Affero General Public License v3.0
1.26k stars 283 forks source link

Notification actions #1204

Open anna-is-cute opened 1 year ago

anna-is-cute commented 1 year ago

goat: "I don't have time for it, so if you want it, the first step would be an issue describing the API you'd like"

I'd like to be able to show notifications to users (a la UiBuilder.AddNotification) that also have associated action buttons.

Something like

uiBuilder.CreateNotification("Message", "Title")
    .AddAction("Button label", () => { /* action here */ })
    .AddAction("Other action", () => { /* do stuff */ })
    .Show();

or maybe full builder

uiBuilder.CreateNotification()
    .Title("Title")
    .Message("Message")
    .AddAction("Button label", () => { /* action here */ })
    .AddAction("Other action", () => { /* do stuff */ })
    .Show();

Basically just wanna have a button that fires an Action on click inside of the notification popup.

MidoriKami commented 1 year ago

This seems similar to the notifications that DeathRecap had to implement, would it make sense to also allow the dev to specify size and position?

KazWolfe commented 1 year ago

would it make sense to also allow the dev to specify size and position?

Barring a compelling reason otherwise, I'd say no. This seems an enhancement to the already-existing notification system and should inherit that system's behavior (that is, put it in the stack to the bottom right alongside any other plugin-generated notifications).

Might be worth giving end users more control over their notification stack, but that's out of scope for this feature request.

goaaats commented 1 year ago

If anything, that should be a setting in Dalamud.

MidoriKami commented 1 year ago

I always felt that the notifications were nice looking, but too small and too subtle, that might be a consequence of using a 1440p display.

MidoriKami commented 1 year ago

Another thought that just came to mind is the ability to specify a sound effect, since this proposal is for notifications that a user would need to react to, having some kind of audible alert might be helpful not only for grabbing attention but improving accessibility.