detain events
This commit is contained in:
parent
cf8e68f159
commit
bce7d936b3
@ -15,4 +15,6 @@ public sealed class DeathLogConfig
|
|||||||
|
|
||||||
public float DefaultFontSizeScalar { get; set; } = 1;
|
public float DefaultFontSizeScalar { get; set; } = 1;
|
||||||
|
|
||||||
|
public bool LogDetainEvents { get; set; } = true;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -90,4 +90,18 @@ public sealed class DeathLogPlugin
|
|||||||
LogHandler.LogLeavingScp(_lastRole, _lastHealth, _lastHumeShield, Config.VisibilityRequirement, Config.DefaultFontSizeScalar);
|
LogHandler.LogLeavingScp(_lastRole, _lastHealth, _lastHumeShield, Config.VisibilityRequirement, Config.DefaultFontSizeScalar);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[PluginEvent]
|
||||||
|
private void OnDetaining(PlayerHandcuffEvent e)
|
||||||
|
{
|
||||||
|
if (Config.LogDetainEvents)
|
||||||
|
LogHandler.LogDetain(e.Target, e.Player, Config.VisibilityRequirement, Config.DefaultFontSizeScalar);
|
||||||
|
}
|
||||||
|
|
||||||
|
[PluginEvent]
|
||||||
|
private void OnDetaining(PlayerRemoveHandcuffsEvent e)
|
||||||
|
{
|
||||||
|
if (Config.LogDetainEvents)
|
||||||
|
LogHandler.LogUnDetain(e.Target, e.Player, Config.VisibilityRequirement, Config.DefaultFontSizeScalar);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -167,10 +167,18 @@ public static class LogHandler
|
|||||||
_ => "[an unknown attack type]"
|
_ => "[an unknown attack type]"
|
||||||
};
|
};
|
||||||
|
|
||||||
public static void LogLeavingScp(string role, float health, float hs, PlayerPermissions permissions, float defaultScalar) =>
|
public static void LogLeavingScp(string role, float health, float hs, PlayerPermissions permissions, float defaultScalar)
|
||||||
Log(sizeScalar => $"{"SCP Left".Color("red").Bold()}#Please replace {role.Size(40.Scale(sizeScalar))} as the player has left the game.\n" +
|
=> Log(sizeScalar => $"{"SCP Left".Color("red").Bold()}#Please replace {role.Size(40.Scale(sizeScalar))} as the player has left the game.\n" +
|
||||||
($"HP: {((int) health).ToString().Color("red")} " +
|
($"HP: {((int) health).ToString().Color("red")} " +
|
||||||
$"HS: {((int) hs).ToString().Color("purple")}").Size(35.Scale(sizeScalar)), false, permissions, defaultScalar);
|
$"HS: {((int) hs).ToString().Color("purple")}").Size(35.Scale(sizeScalar)), false, permissions, defaultScalar);
|
||||||
|
|
||||||
|
public static void LogDetain(Player target, Player detainer, PlayerPermissions permissions, float defaultScalar)
|
||||||
|
=> Log(sizeScalar => $"{"CUFFING".Color("orange")}#{GetKillerStatus(detainer, sizeScalar)} {"detained".Color("orange").Size(30.Scale(sizeScalar))} {GetVictimStatus(target, sizeScalar)}",
|
||||||
|
true, permissions, defaultScalar);
|
||||||
|
|
||||||
|
public static void LogUnDetain(Player uncuffedPlayer, Player undetainer, PlayerPermissions permissions, float defaultScalar)
|
||||||
|
=> Log(sizeScalar => $"{"UNCUFFING".Color("red")}#{GetKillerStatus(undetainer, sizeScalar)} {"undetained".Color("red").Size(30.Scale(sizeScalar))} {GetVictimStatus(uncuffedPlayer, sizeScalar)}",
|
||||||
|
true, permissions, defaultScalar);
|
||||||
|
|
||||||
private static int Scale(this int number, float scalar) => (int) (number * scalar);
|
private static int Scale(this int number, float scalar) => (int) (number * scalar);
|
||||||
|
|
||||||
|
@ -15,6 +15,7 @@ public sealed class ToggleLogsCommand : ICommand
|
|||||||
public string Command => "toggleKillLogs";
|
public string Command => "toggleKillLogs";
|
||||||
public string[] Aliases { get; } = {"tkl"};
|
public string[] Aliases { get; } = {"tkl"};
|
||||||
public string Description => "Toggles the visibility of kill logs or changes the font size scalar for the caller.";
|
public string Description => "Toggles the visibility of kill logs or changes the font size scalar for the caller.";
|
||||||
|
public bool SanitizeResponse => false;
|
||||||
|
|
||||||
public bool Execute(ArraySegment<string> arguments, ICommandSender sender, out string response)
|
public bool Execute(ArraySegment<string> arguments, ICommandSender sender, out string response)
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user