mirror of
https://github.com/misternebula/quantum-space-buddies.git
synced 2024-12-27 06:18:52 +00:00
21 lines
508 B
C#
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;
|
|
}
|
|
}
|