Skip to content

Commit

Permalink
Merge pull request #273 from InvalidArgument3/barfork
Browse files Browse the repository at this point in the history
better createnotif
  • Loading branch information
InvalidArgument3 authored Dec 2, 2024
2 parents 26028bd + 53935f0 commit ea11d7e
Showing 1 changed file with 7 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -553,17 +553,18 @@ private bool IsOtherBaRPoweredInGridGroup()
return false;
}

private void NotifyPlayersInRange(string message, Vector3D position, double radius, string color = "White")
private static void NotifyPlayersInRange(string text, Vector3D position, double radius, string font = "White")
{
var sphere = new BoundingSphereD(position, radius);
var entities = MyAPIGateway.Entities.GetEntitiesInSphere(ref sphere);
BoundingSphereD bound = new BoundingSphereD(position, radius);
List<IMyEntity> nearbyEntities = MyAPIGateway.Entities.GetEntitiesInSphere(ref bound);

foreach (var entity in entities)
foreach (var entity in nearbyEntities)
{
var character = entity as IMyCharacter;
IMyCharacter character = entity as IMyCharacter;
if (character != null && character.IsPlayer)
{
MyAPIGateway.Utilities.CreateNotification(message, 2000, color);
var notification = MyAPIGateway.Utilities.CreateNotification(text, 2000, font);
notification.Show();
}
}
}
Expand Down

0 comments on commit ea11d7e

Please sign in to comment.