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