From 44bc95697ba44330e484dbef61548d07fbdfe933 Mon Sep 17 00:00:00 2001 From: Antoniofo Date: Tue, 2 Jul 2024 20:56:38 +0200 Subject: [PATCH] Added more config --- Config.cs | 3 +++ ElevatorBC.cs | 10 +++++----- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/Config.cs b/Config.cs index e175e62..d7e4d44 100644 --- a/Config.cs +++ b/Config.cs @@ -13,5 +13,8 @@ public class Config : IConfig public bool Debug { get; set; } = false; + public float Distance { get; set; } = 10.0f; + + public float HintDuration { get; set; } = 3f; } } diff --git a/ElevatorBC.cs b/ElevatorBC.cs index 1a23f35..a8709a7 100644 --- a/ElevatorBC.cs +++ b/ElevatorBC.cs @@ -18,7 +18,7 @@ public class ElevatorBC : Plugin public override string Name => "ElevatorBC"; - public override Version Version => new Version(1,0,0); + public override Version Version => new Version(1,1,0); public override string Prefix => "elevatorbc"; public override void OnEnabled() @@ -38,9 +38,9 @@ public void On914Activating(ActivatingEventArgs ev) { foreach (Player ply in Player.List) { - if (Vector3.Distance(ply.Position, Exiled.API.Features.Scp914.Transform.position) < 10.0f) + if (Vector3.Distance(ply.Position, Exiled.API.Features.Scp914.Transform.position) < Config.Distance) { - ply.ShowHint(Translation.Scp914Message.Replace("%NAME%", ev.Player.DisplayNickname).Replace("%MODE%",Exiled.API.Features.Scp914.KnobStatus.ToString())); + ply.ShowHint(Translation.Scp914Message.Replace("%NAME%", ev.Player.DisplayNickname).Replace("%MODE%",Exiled.API.Features.Scp914.KnobStatus.ToString()), Config.HintDuration); } } } @@ -49,9 +49,9 @@ public void OnPlayerInteractElevator(InteractingElevatorEventArgs ev) foreach (Player ply in Player.List) { - if (Vector3.Distance(ply.Position, ev.Elevator.gameObject.transform.position) < 10.0f) + if (Vector3.Distance(ply.Position, ev.Elevator.gameObject.transform.position) < Config.Distance) { - ply.ShowHint(Translation.ElevatorMessage.Replace("%NAME%", ev.Player.DisplayNickname)); + ply.ShowHint(Translation.ElevatorMessage.Replace("%NAME%", ev.Player.DisplayNickname), Config.HintDuration); } }