forked from MeloNX/MeloNX
android - add uihandler
This commit is contained in:
parent
4d7356efe0
commit
eac63c756e
@ -35,6 +35,7 @@ using Ryujinx.Common.Logging.Targets;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using Ryujinx.HLE.UI;
|
||||
using LibRyujinx.Android;
|
||||
|
||||
namespace LibRyujinx
|
||||
{
|
||||
@ -657,6 +658,38 @@ namespace LibRyujinx
|
||||
|
||||
return paths;
|
||||
}
|
||||
|
||||
public static void SetupUiHandler()
|
||||
{
|
||||
if (SwitchDevice is { } switchDevice)
|
||||
{
|
||||
switchDevice.HostUiHandler = new AndroidUiHandler();
|
||||
}
|
||||
}
|
||||
|
||||
public static void WaitUiHandler()
|
||||
{
|
||||
if (SwitchDevice?.HostUiHandler is AndroidUiHandler uiHandler)
|
||||
{
|
||||
uiHandler.Wait();
|
||||
}
|
||||
}
|
||||
|
||||
public static void StopUiHandlerWait()
|
||||
{
|
||||
if (SwitchDevice?.HostUiHandler is AndroidUiHandler uiHandler)
|
||||
{
|
||||
uiHandler.Set();
|
||||
}
|
||||
}
|
||||
|
||||
public static void SetUiHandlerResponse(bool isOkPressed, long input)
|
||||
{
|
||||
if (SwitchDevice?.HostUiHandler is AndroidUiHandler uiHandler)
|
||||
{
|
||||
uiHandler.SetResponse(isOkPressed, input);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public class SwitchDevice : IDisposable
|
||||
|
@ -12,6 +12,7 @@
|
||||
<EnableTrimAnalyzer>true</EnableTrimAnalyzer>
|
||||
<InvariantGlobalization>true</InvariantGlobalization>
|
||||
<SuppressTrimAnalysisWarnings>false</SuppressTrimAnalysisWarnings>
|
||||
<IlcInstructionSet>armv8.2-a</IlcInstructionSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)'=='Release'">
|
||||
<Optimize>true</Optimize>
|
||||
|
Reference in New Issue
Block a user