mirror of
https://github.com/MrUnknownDE/VRCX.git
synced 2026-04-18 22:33:50 +02:00
More prints info
This commit is contained in:
@@ -17450,31 +17450,52 @@ speechSynthesis.getVoices();
|
||||
$app.methods.refreshPrintTable = function () {
|
||||
this.galleryDialogPrintsLoading = true;
|
||||
var params = {
|
||||
n: 100,
|
||||
tag: 'print'
|
||||
n: 100
|
||||
};
|
||||
API.getFileList(params);
|
||||
API.getPrints(params);
|
||||
};
|
||||
|
||||
API.$on('FILES:LIST', function (args) {
|
||||
if (args.params.tag === 'print') {
|
||||
$app.printTable = args.json.reverse();
|
||||
$app.galleryDialogPrintsLoading = false;
|
||||
}
|
||||
});
|
||||
|
||||
$app.methods.deletePrint = function (fileId) {
|
||||
API.deleteFile(fileId).then((args) => {
|
||||
API.$emit('PRINT:DELETE', args);
|
||||
API.getPrints = function (params) {
|
||||
return this.call(`prints/user/${API.currentUser.id}`, {
|
||||
method: 'GET',
|
||||
params
|
||||
}).then((json) => {
|
||||
var args = {
|
||||
json,
|
||||
params
|
||||
};
|
||||
this.$emit('PRINT:LIST', args);
|
||||
return args;
|
||||
});
|
||||
};
|
||||
|
||||
API.deletePrint = function (printId) {
|
||||
return this.call(`prints/${printId}`, {
|
||||
method: 'DELETE'
|
||||
}).then((json) => {
|
||||
var args = {
|
||||
json,
|
||||
printId
|
||||
};
|
||||
this.$emit('PRINT:DELETE', args);
|
||||
return args;
|
||||
});
|
||||
};
|
||||
|
||||
API.$on('PRINT:LIST', function (args) {
|
||||
$app.printTable = args.json.reverse();
|
||||
$app.galleryDialogPrintsLoading = false;
|
||||
});
|
||||
|
||||
$app.methods.deletePrint = function (printId) {
|
||||
API.deletePrint(printId);
|
||||
};
|
||||
|
||||
API.$on('PRINT:DELETE', function (args) {
|
||||
var array = $app.printTable;
|
||||
var { length } = array;
|
||||
for (var i = 0; i < length; ++i) {
|
||||
if (args.fileId === array[i].id) {
|
||||
if (args.printId === array[i].id) {
|
||||
array.splice(i, 1);
|
||||
break;
|
||||
}
|
||||
@@ -17594,7 +17615,15 @@ speechSynthesis.getVoices();
|
||||
console.error('Print image URL is missing', print);
|
||||
return;
|
||||
}
|
||||
var fileName = `${printId}.png`;
|
||||
var createdAt = new Date(print.json.createdAt);
|
||||
var authorName = print.json.authorName;
|
||||
// fileDate format: 2024-11-03_16-14-25.757
|
||||
var fileNameDate = createdAt
|
||||
.toISOString()
|
||||
.replace(/:/g, '-')
|
||||
.replace(/T/g, '_')
|
||||
.replace(/Z/g, '');
|
||||
var fileName = `Prints\\${createdAt.toISOString().slice(0, 7)}\\${authorName}_${fileNameDate}_${printId}.png`;
|
||||
var status = await AppApi.SavePrintToFile(imageUrl, fileName);
|
||||
if (status) {
|
||||
console.log(`Print saved to file: ${fileName}`);
|
||||
|
||||
@@ -435,6 +435,7 @@
|
||||
},
|
||||
"save_instance_prints_to_file": {
|
||||
"header": "Save Instance Prints To File",
|
||||
"header_tooltip": "Requires \"--enable-sdk-log-levels\" VRC launch option",
|
||||
"description": "Save spawned prints to your VRChat Pictures folder"
|
||||
},
|
||||
"remote_database": {
|
||||
@@ -652,6 +653,7 @@
|
||||
"sort_by": "Sort by:",
|
||||
"edit_mode": "Edit Mode",
|
||||
"exit_edit_mode": "Exit Edit Mode",
|
||||
"hold_shift": "Hold shift to leave without confirmation",
|
||||
"own_groups": "Own Groups",
|
||||
"mutual_groups": "Mutual Groups",
|
||||
"groups": "Groups",
|
||||
|
||||
@@ -158,9 +158,15 @@ mixin currentUser()
|
||||
el-button(type="default" size="small" @click="refreshPrintTable" icon="el-icon-refresh") {{ $t('dialog.gallery_icons.refresh') }}
|
||||
//- el-button(type="default" size="small" @click="displayPrintUpload" icon="el-icon-upload2" :disabled="!API.currentUser.$isVRCPlus") {{ $t('dialog.gallery_icons.upload') }}
|
||||
br
|
||||
.x-friend-item(v-if="image.versions && image.versions.length > 0" v-for="image in printTable" :key="image.id" style="display:inline-block;margin-top:10px;width:unset;cursor:default")
|
||||
.vrcplus-icon(v-if="image.versions[image.versions.length - 1].file.url" style="overflow:hidden" @click="showFullscreenImageDialog(image.versions[image.versions.length - 1].file.url)")
|
||||
img.avatar(v-lazy="image.versions[image.versions.length - 1].file.url")
|
||||
.x-friend-item(v-for="image in printTable" :key="image.id" style="display:inline-block;margin-top:10px;width:unset;cursor:default")
|
||||
.vrcplus-icon(style="overflow:hidden" @click="showFullscreenImageDialog(image.files.image)")
|
||||
img.avatar(v-lazy="image.files.image")
|
||||
div(style="margin-top:5px")
|
||||
span(v-text="image.note")
|
||||
br
|
||||
location(v-if="image.worldId" :location="image.worldId" :hint="image.worldName")
|
||||
br
|
||||
display-name(v-if="image.authorId" :userid="image.authorId" :hint="image.authorName" style="color:#909399;font-family:monospace")
|
||||
div(style="float:right;margin-top:5px")
|
||||
el-button(type="default" @click="showFullscreenImageDialog(image.versions[image.versions.length - 1].file.url)" size="mini" icon="el-icon-picture-outline" circle)
|
||||
el-button(type="default" @click="showFullscreenImageDialog(image.files.image)" size="mini" icon="el-icon-picture-outline" circle)
|
||||
el-button(type="default" @click="deletePrint(image.id)" size="mini" icon="el-icon-delete" circle style="margin-left:5px")
|
||||
|
||||
@@ -298,6 +298,8 @@ mixin userDialog()
|
||||
el-tab-pane(:label="$t('dialog.user.groups.header')")
|
||||
el-button(type="default" :loading="userDialog.isGroupsLoading" @click="getUserGroups(userDialog.id)" size="mini" icon="el-icon-refresh" circle)
|
||||
span(style="margin-left:5px") {{ $t('dialog.user.groups.total_count', { count: userGroups.groups.length }) }}
|
||||
template(v-if="userDialogGroupEditMode")
|
||||
span(style="margin-left:10px;color:#909399;font-size:10px") {{ $t('dialog.user.groups.hold_shift') }}
|
||||
div(style="float:right")
|
||||
template(v-if="!userDialogGroupEditMode")
|
||||
span(style="margin-right:5px") {{ $t('dialog.user.groups.sort_by') }}
|
||||
|
||||
@@ -476,6 +476,8 @@ mixin settingsTab()
|
||||
span.name(style="min-width:300px") {{ $t('view.settings.advanced.advanced.local_world_persistence.description') }}
|
||||
el-switch(v-model="disableWorldDatabase" :active-value="false" :inactive-value="true" @change="saveVRCXWindowOption")
|
||||
span.sub-header {{ $t('view.settings.advanced.advanced.save_instance_prints_to_file.header') }}
|
||||
el-tooltip(placement="top" style="margin-left:5px" :content="$t('view.settings.advanced.advanced.save_instance_prints_to_file.header_tooltip')")
|
||||
i.el-icon-info
|
||||
div.options-container-item
|
||||
span.name(style="min-width:300px") {{ $t('view.settings.advanced.advanced.save_instance_prints_to_file.description') }}
|
||||
el-switch(v-model="saveInstancePrints" @change="saveVRCXWindowOption")
|
||||
|
||||
Reference in New Issue
Block a user