mirror of
https://github.com/MrUnknownDE/VRCX.git
synced 2026-04-28 19:23:47 +02:00
Merge overlays, move overlay to separate process (#44)
* refactor: merge two overlay offScreenBrowser into one * Electron support for shared overlay * Separate overlay into its own process * fix: invalid overlay texture size * Handle duplicate processes * Remove logging --------- Co-authored-by: pa <maplenagisa@gmail.com> Co-authored-by: rs189 <35667100+rs189@users.noreply.github.com>
This commit is contained in:
@@ -7,6 +7,7 @@ using System.Globalization;
|
||||
using System.IO;
|
||||
using System.Security.Cryptography;
|
||||
using System.Text;
|
||||
using System.Text.Json;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
@@ -31,17 +32,15 @@ namespace VRCX
|
||||
|
||||
public override void SetVR(bool active, bool hmdOverlay, bool wristOverlay, bool menuButton, int overlayHand)
|
||||
{
|
||||
Program.VRCXVRInstance.SetActive(active, hmdOverlay, wristOverlay, menuButton, overlayHand);
|
||||
}
|
||||
|
||||
public override void RefreshVR()
|
||||
{
|
||||
Program.VRCXVRInstance.Restart();
|
||||
}
|
||||
|
||||
public override void RestartVR()
|
||||
{
|
||||
Program.VRCXVRInstance.Restart();
|
||||
var updateVars = new OverlayVars
|
||||
{
|
||||
Active = active,
|
||||
HmdOverlay = hmdOverlay,
|
||||
WristOverlay = wristOverlay,
|
||||
MenuButton = menuButton,
|
||||
OverlayHand = overlayHand
|
||||
};
|
||||
OverlayServer.Instance.UpdateVars(updateVars);
|
||||
}
|
||||
|
||||
public override void SetZoom(double zoomLevel)
|
||||
@@ -116,14 +115,15 @@ namespace VRCX
|
||||
return File.Exists(Path.Join(Program.AppDataDirectory, "update.exe"));
|
||||
}
|
||||
|
||||
public override void ExecuteVrFeedFunction(string function, string json)
|
||||
{
|
||||
Program.VRCXVRInstance.ExecuteVrFeedFunction(function, json);
|
||||
}
|
||||
|
||||
public override void ExecuteVrOverlayFunction(string function, string json)
|
||||
{
|
||||
Program.VRCXVRInstance.ExecuteVrOverlayFunction(function, json);
|
||||
var message = new OverlayMessage
|
||||
{
|
||||
Type = OverlayMessageType.JsFunctionCall,
|
||||
FunctionName = function,
|
||||
Data = json
|
||||
};
|
||||
OverlayServer.Instance.SendMessage(message);
|
||||
}
|
||||
|
||||
public override void FocusWindow()
|
||||
|
||||
Reference in New Issue
Block a user