From 719a5a2c40e68232259a41a2dcba73eb7731332d Mon Sep 17 00:00:00 2001 From: Bod9001 Date: Thu, 12 Dec 2024 13:37:32 +0000 Subject: [PATCH] adds request for Microphone access (#229) --- .../PipeHubBuildCommunication.cs | 19 +++++++++++++++++++ .../Models/Enums/ClientRequest.cs | 1 + 2 files changed, 20 insertions(+) diff --git a/UnitystationLauncher/GameCommunicationPipe/PipeHubBuildCommunication.cs b/UnitystationLauncher/GameCommunicationPipe/PipeHubBuildCommunication.cs index 5c63d7f..2233d61 100644 --- a/UnitystationLauncher/GameCommunicationPipe/PipeHubBuildCommunication.cs +++ b/UnitystationLauncher/GameCommunicationPipe/PipeHubBuildCommunication.cs @@ -106,6 +106,25 @@ The main purpose of this Prompt is to allow the Variable viewer (Variable editin What follows is given by the build, we do not control what is written in the Following text So treat with caution and use your brain Justification : " + requests[1]); //TODO Add text + string response = await msgBox.ShowAsync(); + Log.Information($"response {response}"); + await _writer.WriteLineAsync(response == "No" ? false.ToString() : true.ToString()); + await _writer.FlushAsync(); + return Task.CompletedTask; + }); + } + else if (ClientRequest.Microphone_Access.ToString() == requests[0]) + { + RxApp.MainThreadScheduler.ScheduleAsync(async (_, _) => + { + IMsBox msgBox = MessageBoxBuilder.CreateMessageBox( + MessageBoxButtons.YesNo, + string.Empty, + $"The build would like to Access your microphone" + @" +Do you allow this application to access your microphone for while it is open +Justification given by the Fork : " + requests[1]); + + string response = await msgBox.ShowAsync(); Log.Information($"response {response}"); await _writer.WriteLineAsync(response == "No" ? false.ToString() : true.ToString()); diff --git a/UnitystationLauncher/Models/Enums/ClientRequest.cs b/UnitystationLauncher/Models/Enums/ClientRequest.cs index fb7f1d7..51407f7 100644 --- a/UnitystationLauncher/Models/Enums/ClientRequest.cs +++ b/UnitystationLauncher/Models/Enums/ClientRequest.cs @@ -5,4 +5,5 @@ internal enum ClientRequest URL = 1, API_URL = 2, Host_Trust_Mode = 3, + Microphone_Access = 4 } \ No newline at end of file