quantum-space-buddies/QSB/Player/Messages/UpdateFOVMessage.cs
2023-07-28 19:30:57 +01:00

21 lines
508 B
C#

using QSB.Messaging;
using QSB.Utility;
namespace QSB.Player.Messages;
public class UpdateFOVMessage : QSBMessage<float>
{
static UpdateFOVMessage()
=> GlobalMessenger<GraphicSettings>.AddListener(
"GraphicSettingsUpdated",
(GraphicSettings settings) => new UpdateFOVMessage(settings.fieldOfView).Send());
private UpdateFOVMessage(float fov) : base(fov) { }
public override void OnReceiveRemote()
{
var player = QSBPlayerManager.GetPlayer(From);
player.Camera.fieldOfView = Data;
}
}