fixes alert onclick (#3521)
Co-authored-by: Paul <ritter.paul1+git@googlemail.com>
This commit is contained in:
@@ -219,7 +219,6 @@ namespace Content.Client.GameObjects.Components.Mobs
|
||||
return;
|
||||
}
|
||||
|
||||
if (!alert.Alert.HasOnClick) return;
|
||||
SendNetworkMessage(new ClickAlertMessage(alert.Alert.AlertType));
|
||||
}
|
||||
|
||||
|
||||
@@ -70,15 +70,13 @@ namespace Content.Server.GameObjects.Components.Mobs
|
||||
break;
|
||||
}
|
||||
|
||||
if (AlertManager.TryGet(msg.AlertType, out var alert) && alert.OnClick != null)
|
||||
{
|
||||
alert.OnClick.AlertClicked(new ClickAlertEventArgs(player, alert));
|
||||
}
|
||||
else
|
||||
if (!AlertManager.TryGet(msg.AlertType, out var alert))
|
||||
{
|
||||
Logger.WarningS("alert", "unrecognized encoded alert {0}", msg.AlertType);
|
||||
break;
|
||||
}
|
||||
|
||||
alert.OnClick?.AlertClicked(new ClickAlertEventArgs(player, alert));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -83,11 +83,6 @@ namespace Content.Shared.Alert
|
||||
/// </summary>
|
||||
public bool SupportsSeverity => MaxSeverity != -1;
|
||||
|
||||
/// <summary>
|
||||
/// Whether this alert is clickable. This is valid clientside.
|
||||
/// </summary>
|
||||
public bool HasOnClick => OnClick != null;
|
||||
|
||||
/// <summary>
|
||||
/// Defines what to do when the alert is clicked.
|
||||
/// This will always be null on clientside.
|
||||
|
||||
Reference in New Issue
Block a user