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.Collections.Generic;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using Ryujinx.HLE.UI;
|
using Ryujinx.HLE.UI;
|
||||||
|
using LibRyujinx.Android;
|
||||||
|
|
||||||
namespace LibRyujinx
|
namespace LibRyujinx
|
||||||
{
|
{
|
||||||
@ -657,6 +658,38 @@ namespace LibRyujinx
|
|||||||
|
|
||||||
return paths;
|
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
|
public class SwitchDevice : IDisposable
|
||||||
|
@ -12,6 +12,7 @@
|
|||||||
<EnableTrimAnalyzer>true</EnableTrimAnalyzer>
|
<EnableTrimAnalyzer>true</EnableTrimAnalyzer>
|
||||||
<InvariantGlobalization>true</InvariantGlobalization>
|
<InvariantGlobalization>true</InvariantGlobalization>
|
||||||
<SuppressTrimAnalysisWarnings>false</SuppressTrimAnalysisWarnings>
|
<SuppressTrimAnalysisWarnings>false</SuppressTrimAnalysisWarnings>
|
||||||
|
<IlcInstructionSet>armv8.2-a</IlcInstructionSet>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup Condition="'$(Configuration)'=='Release'">
|
<PropertyGroup Condition="'$(Configuration)'=='Release'">
|
||||||
<Optimize>true</Optimize>
|
<Optimize>true</Optimize>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user