2022-03-10 17:57:50 -08:00

19 lines
697 B
C#

using QSB.Messaging;
using QSB.WorldSync;
namespace QSB.Tools.SignalscopeTool.FrequencySync.Messages;
public class IdentifyFrequencyMessage : QSBMessage<SignalFrequency>
{
public IdentifyFrequencyMessage(SignalFrequency frequency) : base(frequency) { }
public override bool ShouldReceive => QSBWorldSync.AllObjectsReady;
public override void OnReceiveRemote()
{
PlayerData.LearnFrequency(Data);
var displayMsg = $"{UITextLibrary.GetString(UITextType.NotificationNewFreq)} <color=orange>{AudioSignal.FrequencyToString(Data, false)}</color>";
var data = new NotificationData(NotificationTarget.All, displayMsg, 10f);
NotificationManager.SharedInstance.PostNotification(data);
}
}