mirror of
https://github.com/MrUnknownDE/VRCX.git
synced 2026-04-19 14:53:50 +02:00
Touch ups
This commit is contained in:
45
src/app.js
45
src/app.js
@@ -185,10 +185,6 @@ console.log(`isLinux: ${LINUX}`);
|
|||||||
this.checkForVRCXUpdate();
|
this.checkForVRCXUpdate();
|
||||||
}
|
}
|
||||||
await AppApi.CheckGameRunning();
|
await AppApi.CheckGameRunning();
|
||||||
this.isSidebarGroupByInstance =
|
|
||||||
(await configRepository.getBool(
|
|
||||||
'VRCX_sidebarGroupByInstance'
|
|
||||||
)) ?? true;
|
|
||||||
this.isGameNoVR = await configRepository.getBool('isGameNoVR');
|
this.isGameNoVR = await configRepository.getBool('isGameNoVR');
|
||||||
await AppApi.SetAppLauncherSettings(
|
await AppApi.SetAppLauncherSettings(
|
||||||
this.enableAppLauncher,
|
this.enableAppLauncher,
|
||||||
@@ -3785,6 +3781,7 @@ console.log(`isLinux: ${LINUX}`);
|
|||||||
if (isGameRunning) {
|
if (isGameRunning) {
|
||||||
API.currentUser.$online_for = Date.now();
|
API.currentUser.$online_for = Date.now();
|
||||||
API.currentUser.$offline_for = '';
|
API.currentUser.$offline_for = '';
|
||||||
|
API.currentUser.$previousAvatarSwapTime = Date.now();
|
||||||
} else {
|
} else {
|
||||||
await configRepository.setBool('isGameNoVR', this.isGameNoVR);
|
await configRepository.setBool('isGameNoVR', this.isGameNoVR);
|
||||||
API.currentUser.$online_for = '';
|
API.currentUser.$online_for = '';
|
||||||
@@ -3793,6 +3790,8 @@ console.log(`isLinux: ${LINUX}`);
|
|||||||
this.autoVRChatCacheManagement();
|
this.autoVRChatCacheManagement();
|
||||||
this.checkIfGameCrashed();
|
this.checkIfGameCrashed();
|
||||||
this.ipcTimeout = 0;
|
this.ipcTimeout = 0;
|
||||||
|
this.addAvatarWearTime(API.currentUser.currentAvatar);
|
||||||
|
API.currentUser.$previousAvatarSwapTime = '';
|
||||||
}
|
}
|
||||||
this.lastLocationReset();
|
this.lastLocationReset();
|
||||||
this.clearNowPlaying();
|
this.clearNowPlaying();
|
||||||
@@ -3805,13 +3804,6 @@ console.log(`isLinux: ${LINUX}`);
|
|||||||
console.log(new Date(), 'isGameRunning', isGameRunning);
|
console.log(new Date(), 'isGameRunning', isGameRunning);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isGameRunning) {
|
|
||||||
API.currentUser.$previousAvatarSwapTime = Date.now();
|
|
||||||
} else if (API.currentUser.$previousAvatarSwapTime) {
|
|
||||||
this.addAvatarWearTime(API.currentUser.currentAvatar);
|
|
||||||
API.currentUser.$previousAvatarSwapTime = '';
|
|
||||||
}
|
|
||||||
|
|
||||||
if (isSteamVRRunning !== this.isSteamVRRunning) {
|
if (isSteamVRRunning !== this.isSteamVRRunning) {
|
||||||
this.isSteamVRRunning = isSteamVRRunning;
|
this.isSteamVRRunning = isSteamVRRunning;
|
||||||
console.log('isSteamVRRunning:', isSteamVRRunning);
|
console.log('isSteamVRRunning:', isSteamVRRunning);
|
||||||
@@ -12173,7 +12165,16 @@ console.log(`isLinux: ${LINUX}`);
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
database.getAvatarTimeSpent(avatarId).then((aviTime) => {
|
database.getAvatarTimeSpent(avatarId).then((aviTime) => {
|
||||||
D.timeSpent = aviTime.timeSpent;
|
if (D.id === aviTime.avatarId) {
|
||||||
|
D.timeSpent = aviTime.timeSpent;
|
||||||
|
if (
|
||||||
|
D.id === API.currentUser.currentAvatar &&
|
||||||
|
API.currentUser.$previousAvatarSwapTime
|
||||||
|
) {
|
||||||
|
D.timeSpent +=
|
||||||
|
Date.now() - API.currentUser.$previousAvatarSwapTime;
|
||||||
|
}
|
||||||
|
}
|
||||||
});
|
});
|
||||||
API.getAvatar({ avatarId })
|
API.getAvatar({ avatarId })
|
||||||
.then((args) => {
|
.then((args) => {
|
||||||
@@ -19870,8 +19871,12 @@ console.log(`isLinux: ${LINUX}`);
|
|||||||
var historyArray = await database.getAvatarHistory(API.currentUser.id);
|
var historyArray = await database.getAvatarHistory(API.currentUser.id);
|
||||||
this.avatarHistoryArray = historyArray;
|
this.avatarHistoryArray = historyArray;
|
||||||
for (var i = 0; i < historyArray.length; i++) {
|
for (var i = 0; i < historyArray.length; i++) {
|
||||||
this.avatarHistory.add(historyArray[i].id);
|
var avatar = historyArray[i];
|
||||||
API.applyAvatar(historyArray[i]);
|
if (avatar.authorId === API.currentUser.id) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
this.avatarHistory.add(avatar.id);
|
||||||
|
API.applyAvatar(avatar);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -19899,9 +19904,12 @@ console.log(`isLinux: ${LINUX}`);
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
$app.methods.addAvatarWearTime = function (avatar) {
|
$app.methods.addAvatarWearTime = function (avatarId) {
|
||||||
|
if (!API.currentUser.$previousAvatarSwapTime || !avatarId) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
const timeSpent = Date.now() - API.currentUser.$previousAvatarSwapTime;
|
const timeSpent = Date.now() - API.currentUser.$previousAvatarSwapTime;
|
||||||
database.addAvatarTimeSpent(avatar, timeSpent);
|
database.addAvatarTimeSpent(avatarId, timeSpent);
|
||||||
};
|
};
|
||||||
|
|
||||||
$app.methods.promptClearAvatarHistory = function () {
|
$app.methods.promptClearAvatarHistory = function () {
|
||||||
@@ -23124,7 +23132,10 @@ console.log(`isLinux: ${LINUX}`);
|
|||||||
// friendsListSidebar
|
// friendsListSidebar
|
||||||
// - SidebarGroupByInstance
|
// - SidebarGroupByInstance
|
||||||
|
|
||||||
$app.data.isSidebarGroupByInstance = true;
|
$app.data.isSidebarGroupByInstance = await configRepository.getBool(
|
||||||
|
'VRCX_sidebarGroupByInstance',
|
||||||
|
true
|
||||||
|
);
|
||||||
$app.computed.onlineFriendsInSameInstance = function () {
|
$app.computed.onlineFriendsInSameInstance = function () {
|
||||||
const groupedItems = {};
|
const groupedItems = {};
|
||||||
|
|
||||||
|
|||||||
@@ -165,8 +165,10 @@ export default class extends baseClass {
|
|||||||
if (this.isLoggedIn) {
|
if (this.isLoggedIn) {
|
||||||
if (json.currentAvatar !== ref.currentAvatar) {
|
if (json.currentAvatar !== ref.currentAvatar) {
|
||||||
$app.addAvatarToHistory(json.currentAvatar);
|
$app.addAvatarToHistory(json.currentAvatar);
|
||||||
$app.addAvatarWearTime(ref.currentAvatar);
|
if ($app.isGameRunning) {
|
||||||
this.currentUser.$previousAvatarSwapTime = Date.now();
|
$app.addAvatarWearTime(ref.currentAvatar);
|
||||||
|
ref.$previousAvatarSwapTime = Date.now();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
Object.assign(ref, json);
|
Object.assign(ref, json);
|
||||||
if (ref.homeLocation !== ref.$homeLocation.tag) {
|
if (ref.homeLocation !== ref.$homeLocation.tag) {
|
||||||
@@ -278,7 +280,7 @@ export default class extends baseClass {
|
|||||||
$offline_for: '',
|
$offline_for: '',
|
||||||
$location_at: Date.now(),
|
$location_at: Date.now(),
|
||||||
$travelingToTime: Date.now(),
|
$travelingToTime: Date.now(),
|
||||||
$previousAvatarSwapTime: Date.now(),
|
$previousAvatarSwapTime: '',
|
||||||
$homeLocation: {},
|
$homeLocation: {},
|
||||||
$isVRCPlus: false,
|
$isVRCPlus: false,
|
||||||
$isModerator: false,
|
$isModerator: false,
|
||||||
@@ -294,6 +296,9 @@ export default class extends baseClass {
|
|||||||
$vrchatcredits: null,
|
$vrchatcredits: null,
|
||||||
...json
|
...json
|
||||||
};
|
};
|
||||||
|
if ($app.isGameRunning) {
|
||||||
|
ref.$previousAvatarSwapTime = Date.now();
|
||||||
|
}
|
||||||
ref.$homeLocation = $app.parseLocation(ref.homeLocation);
|
ref.$homeLocation = $app.parseLocation(ref.homeLocation);
|
||||||
ref.$isVRCPlus = ref.tags.includes('system_supporter');
|
ref.$isVRCPlus = ref.tags.includes('system_supporter');
|
||||||
this.applyUserTrustLevel(ref);
|
this.applyUserTrustLevel(ref);
|
||||||
|
|||||||
@@ -104,6 +104,8 @@ mixin avatarDialog()
|
|||||||
.x-friend-item(style="cursor:default")
|
.x-friend-item(style="cursor:default")
|
||||||
.detail
|
.detail
|
||||||
span.name {{ $t('dialog.avatar.info.time_spent') }}
|
span.name {{ $t('dialog.avatar.info.time_spent') }}
|
||||||
|
el-tooltip(v-if="!hideTooltips" placement="top" style="margin-left:5px" :content="$t('dialog.world.info.accuracy_notice')")
|
||||||
|
i.el-icon-warning
|
||||||
span.extra(v-if="avatarDialog.timeSpent === 0") -
|
span.extra(v-if="avatarDialog.timeSpent === 0") -
|
||||||
span.extra(v-else) {{ timeToText(avatarDialog.timeSpent) }}
|
span.extra(v-else) {{ timeToText(avatarDialog.timeSpent) }}
|
||||||
.x-friend-item(style="width:100%;cursor:default")
|
.x-friend-item(style="width:100%;cursor:default")
|
||||||
|
|||||||
@@ -2710,7 +2710,7 @@ class Database {
|
|||||||
const columnExists = dbRow.some((row) => row.name === 'time');
|
const columnExists = dbRow.some((row) => row.name === 'time');
|
||||||
if (!columnExists) {
|
if (!columnExists) {
|
||||||
sqliteService.executeNonQuery(
|
sqliteService.executeNonQuery(
|
||||||
`ALTER TABLE ${Database.userPrefix}_avatar_history ADD COLUMN 'time' INTEGER DEFAULT 0;`
|
`ALTER TABLE ${Database.userPrefix}_avatar_history ADD time INTEGER DEFAULT 0`
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}, `PRAGMA table_info(${Database.userPrefix}_avatar_history);`);
|
}, `PRAGMA table_info(${Database.userPrefix}_avatar_history);`);
|
||||||
|
|||||||
Reference in New Issue
Block a user