diff --git a/Dotnet/AppApi/AppApi.cs b/Dotnet/AppApi/AppApi.cs index d736e258..db40ee02 100644 --- a/Dotnet/AppApi/AppApi.cs +++ b/Dotnet/AppApi/AppApi.cs @@ -603,5 +603,10 @@ namespace VRCX return await ImageCache.SaveImageToFile(url, filePath); } + + public bool IsRunningUnderWine() + { + return Wine.GetIfWine(); + } } } \ No newline at end of file diff --git a/Dotnet/AppApi/AppApiVr.cs b/Dotnet/AppApi/AppApiVr.cs index c2051365..d2385fb0 100644 --- a/Dotnet/AppApi/AppApiVr.cs +++ b/Dotnet/AppApi/AppApiVr.cs @@ -80,5 +80,10 @@ namespace VRCX output = filePath; return output; } + + public bool IsRunningUnderWine() + { + return Wine.GetIfWine(); + } } } \ No newline at end of file diff --git a/Dotnet/AppApi/GameHandler.cs b/Dotnet/AppApi/GameHandler.cs index 1ca86af9..47b4ebe9 100644 --- a/Dotnet/AppApi/GameHandler.cs +++ b/Dotnet/AppApi/GameHandler.cs @@ -26,6 +26,11 @@ namespace VRCX { var isGameRunning = false; var isSteamVRRunning = false; + + if (ProcessMonitor.Instance.IsProcessRunning("VRChat")) + { + isGameRunning = true; + } if (Wine.GetIfWine()) { @@ -39,13 +44,6 @@ namespace VRCX } } } - else - { - if (ProcessMonitor.Instance.IsProcessRunning("VRChat")) - { - isGameRunning = true; - } - } if (ProcessMonitor.Instance.IsProcessRunning("vrserver")) { diff --git a/Dotnet/Overlay/OffScreenBrowser.cs b/Dotnet/Overlay/OffScreenBrowser.cs index 48b5723f..c3aa0768 100644 --- a/Dotnet/Overlay/OffScreenBrowser.cs +++ b/Dotnet/Overlay/OffScreenBrowser.cs @@ -11,6 +11,7 @@ using CefSharp.Structs; using SharpDX.Direct3D11; using System; using System.Threading; +using NLog; using SharpDX.Direct3D; using SharpDX.Mathematics.Interop; using Range = CefSharp.Structs.Range; @@ -24,6 +25,8 @@ namespace VRCX private DeviceMultithread _deviceMultithread; private Query _query; private Texture2D _renderTarget; + + private static readonly Logger logger = LogManager.GetCurrentClassLogger(); public OffScreenBrowser(string address, int width, int height) : base(address, automaticallyCreateBrowser: false) @@ -101,11 +104,20 @@ namespace VRCX if (_device == null) return; - - using Texture2D cefTexture = _device1.OpenSharedResource1(paintInfo.SharedTextureHandle); - _device.ImmediateContext.CopyResource(cefTexture, _renderTarget); - _device.ImmediateContext.End(_query); - _device.ImmediateContext.Flush(); + + try + { + using Texture2D cefTexture = _device1.OpenSharedResource1(paintInfo.SharedTextureHandle); + _device.ImmediateContext.CopyResource(cefTexture, _renderTarget); + _device.ImmediateContext.End(_query); + _device.ImmediateContext.Flush(); + } + catch (Exception e) + { + logger.Error(e); + _device = null; + return; + } RawBool q = _device.ImmediateContext.GetData(_query, AsynchronousFlags.DoNotFlush); diff --git a/Dotnet/Overlay/VRCXVR.cs b/Dotnet/Overlay/VRCXVR.cs index d063f2e0..eae49ec3 100644 --- a/Dotnet/Overlay/VRCXVR.cs +++ b/Dotnet/Overlay/VRCXVR.cs @@ -837,16 +837,16 @@ namespace VRCX public override void ExecuteVrFeedFunction(string function, string json) { if (_wristOverlay == null) return; - if (_wristOverlay.IsLoading) - Restart(); + // if (_wristOverlay.IsLoading) + // Restart(); _wristOverlay.ExecuteScriptAsync($"$app.{function}", json); } public override void ExecuteVrOverlayFunction(string function, string json) { if (_hmdOverlay == null) return; - if (_hmdOverlay.IsLoading) - Restart(); + // if (_hmdOverlay.IsLoading) + // Restart(); _hmdOverlay.ExecuteScriptAsync($"$app.{function}", json); } } diff --git a/html/src/app.js b/html/src/app.js index 0ee6f8a4..2b897f09 100644 --- a/html/src/app.js +++ b/html/src/app.js @@ -128,6 +128,7 @@ speechSynthesis.getVoices(); isGameNoVR: true, isSteamVRRunning: false, isHmdAfk: false, + isRunningUnderWine: false, appVersion: '', latestAppVersion: '', shiftHeld: false @@ -141,6 +142,7 @@ speechSynthesis.getVoices(); el: '#x-app', async mounted() { await this.initLanguage(); + this.isRunningUnderWine = await AppApi.IsRunningUnderWine(); await this.changeThemeMode(); await AppApi.SetUserAgent(); this.appVersion = await AppApi.GetVersion(); @@ -8166,6 +8168,20 @@ speechSynthesis.getVoices(); } this.updateVRConfigVars(); await this.updatetrustColor(); + await this.applyWineEmojis(); + }; + + $app.methods.applyWineEmojis = async function () { + if (document.contains(document.getElementById('app-emoji-font'))) { + document.getElementById('app-emoji-font').remove(); + } + if (this.isRunningUnderWine) { + var $appEmojiFont = document.createElement('link'); + $appEmojiFont.setAttribute('id', 'app-emoji-font'); + $appEmojiFont.rel = 'stylesheet'; + $appEmojiFont.href = 'emoji.font.css'; + document.head.appendChild($appEmojiFont); + } }; $app.data.isStartAtWindowsStartup = await configRepository.getBool( diff --git a/html/src/app.scss b/html/src/app.scss index f1d77a5d..a6fe6b71 100644 --- a/html/src/app.scss +++ b/html/src/app.scss @@ -131,7 +131,7 @@ input, textarea, select, button { - font-family: 'Noto Sans JP', 'Noto Sans KR', 'Noto Sans TC', 'Noto Sans SC', 'Noto Color Emoji', + font-family: 'Noto Sans JP', 'Noto Sans KR', 'Noto Sans TC', 'Noto Sans SC', 'Meiryo UI', 'Malgun Gothic', 'Segoe UI', sans-serif; line-height: normal; } diff --git a/html/src/classes/updateLoop.js b/html/src/classes/updateLoop.js index 6be586f6..5c797b02 100644 --- a/html/src/classes/updateLoop.js +++ b/html/src/classes/updateLoop.js @@ -23,7 +23,7 @@ export default class extends baseClass { nextClearVRCXCacheCheck: 0, nextDiscordUpdate: 0, nextAutoStateChange: 0, - nextGameRunningCheck: 0, + nextGameRunningCheck: 0 }; _methods = { @@ -76,7 +76,10 @@ export default class extends baseClass { this.nextAutoStateChange = 3; this.updateAutoStateChange(); } - if (--this.nextGameRunningCheck <= 0) { + if ( + this.isRunningUnderWine && + --this.nextGameRunningCheck <= 0 + ) { this.nextGameRunningCheck = 3; AppApi.CheckGameRunning(); } diff --git a/html/src/emoji.font.scss b/html/src/emoji.font.scss new file mode 100644 index 00000000..68e1d27c --- /dev/null +++ b/html/src/emoji.font.scss @@ -0,0 +1,40 @@ +body, +input, +textarea, +select, +button { + font-family: 'Noto Sans JP', 'Noto Sans KR', 'Noto Sans TC', 'Noto Sans SC', + 'Noto Color Emoji', 'Meiryo UI', 'Malgun Gothic', 'Segoe UI', sans-serif; +} + +body { + --md-sys-typescale-headline-medium-font: 'Google Sans', 'Noto Sans', + 'Noto Sans TC', 'Noto Sans JP', 'Noto Sans SC', 'Noto Color Emoji', + 'Roboto', sans-serif; + --md-sys-typescale-headline-small-font: 'Google Sans', 'Noto Sans', + 'Noto Sans TC', 'Noto Sans JP', 'Noto Sans SC', 'Noto Color Emoji', + 'Roboto', sans-serif; + --md-sys-typescale-title-medium-font: 'Google Sans', 'Noto Sans', + 'Noto Sans TC', 'Noto Sans JP', 'Noto Sans SC', 'Noto Color Emoji', + 'Roboto', sans-serif; + --md-sys-typescale-label-large-font: 'Google Sans', 'Noto Sans', + 'Noto Sans TC', 'Noto Sans JP', 'Noto Sans SC', 'Noto Color Emoji', + 'Roboto', sans-serif; + --md-sys-typescale-label-medium-font: 'Google Sans', 'Noto Sans', + 'Noto Sans TC', 'Noto Sans JP', 'Noto Sans SC', 'Noto Color Emoji', + 'Roboto', sans-serif; + --md-sys-typescale-body-large-font: 'Google Sans', 'Noto Sans', + 'Noto Sans TC', 'Noto Sans JP', 'Noto Sans SC', 'Noto Color Emoji', + 'Roboto', sans-serif; + --md-sys-typescale-body-medium-font: 'Google Sans', 'Noto Sans', + 'Noto Sans TC', 'Noto Sans JP', 'Noto Sans SC', 'Noto Color Emoji', + 'Roboto', sans-serif; + --md-sys-typescale-body-small-font: 'Google Sans', 'Noto Sans', + 'Noto Sans TC', 'Noto Sans JP', 'Noto Sans SC', 'Noto Color Emoji', + 'Roboto', sans-serif; +} + +:root { + --font: 'Poppins', 'Noto Sans JP', 'Noto Sans KR', 'Noto Sans TC', + 'Noto Sans SC', 'Noto Color Emoji', sans-serif; +} diff --git a/html/src/theme.material3.scss b/html/src/theme.material3.scss index 37e0b2b2..1b26f7a1 100644 --- a/html/src/theme.material3.scss +++ b/html/src/theme.material3.scss @@ -55,49 +55,49 @@ body { ), rgb(var(--md-sys-color-surface)); --md-sys-typescale-headline-medium-font: 'Google Sans', 'Noto Sans', - 'Noto Sans TC', 'Noto Sans JP', 'Noto Sans SC', 'Noto Color Emoji', 'Roboto', sans-serif; + 'Noto Sans TC', 'Noto Sans JP', 'Noto Sans SC', 'Roboto', sans-serif; --md-sys-typescale-headline-medium-line-height: 36px; --md-sys-typescale-headline-medium-size: 28px; --md-sys-typescale-headline-medium-weight: 500; --md-sys-typescale-headline-medium-tracking: 0; --md-sys-typescale-headline-small-font: 'Google Sans', 'Noto Sans', - 'Noto Sans TC', 'Noto Sans JP', 'Noto Sans SC', 'Noto Color Emoji', 'Roboto', sans-serif; + 'Noto Sans TC', 'Noto Sans JP', 'Noto Sans SC', 'Roboto', sans-serif; --md-sys-typescale-headline-small-line-height: 32px; --md-sys-typescale-headline-small-size: 24px; --md-sys-typescale-headline-small-weight: 500; --md-sys-typescale-headline-small-tracking: 0; --md-sys-typescale-title-medium-font: 'Google Sans', 'Noto Sans', - 'Noto Sans TC', 'Noto Sans JP', 'Noto Sans SC', 'Noto Color Emoji', 'Roboto', sans-serif; + 'Noto Sans TC', 'Noto Sans JP', 'Noto Sans SC', 'Roboto', sans-serif; --md-sys-typescale-title-medium-line-height: 24px; --md-sys-typescale-title-medium-size: 16px; --md-sys-typescale-title-medium-weight: 600; --md-sys-typescale-title-medium-tracking: 0.15px; --md-sys-typescale-label-large-font: 'Google Sans', 'Noto Sans', - 'Noto Sans TC', 'Noto Sans JP', 'Noto Sans SC', 'Noto Color Emoji', 'Roboto', sans-serif; + 'Noto Sans TC', 'Noto Sans JP', 'Noto Sans SC', 'Roboto', sans-serif; --md-sys-typescale-label-large-line-height: 20px; --md-sys-typescale-label-large-size: 14px; --md-sys-typescale-label-large-weight: 600; --md-sys-typescale-label-large-tracking: 0.1px; --md-sys-typescale-label-medium-font: 'Google Sans', 'Noto Sans', - 'Noto Sans TC', 'Noto Sans JP', 'Noto Sans SC', 'Noto Color Emoji', 'Roboto', sans-serif; + 'Noto Sans TC', 'Noto Sans JP', 'Noto Sans SC', 'Roboto', sans-serif; --md-sys-typescale-label-medium-line-height: 16px; --md-sys-typescale-label-medium-size: 12px; --md-sys-typescale-label-medium-weight: 600; --md-sys-typescale-label-medium-tracking: 0.5px; --md-sys-typescale-body-large-font: 'Google Sans', 'Noto Sans', - 'Noto Sans TC', 'Noto Sans JP', 'Noto Sans SC', 'Noto Color Emoji', 'Roboto', sans-serif; + 'Noto Sans TC', 'Noto Sans JP', 'Noto Sans SC', 'Roboto', sans-serif; --md-sys-typescale-body-large-line-height: 24px; --md-sys-typescale-body-large-size: 16px; --md-sys-typescale-body-large-weight: 400; --md-sys-typescale-body-large-tracking: 0.5px; --md-sys-typescale-body-medium-font: 'Google Sans', 'Noto Sans', - 'Noto Sans TC', 'Noto Sans JP', 'Noto Sans SC', 'Noto Color Emoji', 'Roboto', sans-serif; + 'Noto Sans TC', 'Noto Sans JP', 'Noto Sans SC', 'Roboto', sans-serif; --md-sys-typescale-body-medium-line-height: 20px; --md-sys-typescale-body-medium-size: 14px; --md-sys-typescale-body-medium-weight: 400; --md-sys-typescale-body-medium-tracking: 0.25px; --md-sys-typescale-body-small-font: 'Google Sans', 'Noto Sans', - 'Noto Sans TC', 'Noto Sans JP', 'Noto Sans SC', 'Noto Color Emoji', 'Roboto', sans-serif; + 'Noto Sans TC', 'Noto Sans JP', 'Noto Sans SC', 'Roboto', sans-serif; --md-sys-typescale-body-small-line-height: 16px; --md-sys-typescale-body-small-size: 12px; --md-sys-typescale-body-small-weight: 400; diff --git a/html/src/theme.pink.scss b/html/src/theme.pink.scss index 5868ed4d..7e74af41 100644 --- a/html/src/theme.pink.scss +++ b/html/src/theme.pink.scss @@ -14,7 +14,7 @@ --lighter-lighter-lighter-lighter-bg: #857070; --lighter-border: #aa6065; --font: 'Poppins', 'Noto Sans JP', 'Noto Sans KR', 'Noto Sans TC', - 'Noto Sans SC', 'Noto Color Emoji', sans-serif; + 'Noto Sans SC', sans-serif; } body, button, diff --git a/html/src/vr.js b/html/src/vr.js index 3d0d1add..76f02860 100644 --- a/html/src/vr.js +++ b/html/src/vr.js @@ -131,6 +131,7 @@ Vue.component('marquee-text', MarqueeText); appType: location.href.substr(-1), appLanguage: 'en', currentCulture: 'en-nz', + isRunningUnderWine: false, currentTime: new Date().toJSON(), cpuUsageEnabled: false, cpuUsage: 0, @@ -169,7 +170,9 @@ Vue.component('marquee-text', MarqueeText); }, watch: {}, el: '#x-app', - mounted() { + async mounted() { + this.isRunningUnderWine = await AppApiVr.IsRunningUnderWine(); + await this.applyWineEmojis(); workerTimers.setTimeout(() => AppApiVr.VrInit(), 5000); if (this.appType === '1') { this.refreshCustomScript(); @@ -658,6 +661,19 @@ Vue.component('marquee-text', MarqueeText); } }; + $app.methods.applyWineEmojis = async function () { + if (document.contains(document.getElementById('app-emoji-font'))) { + document.getElementById('app-emoji-font').remove(); + } + if (this.isRunningUnderWine) { + var $appEmojiFont = document.createElement('link'); + $appEmojiFont.setAttribute('id', 'app-emoji-font'); + $appEmojiFont.rel = 'stylesheet'; + $appEmojiFont.href = 'emoji.font.css'; + document.head.appendChild($appEmojiFont); + } + }; + $app.methods.trackingResultToClass = function (deviceStatus) { switch (deviceStatus) { case 'Uninitialized': diff --git a/html/src/vr.pug b/html/src/vr.pug index bfc9967c..50df7fa4 100644 --- a/html/src/vr.pug +++ b/html/src/vr.pug @@ -59,7 +59,7 @@ html span.extra span.time {{ feed.created_at | formatDate }} span.spin ▶️ - span.name(v-text="feed.displayName" style="margin-left:20px") + span.name(v-text="feed.displayName" style="margin-left:30px") div(v-else-if="feed.type === 'Location'" class="x-friend-item" :class="{ friend: feed.isFriend, favorite: feed.isFavorite }") .detail span.extra diff --git a/html/src/vr.scss b/html/src/vr.scss index c16b8636..ee34f954 100644 --- a/html/src/vr.scss +++ b/html/src/vr.scss @@ -175,7 +175,7 @@ input, textarea, select, button { - font-family: 'Noto Sans JP', 'Noto Sans KR', 'Noto Sans TC', 'Noto Sans SC', 'Noto Color Emoji', + font-family: 'Noto Sans JP', 'Noto Sans KR', 'Noto Sans TC', 'Noto Sans SC', 'Meiryo UI', 'Malgun Gothic', 'Segoe UI', sans-serif; line-height: normal; text-shadow: @@ -350,8 +350,8 @@ i.x-user-status.busy { .spin { animation: rotation 2.5s infinite linear; position: absolute; - width: 14px; - height: 28px; + width: 24px; + height: 30px; } @keyframes rotation { diff --git a/html/webpack.config.js b/html/webpack.config.js index d82c8437..9a8f6eb8 100644 --- a/html/webpack.config.js +++ b/html/webpack.config.js @@ -24,6 +24,7 @@ module.exports = { 'theme.material3': './src/theme.material3.scss', flags: './src/flags.scss', 'animated-emoji': './src/animated-emoji.scss', + 'emoji.font': './src/emoji.font.scss', vr: { import: ['./src/vr.js', './src/vr.scss'], dependOn: 'vendor'