quantum-space-buddies/QSB/Player/Messages/UpdateFOVMessage.cs

21 lines
508 B
C#
Raw Permalink Normal View History

2023-01-21 11:09:24 +00:00
using QSB.Messaging;
using QSB.Utility;
namespace QSB.Player.Messages;
2023-07-28 18:30:57 +00:00
public class UpdateFOVMessage : QSBMessage<float>
2023-01-21 11:09:24 +00:00
{
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;
}
}