mirror of
https://github.com/MrUnknownDE/VRCX.git
synced 2026-04-17 22:03:50 +02:00
VRCPlus Icons init
This commit is contained in:
@@ -5581,6 +5581,7 @@ import gameLogService from './service/gamelog.js'
|
||||
]
|
||||
}
|
||||
};
|
||||
$app.data.VRCPlusIconsTable = {};
|
||||
$app.data.visits = 0;
|
||||
$app.data.openVR = configRepository.getBool('openVR');
|
||||
$app.data.openVRAlways = configRepository.getBool('openVRAlways');
|
||||
@@ -7442,6 +7443,83 @@ import gameLogService from './service/gamelog.js'
|
||||
D.visible = false;
|
||||
};
|
||||
|
||||
$app.methods.displayVRCPlusIconsTable = function () {
|
||||
var params = {
|
||||
n: 100,
|
||||
tag: 'icon'
|
||||
};
|
||||
API.refreshVRCPlusIconsTableData(params);
|
||||
};
|
||||
|
||||
API.refreshVRCPlusIconsTableData = function (params) {
|
||||
return this.call(`files`, {
|
||||
method: 'GET',
|
||||
params
|
||||
}).then((json) => {
|
||||
var args = {
|
||||
json,
|
||||
params
|
||||
};
|
||||
this.$emit('FILES', args);
|
||||
return args;
|
||||
});
|
||||
};
|
||||
|
||||
API.$on('FILES', function (args) {
|
||||
$app.VRCPlusIconsTable = args.json;
|
||||
});
|
||||
|
||||
$app.methods.setVRCPlusIcon = function (userIcon) {
|
||||
if (userIcon != '') {
|
||||
userIcon = `https://api.vrchat.cloud/api/1/file/${userIcon}/1`;
|
||||
}
|
||||
API.setVRCPlusIcon({
|
||||
userIcon: userIcon
|
||||
}).then((args) => {
|
||||
this.$message({
|
||||
message: 'Icon changed',
|
||||
type: 'success'
|
||||
});
|
||||
return args;
|
||||
});
|
||||
};
|
||||
|
||||
API.setVRCPlusIcon = function (params) {
|
||||
return this.call(`users/${this.currentUser.id}`, {
|
||||
method: 'PUT',
|
||||
params
|
||||
}).then((json) => {
|
||||
var args = {
|
||||
json,
|
||||
params
|
||||
};
|
||||
this.$emit('USER:CURRENT:SAVE', args);
|
||||
return args;
|
||||
});
|
||||
};
|
||||
|
||||
$app.methods.deleteVRCPlusIcon = function (userIcon) {
|
||||
API.deleteVRCPlusIcon(userIcon).then((args) => {
|
||||
this.$message({
|
||||
message: 'Icon deleted',
|
||||
type: 'success'
|
||||
});
|
||||
this.displayVRCPlusIconsTable();
|
||||
return args;
|
||||
});
|
||||
};
|
||||
|
||||
API.deleteVRCPlusIcon = function (userIcon) {
|
||||
return this.call(`file/${userIcon}`, {
|
||||
method: 'DELETE'
|
||||
}).then((json) => {
|
||||
var args = {
|
||||
json
|
||||
};
|
||||
return args;
|
||||
});
|
||||
};
|
||||
|
||||
$app = new Vue($app);
|
||||
window.$app = $app;
|
||||
})();
|
||||
|
||||
@@ -362,6 +362,26 @@ a {
|
||||
color: #606266;
|
||||
}
|
||||
|
||||
.x-friend-item > .vrcplus-icon {
|
||||
border: 4px solid #dcdfe6;
|
||||
border-radius: 50%;
|
||||
margin: 0;
|
||||
width: 120px;
|
||||
height: 120px;
|
||||
}
|
||||
|
||||
.x-friend-item > .current-vrcplus-icon {
|
||||
border:4px solid #67c23a;
|
||||
border-radius:50%;
|
||||
}
|
||||
|
||||
.x-friend-item > .vrcplus-icon > img {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
border-radius: 50%;
|
||||
object-fit: cover;
|
||||
}
|
||||
|
||||
.x-dialog > .el-dialog {
|
||||
max-width: 100%;
|
||||
margin-bottom: 10px;
|
||||
|
||||
@@ -440,6 +440,15 @@ html
|
||||
template(v-once #default="scope")
|
||||
span {{ scope.row.updated_at | formatDate('YYYY-MM-DD HH24:MI:SS') }}
|
||||
el-table-column(label="Name" prop="displayName")
|
||||
div(v-if="API.currentUser.$isVRCPlus" style="margin-top:30px")
|
||||
span(style="font-weight:bold") VRCPlus Icons
|
||||
el-button(type="default" @click="displayVRCPlusIconsTable()" size="mini" icon="el-icon-refresh" circle style="margin-left:5px")
|
||||
el-button(type="default" @click="setVRCPlusIcon('')" size="mini" icon="el-icon-close" circle style="margin:0")
|
||||
br
|
||||
.x-friend-item(v-for="icon in VRCPlusIconsTable" :key="icon.id" style="display:inline-block;")
|
||||
.vrcplus-icon(style="" @click="setVRCPlusIcon(icon.id)" :class="{ 'current-vrcplus-icon': 'https://api.vrchat.cloud/api/1/file/' + icon.id + '/1' === API.currentUser.userIcon }")
|
||||
img.avatar(v-if="icon.versions[1].file.url" v-lazy="icon.versions[1].file.url")
|
||||
el-button(type="default" @click="deleteVRCPlusIcon(icon.id)" size="mini" icon="el-icon-delete" circle style="float:right;")
|
||||
div(style="margin-top:30px")
|
||||
span(style="font-weight:bold") Current User JSON
|
||||
el-button(type="default" @click="refreshCurrentUserTreeData()" size="mini" icon="el-icon-refresh" circle style="margin-left:5px")
|
||||
|
||||
Reference in New Issue
Block a user