Skip to content

Commit

Permalink
Add SetRoomLightsForTargetOnly (Exiled-Team#65)
Browse files Browse the repository at this point in the history
  • Loading branch information
InziDeveloperMode committed Jul 16, 2024
1 parent 900b202 commit 2e3bf16
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions EXILED/Exiled.API/Extensions/MirrorExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,14 @@ public static void SetRoomColorForTargetOnly(this Room room, Player target, Colo
target.SendFakeSyncVar(room.RoomLightControllerNetIdentity, typeof(RoomLightController), nameof(RoomLightController.NetworkOverrideColor), true);
}

/// <summary>
/// Sets the lights of a <paramref name="room"/> to be either on or off, visible only to the <paramref name="target"/> player.
/// </summary>
/// <param name="room">The room to modify the lights of.</param>
/// <param name="target">The player who will see the lights state change.</param>
/// <param name="value">The state to set the lights to. True for on, false for off.</param>
public static void SetRoomLightsForTargetOnly(this Room room, Player target, bool value) => target.SendFakeSyncVar(room.RoomLightControllerNetIdentity, typeof(RoomLightController), nameof(RoomLightController.NetworkLightsEnabled), value);

/// <summary>
/// Sets <see cref="Player.DisplayNickname"/> of a <paramref name="player"/> that only the <paramref name="target"/> player can see.
/// </summary>
Expand Down

0 comments on commit 2e3bf16

Please sign in to comment.