OnPlayerAnimation now uses GetDataHandledEventArgs.
This commit is contained in:
parent
c607ecfe27
commit
cd07aaf62c
1 changed files with 4 additions and 7 deletions
|
|
@ -1376,18 +1376,14 @@ namespace TShockAPI
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// For use with a PlayerAnimation event
|
/// For use with a PlayerAnimation event
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class PlayerAnimationEventArgs : HandledEventArgs
|
public class PlayerAnimationEventArgs : GetDataHandledEventArgs { }
|
||||||
{
|
|
||||||
/// <summary>The TSPlayer that triggered the event.</summary>
|
|
||||||
public TSPlayer Player { get; set; }
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// PlayerAnimation - Called when a player animates
|
/// PlayerAnimation - Called when a player animates
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static HandlerList<PlayerAnimationEventArgs> PlayerAnimation = new HandlerList<PlayerAnimationEventArgs>();
|
public static HandlerList<PlayerAnimationEventArgs> PlayerAnimation = new HandlerList<PlayerAnimationEventArgs>();
|
||||||
|
|
||||||
private static bool OnPlayerAnimation(TSPlayer player)
|
private static bool OnPlayerAnimation(TSPlayer player, MemoryStream data)
|
||||||
{
|
{
|
||||||
if (PlayerAnimation == null)
|
if (PlayerAnimation == null)
|
||||||
return false;
|
return false;
|
||||||
|
|
@ -1395,6 +1391,7 @@ namespace TShockAPI
|
||||||
var args = new PlayerAnimationEventArgs
|
var args = new PlayerAnimationEventArgs
|
||||||
{
|
{
|
||||||
Player = player,
|
Player = player,
|
||||||
|
Data = data,
|
||||||
};
|
};
|
||||||
PlayerAnimation.Invoke(null, args);
|
PlayerAnimation.Invoke(null, args);
|
||||||
return args.Handled;
|
return args.Handled;
|
||||||
|
|
@ -2747,7 +2744,7 @@ namespace TShockAPI
|
||||||
|
|
||||||
private static bool HandlePlayerAnimation(GetDataHandlerArgs args)
|
private static bool HandlePlayerAnimation(GetDataHandlerArgs args)
|
||||||
{
|
{
|
||||||
if (OnPlayerAnimation(args.Player))
|
if (OnPlayerAnimation(args.Player, args.Data))
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue