public static void SpawnAlertFromEvent(StreamlabsEvent streamlabsEvent) { AlertDescriptor.AlertType alertType = streamlabsEvent.AlertType; foreach (AlertValue alertValue in alerts) { if (alertValue.value != "Disabled") { if (alertValue.alertType == alertType) { // found the proper one. get by name. foreach (CustomAlert alert in AlertObjectLoader.CustomAlerts) { if (alert.Descriptor.AlertName == alertValue.value) { // alert.streamEvent = streamlabsEvent; // duplicate the alert. CustomAlert newAlert = new CustomAlert(alert.gameObject, alert.Descriptor, streamlabsEvent); QueueController.instance.QueueAlert(newAlert); //alert.Spawn(); } } } } } }
public static void SetAlertByType(string inputValue, AlertDescriptor.AlertType alertType) { foreach (AlertValue alertValue in alerts) { if (alertValue.alertType == alertType) { alertValue.value = inputValue; Plugin.config.SetString("StreamlabsAlerts", alertType.ToString() + "Value", inputValue); } } }
public static string GetAlertName(AlertDescriptor.AlertType alertType) { CustomAlert alert = Utilities.AlertObjectLoader.GetAlertByType(alertType); if (alert != null) { return(alert.Descriptor.AlertName); } else { return("Disabled"); } }
//helper functions for displaying the options public static List <object> GetAlerts(AlertDescriptor.AlertType alertType) { List <object> followAlerts = new List <object>(); followAlerts.Add("Disabled"); foreach (CustomAlert alert in Utilities.AlertObjectLoader.CustomAlerts) { if (alert.Descriptor.AlertTriggerType == alertType) { followAlerts.Add(alert.Descriptor.AlertName); } } return(followAlerts); }
public static void SpawnChannelPointsAlert(StreamlabsEvent streamlabsEvent) { AlertDescriptor.AlertType alertType = streamlabsEvent.AlertType; foreach (CustomAlert alert in AlertObjectLoader.CustomAlerts) { if (alert.Descriptor.ChannelPointsName.ToLower().Trim() == streamlabsEvent.message[0].channelPointsName.ToLower().Trim()) { alert.streamEvent = streamlabsEvent; //QueueController.instance.QueueAlert(alert); // at least for now, i'm not gonna queue channel points. I think it'll be funnier when they're not queued. alert.Spawn(); } } }
public static CustomAlert GetAlertByType(AlertDescriptor.AlertType alertType) { foreach (AlertValue alertValue in alerts) { if (alertValue.value != "Disabled") { if (alertValue.alertType == alertType) { // found the proper one. get by name. foreach (CustomAlert alert in AlertObjectLoader.CustomAlerts) { if (alert.Descriptor.AlertName == alertValue.value) { Console.WriteLine(alert.Descriptor.AlertLifetime); return(alert); } } } } } return(null); }
public void SaveAlert(string input, AlertDescriptor.AlertType alertType) { Utilities.AlertObjectLoader.SetAlertByType(input, alertType); }