Creating Notifications - AnduoGames/ThirdCrisisModding GitHub Wiki

Notifications

Notifications in Third Crisis are small UI displaying information to the player. These are typically used as reminders, hints, or tutorial messages. To create your own Notification, you just need to pass the message in like so:

Notification.Create("This is a modded notification!");

Popups

Popups are a different form of notification that includes buttons. These can be used for yes/no prompts or simply making sure the player acknolowedges something. To create a Popup easily, and in the same manner as a Notification:

Popup.Create("This is a modded popup!");

Alternatively, you can add more to the Popup such as: Yes/No buttons, Title, Text, and even run extra code per button.

// First you need a PopupData. 
var popupdata = new PopupData()
{
    Title = "Mod Popup",
    Message = "This is a modded popup!",
    OnYes = () =>
    {
        Debug.Log("Yes Action!");
    },
    OnNo = () =>
    {
        Debug.Log("No Action!");
    }
};

// Pass the PopupData into the Create() just like before
Popup.Create(popupdata);