Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class UISL_UIShell_Message_YourMod extends UIScreenListener config(YourMod_Hint_NullConfig);
- var config bool bDismissed;
- var localized string strModIsMissing;
- event OnInit(UIScreen Screen)
- {
- if(UIShell(Screen) != none && !bDismissed && !IsDLCInstalled('DEPENDS_ON_MOD_NAME'))
- {
- Screen.SetTimer(3.0f, false, nameof(MakePopup), self);
- }
- }
- simulated function MakePopup()
- {
- local TDialogueBoxData kDialogData;
- kDialogData.eType = eDialog_Warning;
- kDialogData.strText = GetText();
- kDialogData.fnCallback = OKClickedCB;
- kDialogData.strAccept = class'UIUtilities_Text'.default.m_strGenericAccept;
- `PRESBASE.UIRaiseDialog(kDialogData);
- }
- simulated function OKClickedCB(eUIAction eAction)
- {
- `PRESBASE.PlayUISound(eSUISound_MenuSelect);
- bDismissed = true;
- self.SaveConfig();
- }
- simulated function string GetText()
- {
- return strModIsMissing;
- }
- static function bool IsDLCInstalled(name DLCName)
- {
- local XComOnlineEventMgr EventManager;
- local int i;
- EventManager = `ONLINEEVENTMGR;
- for(i = 0; i < EventManager.GetNumDLC(); ++i)
- {
- if (DLCName == EventManager.GetDLCNames(i))
- {
- return true;
- }
- }
- return false;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement