• Our friends from AlphaCentauri2.info are in need of technical assistance. If you have experience with the LAMP stack and some hours to spare, please help them out and post here.

Custom Notifications Icons

Ha! That would assume this game is moddable!

Short answer to "how to use Player:AddNotification() with a custom icon from a custom atlas" is "you can't" (as that would be too easy!)

The medium length answer is that you need to find a notification that does almost what you want and then bend it to your needs (preferably before it brings you to your knees!)

The most commonly used one is NOTIFICATION_WONDER_BEATEN as that uses the iExtraData1 value as an index into the Buildings table to retrieve the icon atlas/index pair and if not -1, the iExtraData2 value to display a civ's shield over the top of it. So to get it to display a generic icon you need to create a dummy building that uses that icon.

What happens when you click on the notification (like the Barb camp one showing you the location on the map) is hard-coded within the UI DLL, so if you want a complex notification you're out of luck unless you can find a standard one that does almost exactly what you want with no unwanted side effects (like displaying a pop-up dialog)

The longer answer is to use "UI - Notification Options" which in addition to letting the player switch on/off notifications of a certain type for the current/all games, and use control-right-click to remove all similar active notifications, provides a modular API to permit custom notifications of any complexity to be added - simple example is "Global - Enable Magellan", more complex example is "Global - Espionage Mapping"

W

PS: Thanks for returning Minion Igor
 
Thanks for this! Worked wonderfully (the sad drum sound obviously isn't the best match for a new luxury, but what can ya do? :dunno:)
 
Back
Top Bottom