v2017.08.17.1

This commit is contained in:
pypy
2019-08-17 21:55:24 +09:00
parent 9eac705d07
commit d725c8f1e3
5 changed files with 176 additions and 116 deletions

View File

@@ -39,13 +39,12 @@ namespace VRCX
}
while (m_Thread != null)
{
if (cpuCounter != null)
{
CpuUsage = cpuCounter.NextValue();
}
try
{
if (cpuCounter != null)
{
CpuUsage = cpuCounter.NextValue();
}
Thread.Sleep(1000);
}
catch

View File

@@ -56,7 +56,7 @@ namespace VRCX
{
MainForm.Instance.BeginInvoke(new MethodInvoker(() =>
{
if (VRForm.Instance==null)
if (VRForm.Instance == null)
{
new VRForm().Show();
}

View File

@@ -207,7 +207,7 @@ body, input, textarea, select, button {
}
.x-friend-item:hover {
background: #eee;
background: #f0f0f0;
border-radius: 2px;
}
@@ -400,14 +400,21 @@ i.x-user-status.busy {
color: rgb(0, 0, 0);
}
.x-dialog .el-tree {
font-size: 12px;
}
.x-dialog .el-tree-node {
.el-tree-node {
white-space: normal;
}
.x-dialog .el-tree-node__content {
.el-tree-node__content {
height: auto;
}
.x-user-dialog .el-textarea__inner {
background: none;
border: 0;
border-radius: 2px;
padding: 0;
}
.x-user-dialog .el-tag+.el-tag {
margin-left: 5px;
}

View File

@@ -803,6 +803,9 @@ if (window.CefSharp) {
if (this.isLoggedIn) {
ctx = this.currentUser;
Object.assign(ctx, ref);
if (ctx.homeLocation_.tag !== ctx.homeLocation) {
ctx.homeLocation_ = this.parseLocation(ctx.homeLocation);
}
} else {
this.isLoggedIn = true;
ctx = {
@@ -828,8 +831,12 @@ if (window.CefSharp) {
onlineFriends: [],
activeFriends: [],
offlineFriends: [],
// custom
homeLocation_: {},
//
...ref
};
ctx.homeLocation_ = this.parseLocation(ctx.homeLocation);
this.currentUser = ctx;
this.$emit('LOGIN', {
json: ref,
@@ -3291,6 +3298,54 @@ if (window.CefSharp) {
: '';
};
var buildTreeData = (json) => {
var node = [];
for (var key in json) {
var value = json[key];
if (typeof value === 'object') {
if (Array.isArray(value)) {
node.push({
children: value.map((val, idx) => {
if (typeof val === 'object') {
return {
children: buildTreeData(val),
key: idx
};
}
return {
key: idx,
value: val
};
}),
key
});
} else {
node.push({
children: buildTreeData(value),
key
});
}
} else {
node.push({
key,
value: String(value)
});
}
}
node.sort((a, b) => {
var A = String(a.key).toUpperCase();
var B = String(b.key).toUpperCase();
if (A < B) {
return -1;
}
if (A > B) {
return 1;
}
return 0;
});
return node;
};
// Misc
var $timers = [];
@@ -3339,7 +3394,7 @@ if (window.CefSharp) {
VRCX,
nextRefresh: 0,
isGameRunning: false,
appVersion: '2019.08.17',
appVersion: '2019.08.17.1',
latestAppVersion: '',
ossDialog: false
},
@@ -3687,6 +3742,23 @@ if (window.CefSharp) {
}
};
$app.methods.loadMemo = function (id) {
return VRCXStorage.Get(`memo_${id}`);
};
$app.methods.saveMemo = function (id, memo) {
var key = `memo_${id}`;
if (memo) {
VRCXStorage.Set(key, String(memo));
} else {
VRCXStorage.Remove(key);
}
var ref = this.friend[id];
if (ref) {
ref.memo = String(memo || '');
}
};
// App: Friends
$app.data.friend = {};
@@ -3814,7 +3886,8 @@ if (window.CefSharp) {
ref,
vip: Boolean(API.favoriteObject[id]),
name: '',
no: ++this.friendNo
no: ++this.friendNo,
memo: this.loadMemo(id)
};
if (ref) {
ctx.name = ref.name;
@@ -4098,6 +4171,10 @@ if (window.CefSharp) {
match = uname.toUpperCase().includes(QUERY) &&
!uname.startsWith('steam_');
}
if (!match &&
ctx.memo) {
match = String(ctx.memo).toUpperCase().includes(QUERY);
}
if (match) {
this.quickSearchItems.push({
value: ctx.id,
@@ -4399,7 +4476,11 @@ if (window.CefSharp) {
});
this.sweepGameLog();
this.updateSharedFeed();
this.notifyMenu('gameLog');
// sweepGameLog로 기록이 삭제되면
// 아무 것도 없는데 알림이 떠서 이상함
if (this.gameLogTable.length) {
this.notifyMenu('gameLog');
}
});
} else {
this.updateSharedFeed();
@@ -5320,6 +5401,7 @@ if (window.CefSharp) {
// App: More
$app.data.currentUserTreeData = [];
$app.data.pastDisplayNameTable = {
data: [],
tableProps: {
@@ -5353,6 +5435,7 @@ if (window.CefSharp) {
$app.watch.openVRAlways = saveOpenVROption;
API.$on('LOGIN', () => {
$app.currentUserTreeData = [];
$app.pastDisplayNameTable.data = [];
});
@@ -5409,6 +5492,10 @@ if (window.CefSharp) {
}
};
$app.methods.refreshCurrentUserTreeData = function () {
this.currentUserTreeData = buildTreeData(API.currentUser);
};
$app.methods.promptUserDialog = function () {
this.$prompt('Enter a User ID (UUID)', 'Direct Access', {
distinguishCancelAndClose: true,
@@ -5474,54 +5561,6 @@ if (window.CefSharp) {
}
};
var buildTreeData = (json) => {
var node = [];
for (var key in json) {
var value = json[key];
if (typeof value === 'object') {
if (Array.isArray(value)) {
node.push({
children: value.map((val, idx) => {
if (typeof val === 'object') {
return {
children: buildTreeData(val),
key: idx
};
}
return {
key: idx,
value: val
};
}),
key
});
} else {
node.push({
children: buildTreeData(value),
key
});
}
} else {
node.push({
key,
value: String(value)
});
}
}
node.sort((a, b) => {
var A = String(a.key).toUpperCase();
var B = String(b.key).toUpperCase();
if (A < B) {
return -1;
}
if (A > B) {
return 1;
}
return 0;
});
return node;
};
// App: User Dialog
$app.data.userDialog = {
@@ -5547,7 +5586,13 @@ if (window.CefSharp) {
isWorldsLoading: false,
isAvatarsLoading: false,
treeData: []
treeData: [],
memo: ''
};
$app.watch['userDialog.memo'] = function () {
var D = this.userDialog;
this.saveMemo(D.id, D.memo);
};
API.$on('LOGOUT', () => {
@@ -5691,6 +5736,7 @@ if (window.CefSharp) {
var D = this.userDialog;
D.id = userId;
D.treeData = [];
D.memo = this.loadMemo(userId);
D.visible = true;
D.loading = true;
API.getCachedUser({
@@ -6063,6 +6109,7 @@ if (window.CefSharp) {
$app.data.worldDialog = {
visible: false,
loading: false,
id: '',
location_: {},
ref: {},
isFavorite: false,
@@ -6079,7 +6126,7 @@ if (window.CefSharp) {
API.$on('WORLD', (args) => {
var D = $app.worldDialog;
if (D.visible &&
args.ref.id === D.location_.worldId) {
args.ref.id === D.id) {
D.ref = args.ref;
var id = extractFileId(args.ref.assetUrl);
if (id) {
@@ -6096,7 +6143,7 @@ if (window.CefSharp) {
API.$on('FAVORITE', (args) => {
var D = $app.worldDialog;
if (D.visible &&
args.ref.favoriteId === D.location_.worldId &&
args.ref.favoriteId === D.id &&
!args.ref.hide_) {
D.isFavorite = true;
}
@@ -6105,7 +6152,7 @@ if (window.CefSharp) {
API.$on('FAVORITE:@DELETE', (args) => {
var D = $app.worldDialog;
if (D.visible &&
args.ref.favoriteId === D.location_.worldId) {
args.ref.favoriteId === D.id) {
D.isFavorite = false;
}
});
@@ -6115,6 +6162,7 @@ if (window.CefSharp) {
var D = this.worldDialog;
var L = API.parseLocation(tag);
if (L.worldId) {
D.id = L.worldId;
D.location_ = L;
D.treeData = [];
D.fileCreatedAt = '';
@@ -6128,10 +6176,10 @@ if (window.CefSharp) {
D.visible = false;
throw err;
}).then((args) => {
if (D.location_.worldId === args.ref.id) {
if (D.id === args.ref.id) {
D.loading = false;
D.ref = args.ref;
D.isFavorite = Boolean(API.favoriteObject[D.location_.worldId]);
D.isFavorite = Boolean(API.favoriteObject[D.id]);
D.rooms = [];
this.updateWorldDialogInstances();
if (args.cache) {
@@ -6167,7 +6215,7 @@ if (window.CefSharp) {
for (var key in this.friend) {
ref = API.user[key];
if (ref &&
ref.location_.worldId === D.location_.worldId) {
ref.location_.worldId === D.id) {
({ instanceId } = ref.location_);
if (map[instanceId]) {
map[instanceId].users.push(ref);
@@ -6182,7 +6230,7 @@ if (window.CefSharp) {
}
D.rooms = [];
Object.values(map).sort((a, b) => b.users.length - a.users.length || b.occupants - a.occupants).forEach((v) => {
var L = API.parseLocation(`${D.location_.worldId}:${v.id}`);
var L = API.parseLocation(`${D.id}:${v.id}`);
v.location_ = L;
v.location = L.tag;
if (L.userId) {
@@ -6220,7 +6268,7 @@ if (window.CefSharp) {
if (command === 'New Instance') {
this.showNewInstanceDialog(D.location_.tag);
} else if (command === 'Add Favorite') {
this.showFavoriteDialog('world', D.location_.worldId);
this.showFavoriteDialog('world', D.id);
} else {
this.$confirm(`Continue? ${command}`, 'Confirm', {
confirmButtonText: 'Confirm',
@@ -6231,12 +6279,12 @@ if (window.CefSharp) {
switch (command) {
case 'Delete Favorite':
API.deleteFavorite({
objectId: D.location_.worldId
objectId: D.id
});
break;
case 'Make Home':
API.saveCurrentUser({
homeLocation: D.location_.worldId
homeLocation: D.id
}).then((args) => {
this.$message({
message: 'Home world updated',

View File

@@ -632,17 +632,30 @@
<el-button size="small" icon="el-icon-switch-button" @click="logout()">Logout</el-button>
</el-button-group>
</div>
</div>
<div style="margin-top:30px">
<span style="font-weight:bold">Past Display Names</span>
<data-tables v-bind="pastDisplayNameTable" style="margin-top:5px">
<el-table-column label="Date" prop="updated_at" sortable="custom">
<template v-once #default="scope">
<span>{{ scope.row.updated_at | formatDate('YYYY-MM-DD HH24:MI:SS') }}</span>
<div style="margin-top:30px">
<span style="font-weight:bold">Past Display Names</span>
<data-tables v-bind="pastDisplayNameTable" style="margin-top:5px">
<el-table-column label="Date" prop="updated_at" sortable="custom">
<template v-once #default="scope">
<span>{{ scope.row.updated_at | formatDate('YYYY-MM-DD HH24:MI:SS') }}</span>
</template>
</el-table-column>
<el-table-column label="Name" prop="displayName"></el-table-column>
</data-tables>
</div>
<div style="margin-top:30px">
<span style="font-weight:bold">JSON</span>
<el-button type="default" @click="refreshCurrentUserTreeData()" size="mini" icon="el-icon-refresh" circle style="margin-left:5px"></el-button>
<el-button type="default" @click="currentUserTreeData = []" size="mini" icon="el-icon-delete" circle style="margin-left:0"></el-button>
<el-tree :data="currentUserTreeData" style="margin-top:5px;font-size:12px">
<template #default="scope">
<span>
<span v-text="scope.data.key" style="font-weight:bold;margin-right:5px"></span>
<span v-if="!scope.data.children" v-text="scope.data.value"></span>
</span>
</template>
</el-table-column>
<el-table-column label="Name" prop="displayName"></el-table-column>
</data-tables>
</el-tree>
</div>
</div>
<div style="margin-top:30px">
<span style="font-weight:bold">Game Info</span>
@@ -707,7 +720,7 @@
</div>
<div style="font-size:12px;margin-top:5px">
<span style="display:inline-block;min-width:150px">Instance Details</span>
<el-switch v-model="discordInstance" :disabled="!discordActive"></el-switch>
<el-switch v-model="discordInstance"></el-switch>
</div>
</div>
<div style="margin-top:30px">
@@ -768,7 +781,8 @@
<img v-lazy="friend.ref.currentAvatarThumbnailImageUrl">
</div>
<div class="detail">
<span v-text="friend.ref.displayName" class="name"></span>
<span v-if="friend.memo" class="name">{{ friend.ref.displayName }} ({{ friend.memo }})</span>
<span v-else v-text="friend.ref.displayName" class="name"></span>
<location :location="friend.ref.location" :link="false" class="extra"></location>
</div>
</template>
@@ -789,7 +803,8 @@
<img v-lazy="friend.ref.currentAvatarThumbnailImageUrl">
</div>
<div class="detail">
<span v-text="friend.ref.displayName" class="name"></span>
<span v-if="friend.memo" class="name">{{ friend.ref.displayName }} ({{ friend.memo }})</span>
<span v-else v-text="friend.ref.displayName" class="name"></span>
<location :location="friend.ref.location" :link="false" class="extra"></location>
</div>
</template>
@@ -810,7 +825,8 @@
<img v-lazy="friend.ref.currentAvatarThumbnailImageUrl">
</div>
<div class="detail">
<span v-text="friend.ref.displayName" class="name"></span>
<span v-if="friend.memo" class="name">{{ friend.ref.displayName }} ({{ friend.memo }})</span>
<span v-else v-text="friend.ref.displayName" class="name"></span>
<span v-text="friend.ref.statusDescription" :link="false" class="extra"></span>
</div>
</template>
@@ -831,7 +847,8 @@
<img v-lazy="friend.ref.currentAvatarThumbnailImageUrl">
</div>
<div class="detail">
<span v-text="friend.ref.displayName" class="name"></span>
<span v-if="friend.memo" class="name">{{ friend.ref.displayName }} ({{ friend.memo }})</span>
<span v-else v-text="friend.ref.displayName" class="name"></span>
<span v-text="friend.ref.statusDescription" class="extra"></span>
</div>
</template>
@@ -905,11 +922,11 @@
</template>
<el-dropdown-item v-else-if="userDialog.outgoingRequest" icon="el-icon-close" command="Cancel Friend Request">Cancel Friend Request</el-dropdown-item>
<el-dropdown-item v-else icon="el-icon-plus" command="Send Friend Request">Send Friend Request</el-dropdown-item>
<el-dropdown-item v-if="userDialog.isBlock" icon="el-icon-circle-check" command="Unblock" divided>Unblock</el-dropdown-item>
<el-dropdown-item v-if="userDialog.isBlock" icon="el-icon-circle-check" command="Unblock" divided style="color:#F56C6C">Unblock</el-dropdown-item>
<el-dropdown-item v-else icon="el-icon-circle-close" command="Block" divided>Block</el-dropdown-item>
<el-dropdown-item v-if="userDialog.isMute" icon="el-icon-microphone" command="Unmute">Unmute</el-dropdown-item>
<el-dropdown-item v-if="userDialog.isMute" icon="el-icon-microphone" command="Unmute" style="color:#F56C6C">Unmute</el-dropdown-item>
<el-dropdown-item v-else icon="el-icon-turn-off-microphone" command="Mute">Mute</el-dropdown-item>
<el-dropdown-item v-if="userDialog.isHideAvatar" icon="el-icon-user-solid" command="Show Avatar">Show Avatar</el-dropdown-item>
<el-dropdown-item v-if="userDialog.isHideAvatar" icon="el-icon-user-solid" command="Show Avatar" style="color:#F56C6C">Show Avatar</el-dropdown-item>
<el-dropdown-item v-else icon="el-icon-user" command="Hide Avatar">Hide Avatar</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
@@ -950,7 +967,14 @@
</div>
</div>
</div>
<div class="x-friend-list" style="max-height:none">
<div class="x-friend-item" style="width:100%">
<div class="detail">
<span class="name">Note</span>
<el-input v-model="userDialog.memo" type="textarea" :rows="2" placeholder="Click to add a note" size="mini" resize="none" class="extra"></el-input>
</div>
</div>
<div class="x-friend-item">
<div class="detail">
<span class="name">Avatar Copying</span>
@@ -970,12 +994,6 @@
<span class="extra" v-text="userDialog.ref.last_platform"></span>
</div>
</div>
<div class="x-friend-item" style="width:100%">
<div class="detail">
<span class="name">ID</span>
<span class="extra" v-text="userDialog.ref.id"></span>
</div>
</div>
</div>
</el-tab-pane>
<el-tab-pane label="Worlds">
@@ -1009,7 +1027,7 @@
</el-tab-pane>
<el-tab-pane label="JSON">
<el-button type="default" @click="refreshUserDialogTreeData()" size="mini" icon="el-icon-refresh" circle></el-button>
<el-tree :data="userDialog.treeData" style="margin-top:5px">
<el-tree :data="userDialog.treeData" style="margin-top:5px;font-size:12px">
<template #default="scope">
<span>
<span v-text="scope.data.key" style="font-weight:bold;margin-right:5px"></span>
@@ -1033,7 +1051,7 @@
<div style="flex:1;display:flex;align-items:center;margin-left:15px">
<div style="flex:1">
<div>
<i class="el-icon-s-home" v-show="worldDialog.location_.worldId === API.currentUser.homeLocation"></i>
<i class="el-icon-s-home" v-show="API.currentUser.homeLocation_ && API.currentUser.homeLocation_.worldId === worldDialog.id"></i>
<span v-text="worldDialog.ref.name" style="font-weight:bold"></span>
</div>
<div style="margin-top:5px">
@@ -1056,7 +1074,7 @@
<el-button type="default" icon="el-icon-more" circle></el-button>
<el-dropdown-menu #default="dropdown">
<el-dropdown-item icon="el-icon-s-flag" command="New Instance">New Instance</el-dropdown-item>
<el-dropdown-item v-if="worldDialog.location_.worldId === API.currentUser.homeLocation" icon="el-icon-magic-stick" command="Reset Home" divided>Reset Home</el-dropdown-item>
<el-dropdown-item v-if="API.currentUser.homeLocation_ && API.currentUser.homeLocation_.worldId === worldDialog.id" icon="el-icon-magic-stick" command="Reset Home" divided>Reset Home</el-dropdown-item>
<el-dropdown-item v-else icon="el-icon-s-home" command="Make Home" divided>Make Home</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
@@ -1162,17 +1180,11 @@
<span class="extra" v-text="worldDialogPlatform"></span>
</div>
</div>
<div class="x-friend-item" style="width:100%">
<div class="detail">
<span class="name">ID</span>
<span class="extra" v-text="worldDialog.ref.id"></span>
</div>
</div>
</div>
</el-tab-pane>
<el-tab-pane label="JSON">
<el-button type="default" @click="refreshWorldDialogTreeData()" size="mini" icon="el-icon-refresh" circle></el-button>
<el-tree :data="worldDialog.treeData" style="margin-top:5px">
<el-tree :data="worldDialog.treeData" style="margin-top:5px;font-size:12px">
<template #default="scope">
<span>
<span v-text="scope.data.key" style="font-weight:bold;margin-right:5px"></span>
@@ -1249,17 +1261,11 @@
<span class="extra" v-text="avatarDialogPlatform"></span>
</div>
</div>
<div class="x-friend-item" style="width:100%">
<div class="detail">
<span class="name">ID</span>
<span class="extra" v-text="avatarDialog.ref.id"></span>
</div>
</div>
</div>
</el-tab-pane>
<el-tab-pane label="JSON">
<el-button type="default" @click="refreshAvatarDialogTreeData()" size="mini" icon="el-icon-refresh" circle></el-button>
<el-tree :data="avatarDialog.treeData" style="margin-top:5px">
<el-tree :data="avatarDialog.treeData" style="margin-top:5px;font-size:12px">
<template #default="scope">
<span>
<span v-text="scope.data.key" style="font-weight:bold;margin-right:5px"></span>