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:
Natsumi
2026-01-12 11:31:10 +13:00
committed by Natsumi
parent 9135adf6d1
commit d2fd205476
41 changed files with 1122 additions and 2108 deletions
+3 -3
View File
@@ -853,11 +853,11 @@ export const useFriendStore = defineStore('Friend', () => {
reconnectWebSocket();
}
function updateOnlineFriendCounter() {
function updateOnlineFriendCounter(forceUpdate = false) {
const onlineFriendCounts =
vipFriends.value.length + onlineFriends.value.length;
if (onlineFriendCounts !== onlineFriendCount.value) {
AppApi.ExecuteVrFeedFunction(
if (onlineFriendCounts !== onlineFriendCount.value || forceUpdate) {
AppApi.ExecuteVrOverlayFunction(
'updateOnlineFriendCount',
`${onlineFriendCounts}`
);
+9 -8
View File
@@ -146,11 +146,7 @@ export const useGameStore = defineStore('Game', () => {
}
// use in C#
async function updateIsGameRunning(
isGameRunningArg,
isSteamVRRunningArg,
isHmdAfkArg
) {
async function updateIsGameRunning(isGameRunningArg, isSteamVRRunningArg) {
const avatarStore = useAvatarStore();
if (advancedSettingsStore.gameLogDisabled) {
return;
@@ -186,11 +182,15 @@ export const useGameStore = defineStore('Game', () => {
isSteamVRRunning.value = isSteamVRRunningArg;
console.log('isSteamVRRunning:', isSteamVRRunningArg);
}
vrStore.updateOpenVR();
}
// use in C#
function updateIsHmdAfk(isHmdAfkArg) {
if (isHmdAfkArg !== isHmdAfk.value) {
isHmdAfk.value = isHmdAfkArg;
console.log('isHmdAfk:', isHmdAfkArg);
console.log('isHmdAfk', isHmdAfkArg);
}
vrStore.updateOpenVR();
}
async function checkVRChatDebugLogging() {
@@ -258,6 +258,7 @@ export const useGameStore = defineStore('Game', () => {
getVRChatCacheSize,
updateIsGameRunning,
getVRChatRegistryKey,
checkVRChatDebugLogging
checkVRChatDebugLogging,
updateIsHmdAfk
};
});
+1 -1
View File
@@ -233,7 +233,7 @@ export const useSharedFeedStore = defineStore('SharedFeed', () => {
}
}
}
AppApi.ExecuteVrFeedFunction(
AppApi.ExecuteVrOverlayFunction(
'wristFeedUpdate',
JSON.stringify(wristFeed)
);
+1 -2
View File
@@ -131,8 +131,7 @@ export const useUpdateLoopStore = defineStore('UpdateLoop', () => {
state.nextGameRunningCheck = 1;
gameStore.updateIsGameRunning(
await AppApi.IsGameRunning(),
await AppApi.IsSteamVRRunning(),
false
await AppApi.IsSteamVRRunning()
);
vrStore.vrInit(); // TODO: make this event based
}
+4 -5
View File
@@ -45,8 +45,7 @@ export const useVrStore = defineStore('Vr', () => {
updateVrNowPlaying();
// run these methods again to send data to the overlay
sharedFeedStore.updateSharedFeed(true);
friendStore.onlineFriendCount = 0; // force an update
friendStore.updateOnlineFriendCounter();
friendStore.updateOnlineFriendCounter(true); // force an update
}
async function saveOpenVROption() {
@@ -59,7 +58,6 @@ export const useVrStore = defineStore('Vr', () => {
function updateVrNowPlaying() {
const json = JSON.stringify(gameLogStore.nowPlaying);
AppApi.ExecuteVrFeedFunction('nowPlayingUpdate', json);
AppApi.ExecuteVrOverlayFunction('nowPlayingUpdate', json);
}
@@ -91,7 +89,6 @@ export const useVrStore = defineStore('Vr', () => {
onlineFor
};
const json = JSON.stringify(lastLocation);
AppApi.ExecuteVrFeedFunction('lastLocationUpdate', json);
AppApi.ExecuteVrOverlayFunction('lastLocationUpdate', json);
}
@@ -142,7 +139,6 @@ export const useVrStore = defineStore('Vr', () => {
/** @type {string} */
const json = JSON.stringify(VRConfigVars);
AppApi.ExecuteVrFeedFunction('configUpdate', json);
AppApi.ExecuteVrOverlayFunction('configUpdate', json);
}
@@ -185,6 +181,9 @@ export const useVrStore = defineStore('Vr', () => {
newState.menuButton,
newState.overlayHand
);
if (!newState.active) {
gameStore.updateIsHmdAfk(false);
}
if (LINUX) {
window.electron.updateVr(