rename VRCX to AppApi

This commit is contained in:
pypy
2020-11-08 15:15:12 +09:00
parent 16fdca179b
commit 3bb78cc858
5 changed files with 20 additions and 19 deletions
+4 -4
View File
@@ -14,13 +14,13 @@ using System.Windows.Forms;
namespace VRCX namespace VRCX
{ {
public class VRCX public class AppApi
{ {
public static VRCX Instance { get; private set; } public static AppApi Instance { get; private set; }
static VRCX() static AppApi()
{ {
Instance = new VRCX(); Instance = new AppApi();
} }
public void ShowDevTools() public void ShowDevTools()
+1 -1
View File
@@ -7,7 +7,7 @@ namespace VRCX
public static void ApplyJavascriptBindings(IJavascriptObjectRepository repository) public static void ApplyJavascriptBindings(IJavascriptObjectRepository repository)
{ {
repository.NameConverter = null; repository.NameConverter = null;
repository.Register("VRCX", VRCX.Instance, true); repository.Register("AppApi", AppApi.Instance, true);
repository.Register("SharedVariable", SharedVariable.Instance, false); repository.Register("SharedVariable", SharedVariable.Instance, false);
repository.Register("WebApi", WebApi.Instance, true); repository.Register("WebApi", WebApi.Instance, true);
repository.Register("VRCXStorage", VRCXStorage.Instance, false); repository.Register("VRCXStorage", VRCXStorage.Instance, false);
+1 -1
View File
@@ -153,7 +153,7 @@
<Compile Include="Properties\AssemblyInfo.cs" /> <Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="LogWatcher.cs" /> <Compile Include="LogWatcher.cs" />
<Compile Include="VRChatRPC.cs" /> <Compile Include="VRChatRPC.cs" />
<Compile Include="VRCX.cs" /> <Compile Include="AppApi.cs" />
<Compile Include="VRCXStorage.cs" /> <Compile Include="VRCXStorage.cs" />
<Compile Include="JsonSerializer.cs" /> <Compile Include="JsonSerializer.cs" />
<Compile Include="WinApi.cs" /> <Compile Include="WinApi.cs" />
+11 -10
View File
@@ -18,8 +18,8 @@ import gameLogService from './service/gamelog.js'
(async function () { (async function () {
await CefSharp.BindObjectAsync( await CefSharp.BindObjectAsync(
'AppApi',
'WebApi', 'WebApi',
'VRCX',
'SharedVariable', 'SharedVariable',
'VRCXStorage', 'VRCXStorage',
'SQLite', 'SQLite',
@@ -59,7 +59,7 @@ import gameLogService from './service/gamelog.js'
document.addEventListener('keyup', function (e) { document.addEventListener('keyup', function (e) {
if (e.ctrlKey) { if (e.ctrlKey) {
if (e.shiftKey && e.code === 'KeyI') { if (e.shiftKey && e.code === 'KeyI') {
VRCX.ShowDevTools(); AppApi.ShowDevTools();
} else if (e.code === 'KeyR') { } else if (e.code === 'KeyR') {
location.reload(); location.reload();
} }
@@ -3138,6 +3138,7 @@ import gameLogService from './service/gamelog.js'
try { try {
var json = JSON.parse(data); var json = JSON.parse(data);
json.content = JSON.parse(json.content); json.content = JSON.parse(json.content);
console.log('WebSocket', json);
this.$emit('PIPELINE', { this.$emit('PIPELINE', {
json json
}); });
@@ -3323,7 +3324,7 @@ import gameLogService from './service/gamelog.js'
type: 'info', type: 'info',
callback: (action) => { callback: (action) => {
if (action === 'confirm') { if (action === 'confirm') {
VRCX.OpenLink(link); AppApi.OpenLink(link);
} }
} }
}); });
@@ -3357,7 +3358,7 @@ import gameLogService from './service/gamelog.js'
text: `Update available!!<br>${this.latestAppVersion}`, text: `Update available!!<br>${this.latestAppVersion}`,
timeout: 60000, timeout: 60000,
callbacks: { callbacks: {
onClick: () => VRCX.OpenLink('https://github.com/pypy-vrc/VRCX/releases') onClick: () => AppApi.OpenLink('https://github.com/pypy-vrc/VRCX/releases')
} }
}).show(); }).show();
this.notifyMenu('more'); this.notifyMenu('more');
@@ -3391,7 +3392,7 @@ import gameLogService from './service/gamelog.js'
}); });
} }
this.checkActiveFriends(); this.checkActiveFriends();
VRCX.CheckGameRunning().then(([isGameRunning, isGameNoVR]) => { AppApi.CheckGameRunning().then(([isGameRunning, isGameNoVR]) => {
if (isGameRunning !== this.isGameRunning) { if (isGameRunning !== this.isGameRunning) {
this.isGameRunning = isGameRunning; this.isGameRunning = isGameRunning;
Discord.SetTimestamps(Date.now(), 0); Discord.SetTimestamps(Date.now(), 0);
@@ -3637,7 +3638,7 @@ import gameLogService from './service/gamelog.js'
$app.methods.loginWithSteam = function () { $app.methods.loginWithSteam = function () {
if (!this.loginForm.loading) { if (!this.loginForm.loading) {
this.loginForm.loading = true; this.loginForm.loading = true;
VRCX.LoginWithSteam().catch((err) => { AppApi.LoginWithSteam().catch((err) => {
this.loginForm.loading = false; this.loginForm.loading = false;
throw err; throw err;
}).then((steamTicket) => { }).then((steamTicket) => {
@@ -5576,7 +5577,7 @@ import gameLogService from './service/gamelog.js'
configRepository.setBool('VRCX_StartAtWindowsStartup', this.isStartAtWindowsStartup); configRepository.setBool('VRCX_StartAtWindowsStartup', this.isStartAtWindowsStartup);
configRepository.setBool('VRCX_StartAsMinimizedState', this.isStartAsMinimizedState); configRepository.setBool('VRCX_StartAsMinimizedState', this.isStartAsMinimizedState);
configRepository.setBool('VRCX_CloseToTray', this.isCloseToTray); configRepository.setBool('VRCX_CloseToTray', this.isCloseToTray);
VRCX.SetStartup(this.isStartAtWindowsStartup); AppApi.SetStartup(this.isStartAtWindowsStartup);
}; };
$app.watch.isStartAtWindowsStartup = saveVRCXWindowOption; $app.watch.isStartAtWindowsStartup = saveVRCXWindowOption;
$app.watch.isStartAsMinimizedState = saveVRCXWindowOption; $app.watch.isStartAsMinimizedState = saveVRCXWindowOption;
@@ -5635,9 +5636,9 @@ import gameLogService from './service/gamelog.js'
if (this.openVR && if (this.openVR &&
this.isGameNoVR === false && this.isGameNoVR === false &&
(this.isGameRunning || this.openVRAlways)) { (this.isGameRunning || this.openVRAlways)) {
VRCX.StartVR(); AppApi.StartVR();
} else { } else {
VRCX.StopVR(); AppApi.StopVR();
} }
}; };
@@ -7337,7 +7338,7 @@ import gameLogService from './service/gamelog.js'
if (D.desktop === true) { if (D.desktop === true) {
args.push('--no-vr'); args.push('--no-vr');
} }
VRCX.StartGame(args.join(' ')); AppApi.StartGame(args.join(' '));
D.visible = false; D.visible = false;
}; };
+3 -3
View File
@@ -15,8 +15,8 @@ import webApiService from './service/webapi.js';
(async function () { (async function () {
await CefSharp.BindObjectAsync( await CefSharp.BindObjectAsync(
'AppApi',
'WebApi', 'WebApi',
'VRCX',
'SharedVariable', 'SharedVariable',
'SQLite' 'SQLite'
); );
@@ -616,7 +616,7 @@ import webApiService from './service/webapi.js';
this.currentTime = new Date().toJSON(); this.currentTime = new Date().toJSON();
this.currentUserStatus = sharedRepository.getString('current_user_status'); this.currentUserStatus = sharedRepository.getString('current_user_status');
if (configRepository.getBool('VRCX_hideDevicesFromFeed') === false) { if (configRepository.getBool('VRCX_hideDevicesFromFeed') === false) {
VRCX.GetVRDevices().then((devices) => { AppApi.GetVRDevices().then((devices) => {
devices.forEach((device) => { devices.forEach((device) => {
device[2] = parseInt(device[2], 10); device[2] = parseInt(device[2], 10);
}); });
@@ -635,7 +635,7 @@ import webApiService from './service/webapi.js';
$app.methods.updateCpuUsageLoop = async function () { $app.methods.updateCpuUsageLoop = async function () {
try { try {
var cpuUsage = await VRCX.CpuUsage(); var cpuUsage = await AppApi.CpuUsage();
this.cpuUsage = cpuUsage.toFixed(2); this.cpuUsage = cpuUsage.toFixed(2);
} catch (err) { } catch (err) {
console.error(err); console.error(err);