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