mirror of
https://github.com/MrUnknownDE/VRCX.git
synced 2026-04-24 09:13: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;
|
||||
})();
|
||||
|
||||
Reference in New Issue
Block a user