Voice tweaks
This commit is contained in:
@@ -196,16 +196,16 @@ namespace RageCoop.Client
|
||||
}
|
||||
if (Networking.IsOnServer)
|
||||
{
|
||||
if (Sync.Voice.WasInitialized())
|
||||
if (Voice.WasInitialized())
|
||||
{
|
||||
if (Game.IsControlPressed(GTA.Control.PushToTalk))
|
||||
{
|
||||
Sync.Voice.StartRecording();
|
||||
Voice.StartRecording();
|
||||
return;
|
||||
}
|
||||
else if (Sync.Voice.IsRecording())
|
||||
else if (Voice.IsRecording())
|
||||
{
|
||||
Sync.Voice.StopRecording();
|
||||
Voice.StopRecording();
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -280,7 +280,7 @@ namespace RageCoop.Client
|
||||
public static void CleanUp()
|
||||
{
|
||||
MainChat.Clear();
|
||||
Sync.Voice.ClearAll();
|
||||
Voice.ClearAll();
|
||||
EntityPool.Cleanup();
|
||||
PlayerList.Cleanup();
|
||||
LocalPlayerID=default;
|
||||
|
||||
@@ -49,12 +49,12 @@ namespace RageCoop.Client.Menus
|
||||
{
|
||||
if (_disableVoice.Checked)
|
||||
{
|
||||
if (Networking.IsOnServer && !Sync.Voice.WasInitialized())
|
||||
if (Networking.IsOnServer && !Voice.WasInitialized())
|
||||
{
|
||||
Sync.Voice.Init();
|
||||
Voice.Init();
|
||||
}
|
||||
} else {
|
||||
Sync.Voice.ClearAll();
|
||||
Voice.ClearAll();
|
||||
}
|
||||
|
||||
Main.Settings.Voice = _disableVoice.Checked;
|
||||
|
||||
@@ -77,9 +77,9 @@ namespace RageCoop.Client
|
||||
{
|
||||
CoopMenu.ConnectedMenuSetting();
|
||||
Main.MainChat.Init();
|
||||
if (Main.Settings.Voice && !Sync.Voice.WasInitialized())
|
||||
if (Main.Settings.Voice && !Voice.WasInitialized())
|
||||
{
|
||||
Sync.Voice.Init();
|
||||
Voice.Init();
|
||||
}
|
||||
GTA.UI.Notification.Show("~g~Connected!");
|
||||
});
|
||||
@@ -270,14 +270,12 @@ namespace RageCoop.Client
|
||||
Packets.Voice packet = new Packets.Voice();
|
||||
packet.Deserialize(data);
|
||||
|
||||
Main.QueueAction(() =>
|
||||
{
|
||||
SyncedPed player = EntityPool.GetPedByID(packet.ID);
|
||||
player.IsSpeaking = true;
|
||||
player.LastSpeakingTime = Main.Ticked;
|
||||
|
||||
Sync.Voice.AddVoiceData(packet.Buffer, packet.Recorded);
|
||||
});
|
||||
SyncedPed player = EntityPool.GetPedByID(packet.ID);
|
||||
player.IsSpeaking = true;
|
||||
player.LastSpeakingTime = Main.Ticked;
|
||||
|
||||
Voice.AddVoiceData(packet.Buffer, packet.Recorded);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
using NAudio.Wave;
|
||||
|
||||
namespace RageCoop.Client.Sync
|
||||
namespace RageCoop.Client
|
||||
{
|
||||
internal static class Voice
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user