sman1975
Emperor
Does anyone know how to make a custom UI unhide by clicking on a Notification button, like the generic "City State" UI does (i.e. the basic popup that asks "What business do you have here?" at the top)?
Looking over the NotificationPanel.lua (UI), I see 14 notifications (e.g. Found Pantheon/Religion, Enhance Religion, Choose Archaeology, Choose Ideology, Steal Tech, etc.) that have callbacks attached - that generate popups of some kind. The callbacks look like this:
Controls["FreeTechButton"]:RegisterCallback(Mouse.eLClick, GenericLeftClick); Controls["FreeTechButton"]:RegisterCallback(Mouse.eRClick, GenericRightClick);
Each of these notifications have a corresponding callback function/popup that performs some meaningful work when the notification button is tickled by the mouse.
However, the NOTIFICATION_MINOR notification (q.v.) is not one of the 14 notifications in NotificationPanel.lua. This implies there might some way to add a callback to a notification, even if it is defined in a different address space. This approach is counter-intuitive to me (as is much of the UI code), so I'm not following what's going on down in the weeds.
What I'm looking for is a way to add a notification w/ callback, hopefully without replacing the NotificationPanel.lua if at all possible. Appreciate it if anyone has a suggestion or knows of a mod that already manages this.
Thanks!
sman
Looking over the NotificationPanel.lua (UI), I see 14 notifications (e.g. Found Pantheon/Religion, Enhance Religion, Choose Archaeology, Choose Ideology, Steal Tech, etc.) that have callbacks attached - that generate popups of some kind. The callbacks look like this:
Controls["FreeTechButton"]:RegisterCallback(Mouse.eLClick, GenericLeftClick); Controls["FreeTechButton"]:RegisterCallback(Mouse.eRClick, GenericRightClick);
Each of these notifications have a corresponding callback function/popup that performs some meaningful work when the notification button is tickled by the mouse.
However, the NOTIFICATION_MINOR notification (q.v.) is not one of the 14 notifications in NotificationPanel.lua. This implies there might some way to add a callback to a notification, even if it is defined in a different address space. This approach is counter-intuitive to me (as is much of the UI code), so I'm not following what's going on down in the weeds.
What I'm looking for is a way to add a notification w/ callback, hopefully without replacing the NotificationPanel.lua if at all possible. Appreciate it if anyone has a suggestion or knows of a mod that already manages this.
Thanks!
sman