1. We have added a Gift Upgrades feature that allows you to gift an account upgrade to another member, just in time for the holiday season. You can see the gift option when going to the Account Upgrades screen, or on any user profile screen.
    Dismiss Notice

Custom Notifications Icons

Discussion in 'Civ5 - Creation & Customization' started by bane_, Apr 14, 2016.

  1. bane_

    bane_ Howardianism High-Priest

    Joined:
    Nov 27, 2013
    Messages:
    1,559
    How would one use Player:AddNotification() with a custom icon from a custom atlas?
    I am aware of the size (80x80), but I'm not sure which flag (if any) I should input the information (and which information?).

    Thanks.
     
  2. whoward69

    whoward69 DLL Minion

    Joined:
    May 30, 2011
    Messages:
    8,532
    Location:
    Near Portsmouth, UK
    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
     
  3. bane_

    bane_ Howardianism High-Priest

    Joined:
    Nov 27, 2013
    Messages:
    1,559
  4. pineappledan

    pineappledan Deity

    Joined:
    Aug 9, 2017
    Messages:
    6,000
    Gender:
    Male
    Location:
    Alberta, Canada

Share This Page