Skip to content

Commit

Permalink
Added more config
Browse files Browse the repository at this point in the history
  • Loading branch information
Antoniofo committed Jul 2, 2024
1 parent 0c67f9f commit 44bc956
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
3 changes: 3 additions & 0 deletions Config.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
10 changes: 5 additions & 5 deletions ElevatorBC.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public class ElevatorBC : Plugin<Config, Translation>

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()
Expand All @@ -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);
}
}
}
Expand All @@ -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);
}
}

Expand Down

0 comments on commit 44bc956

Please sign in to comment.