mirror of
https://github.com/MrUnknownDE/VRCX.git
synced 2026-04-18 22:33:50 +02:00
Content settings
This commit is contained in:
92
src/app.js
92
src/app.js
@@ -946,6 +946,7 @@ console.log(`isLinux: ${LINUX}`);
|
||||
id: '',
|
||||
name: '',
|
||||
description: '',
|
||||
defaultContentSettings: {},
|
||||
authorId: '',
|
||||
authorName: '',
|
||||
capacity: 0,
|
||||
@@ -1027,6 +1028,7 @@ console.log(`isLinux: ${LINUX}`);
|
||||
world: {},
|
||||
users: [], // only present when you're the owner
|
||||
clientNumber: '',
|
||||
contentSettings: {},
|
||||
photonRegion: '',
|
||||
region: '',
|
||||
canRequestInvite: false,
|
||||
@@ -1043,6 +1045,7 @@ console.log(`isLinux: ${LINUX}`);
|
||||
ageGate: null,
|
||||
// VRCX
|
||||
$fetchedAt: '',
|
||||
$disabledContentSettings: [],
|
||||
...json
|
||||
};
|
||||
this.cachedInstances.set(ref.id, ref);
|
||||
@@ -1063,6 +1066,16 @@ console.log(`isLinux: ${LINUX}`);
|
||||
if (!json.$fetchedAt) {
|
||||
ref.$fetchedAt = new Date().toJSON();
|
||||
}
|
||||
if (json.contentSettings && Object.keys(json.contentSettings).length) {
|
||||
for (var setting in $app.instanceContentSettings) {
|
||||
if (json.contentSettings[setting]) {
|
||||
continue;
|
||||
}
|
||||
ref.$disabledContentSettings.push(
|
||||
$app.instanceContentSettings[setting]
|
||||
);
|
||||
}
|
||||
}
|
||||
return ref;
|
||||
};
|
||||
|
||||
@@ -1202,7 +1215,7 @@ console.log(`isLinux: ${LINUX}`);
|
||||
};
|
||||
|
||||
API.refetchBrokenFriends = async function (friends) {
|
||||
// attempt to broken data from bulk friend fetch
|
||||
// attempt to fix broken data from bulk friend fetch
|
||||
for (var i = 0; i < friends.length; i++) {
|
||||
var friend = friends[i];
|
||||
try {
|
||||
@@ -9264,7 +9277,6 @@ console.log(`isLinux: ${LINUX}`);
|
||||
isIos: false,
|
||||
avatarScalingDisabled: false,
|
||||
focusViewDisabled: false,
|
||||
stickersDisabled: false,
|
||||
inCache: false,
|
||||
cacheSize: '',
|
||||
bundleSizes: [],
|
||||
@@ -9288,7 +9300,6 @@ console.log(`isLinux: ${LINUX}`);
|
||||
isIos: false,
|
||||
avatarScalingDisabled: false,
|
||||
focusViewDisabled: false,
|
||||
stickersDisabled: false,
|
||||
inCache: false,
|
||||
cacheSize: '',
|
||||
bundleSizes: [],
|
||||
@@ -9304,7 +9315,6 @@ console.log(`isLinux: ${LINUX}`);
|
||||
isIos: false,
|
||||
avatarScalingDisabled: false,
|
||||
focusViewDisabled: false,
|
||||
stickersDisabled: false,
|
||||
inCache: false,
|
||||
cacheSize: '',
|
||||
bundleSizes: [],
|
||||
@@ -9330,8 +9340,6 @@ console.log(`isLinux: ${LINUX}`);
|
||||
);
|
||||
this.currentInstanceWorld.focusViewDisabled =
|
||||
args.ref?.tags.includes('feature_focus_view_disabled');
|
||||
this.currentInstanceWorld.stickersDisabled =
|
||||
args.ref?.tags.includes('feature_stickers_disabled');
|
||||
this.checkVRChatCache(args.ref).then((cacheInfo) => {
|
||||
if (cacheInfo.Item1 > 0) {
|
||||
this.currentInstanceWorld.inCache = true;
|
||||
@@ -10067,7 +10075,6 @@ console.log(`isLinux: ${LINUX}`);
|
||||
isFavorite: false,
|
||||
avatarScalingDisabled: false,
|
||||
focusViewDisabled: false,
|
||||
stickersDisabled: false,
|
||||
rooms: [],
|
||||
treeData: [],
|
||||
bundleSizes: [],
|
||||
@@ -10100,7 +10107,6 @@ console.log(`isLinux: ${LINUX}`);
|
||||
'feature_avatar_scaling_disabled'
|
||||
);
|
||||
D.focusViewDisabled = ref.tags?.includes('feature_focus_view_disabled');
|
||||
D.stickersDisabled = ref.tags?.includes('feature_stickers_disabled');
|
||||
$app.applyWorldDialogInstances();
|
||||
for (var room of D.rooms) {
|
||||
if ($utils.isRealInstance(room.tag)) {
|
||||
@@ -10240,7 +10246,6 @@ console.log(`isLinux: ${LINUX}`);
|
||||
D.isFavorite = false;
|
||||
D.avatarScalingDisabled = false;
|
||||
D.focusViewDisabled = false;
|
||||
D.stickersDisabled = false;
|
||||
D.isPC = false;
|
||||
D.isQuest = false;
|
||||
D.isIos = false;
|
||||
@@ -10303,9 +10308,6 @@ console.log(`isLinux: ${LINUX}`);
|
||||
D.focusViewDisabled = args.ref?.tags.includes(
|
||||
'feature_focus_view_disabled'
|
||||
);
|
||||
D.stickersDisabled = args.ref?.tags.includes(
|
||||
'feature_stickers_disabled'
|
||||
);
|
||||
D.isPC = isPC;
|
||||
D.isQuest = isQuest;
|
||||
D.isIos = isIos;
|
||||
@@ -11740,6 +11742,14 @@ console.log(`isLinux: ${LINUX}`);
|
||||
// #endregion
|
||||
// #region | App: New Instance Dialog
|
||||
|
||||
$app.data.instanceContentSettings = [
|
||||
'emoji',
|
||||
'stickers',
|
||||
'pedestals',
|
||||
'prints',
|
||||
'drones'
|
||||
];
|
||||
|
||||
$app.data.newInstanceDialog = {
|
||||
visible: false,
|
||||
loading: false,
|
||||
@@ -11776,7 +11786,14 @@ console.log(`isLinux: ${LINUX}`);
|
||||
lastSelectedGroupId: '',
|
||||
selectedGroupRoles: [],
|
||||
roleIds: [],
|
||||
groupRef: {}
|
||||
groupRef: {},
|
||||
contentSettings: $app.data.instanceContentSettings,
|
||||
selectedContentSettings: JSON.parse(
|
||||
await configRepository.getString(
|
||||
'instanceDialogSelectedContentSettings',
|
||||
JSON.stringify($app.data.instanceContentSettings)
|
||||
)
|
||||
)
|
||||
};
|
||||
|
||||
API.$on('LOGOUT', function () {
|
||||
@@ -11926,12 +11943,18 @@ console.log(`isLinux: ${LINUX}`);
|
||||
} else if (D.region === 'Japan') {
|
||||
region = 'jp';
|
||||
}
|
||||
var contentSettings = {};
|
||||
for (var setting of D.contentSettings) {
|
||||
contentSettings[setting] =
|
||||
D.selectedContentSettings.includes(setting);
|
||||
}
|
||||
var params = {
|
||||
type,
|
||||
canRequestInvite,
|
||||
worldId: D.worldId,
|
||||
ownerId: API.currentUser.id,
|
||||
region
|
||||
region,
|
||||
contentSettings
|
||||
};
|
||||
if (type === 'group') {
|
||||
params.groupAccessType = D.groupAccessType;
|
||||
@@ -12043,6 +12066,10 @@ console.log(`isLinux: ${LINUX}`);
|
||||
'instanceDialogAgeGate',
|
||||
this.newInstanceDialog.ageGate
|
||||
);
|
||||
await configRepository.setString(
|
||||
'instanceDialogSelectedContentSettings',
|
||||
JSON.stringify(this.newInstanceDialog.selectedContentSettings)
|
||||
);
|
||||
};
|
||||
|
||||
$app.methods.showNewInstanceDialog = async function (tag) {
|
||||
@@ -12181,12 +12208,16 @@ console.log(`isLinux: ${LINUX}`);
|
||||
debugAllowed: false,
|
||||
avatarScalingDisabled: false,
|
||||
focusViewDisabled: false,
|
||||
stickersDisabled: false,
|
||||
contentHorror: false,
|
||||
contentGore: false,
|
||||
contentViolence: false,
|
||||
contentAdult: false,
|
||||
contentSex: false
|
||||
contentSex: false,
|
||||
emoji: true,
|
||||
stickers: true,
|
||||
pedestals: true,
|
||||
prints: true,
|
||||
drones: true
|
||||
};
|
||||
|
||||
$app.methods.showSetWorldTagsDialog = function () {
|
||||
@@ -12198,7 +12229,6 @@ console.log(`isLinux: ${LINUX}`);
|
||||
D.debugAllowed = false;
|
||||
D.avatarScalingDisabled = false;
|
||||
D.focusViewDisabled = false;
|
||||
D.stickersDisabled = false;
|
||||
D.contentHorror = false;
|
||||
D.contentGore = false;
|
||||
D.contentViolence = false;
|
||||
@@ -12240,8 +12270,20 @@ console.log(`isLinux: ${LINUX}`);
|
||||
case 'feature_focus_view_disabled':
|
||||
D.focusViewDisabled = true;
|
||||
break;
|
||||
case 'feature_emoji_disabled':
|
||||
D.emoji = false;
|
||||
break;
|
||||
case 'feature_stickers_disabled':
|
||||
D.stickersDisabled = true;
|
||||
D.stickers = false;
|
||||
break;
|
||||
case 'feature_pedestals_disabled':
|
||||
D.pedestals = false;
|
||||
break;
|
||||
case 'feature_prints_disabled':
|
||||
D.prints = false;
|
||||
break;
|
||||
case 'feature_drones_disabled':
|
||||
D.drones = false;
|
||||
break;
|
||||
}
|
||||
});
|
||||
@@ -12298,9 +12340,21 @@ console.log(`isLinux: ${LINUX}`);
|
||||
if (D.focusViewDisabled) {
|
||||
tags.unshift('feature_focus_view_disabled');
|
||||
}
|
||||
if (D.stickersDisabled) {
|
||||
if (!D.emoji) {
|
||||
tags.unshift('feature_emoji_disabled');
|
||||
}
|
||||
if (!D.stickers) {
|
||||
tags.unshift('feature_stickers_disabled');
|
||||
}
|
||||
if (!D.pedestals) {
|
||||
tags.unshift('feature_pedestals_disabled');
|
||||
}
|
||||
if (!D.prints) {
|
||||
tags.unshift('feature_prints_disabled');
|
||||
}
|
||||
if (!D.drones) {
|
||||
tags.unshift('feature_drones_disabled');
|
||||
}
|
||||
worldRequest
|
||||
.saveWorld({
|
||||
id: this.worldDialog.id,
|
||||
|
||||
@@ -210,6 +210,7 @@ export default class extends baseClass {
|
||||
'<span><span style="color:#67c23a">Android: </span>{{ platforms.android }}</span></br>' +
|
||||
'<span>{{ $t("dialog.user.info.instance_game_version") }} {{ gameServerVersion }}</span></br>' +
|
||||
'<span v-if="queueEnabled">{{ $t("dialog.user.info.instance_queuing_enabled") }}</br></span>' +
|
||||
'<span v-if="disabledContentSettings">{{ $t("dialog.user.info.instance_disabled_content_settings") }} {{ disabledContentSettings }}</br></span>' +
|
||||
'<span v-if="userList.length">{{ $t("dialog.user.info.instance_users") }}</br></span>' +
|
||||
'<template v-for="user in userList"><span style="cursor:pointer;margin-right:5px" @click="showUserDialog(user.id)" v-text="user.displayName"></span></template>' +
|
||||
'</div>' +
|
||||
@@ -262,6 +263,7 @@ export default class extends baseClass {
|
||||
this.gameServerVersion = '';
|
||||
this.canCloseInstance = false;
|
||||
this.isAgeGated = false;
|
||||
this.disabledContentSettings = '';
|
||||
if (
|
||||
!this.location ||
|
||||
!this.instance ||
|
||||
@@ -308,6 +310,13 @@ export default class extends baseClass {
|
||||
// dumb workaround for API not returning `ageGate`
|
||||
this.isAgeGated = true;
|
||||
}
|
||||
if (
|
||||
this.instance.$disabledContentSettings &&
|
||||
this.instance.$disabledContentSettings.length
|
||||
) {
|
||||
this.disabledContentSettings =
|
||||
this.instance.$disabledContentSettings.join(', ');
|
||||
}
|
||||
},
|
||||
showUserDialog(userId) {
|
||||
API.$emit('SHOW_USER_DIALOG', userId);
|
||||
|
||||
@@ -749,6 +749,7 @@
|
||||
"instance_game_version": "Game Version:",
|
||||
"last_join": "Last Join:",
|
||||
"instance_queuing_enabled": "Queuing Enabled",
|
||||
"instance_disabled_content_settings": "Disabled Content Settings:",
|
||||
"instance_creator": "Instance Creator",
|
||||
"note": "Note",
|
||||
"note_placeholder": "Click to add a note",
|
||||
@@ -846,7 +847,6 @@
|
||||
"private": "Private",
|
||||
"avatar_scaling_disabled": "Avatar Scaling Disabled",
|
||||
"focus_view_disabled": "Focus View Disabled",
|
||||
"stickers_disabled": "Stickers Disabled",
|
||||
"future_proofing": "Future Proofing",
|
||||
"labs": "Labs",
|
||||
"cache": "Cache",
|
||||
@@ -1142,6 +1142,13 @@
|
||||
"region_use": "US East",
|
||||
"region_eu": "Europe",
|
||||
"region_jp": "Japan",
|
||||
"content_settings": "Content Settings",
|
||||
"content_placeholder": "Enabled Content",
|
||||
"content_emoji": "Emoji",
|
||||
"content_stickers": "Stickers",
|
||||
"content_pedestals": "Pedestals",
|
||||
"content_prints": "Prints",
|
||||
"content_drones": "Drones",
|
||||
"world_id": "World ID",
|
||||
"instance_id": "Instance ID",
|
||||
"instance_id_placeholder": "Random",
|
||||
@@ -1208,7 +1215,6 @@
|
||||
"header": "Set World Tags",
|
||||
"avatar_scaling_disabled": "Disable avatar scaling",
|
||||
"focus_view_disabled": "Disable focus view",
|
||||
"stickers_disabled": "Disable stickers",
|
||||
"enable_debugging": "Enable world debugging for others",
|
||||
"author_tags": "Author Tags (comma separated)",
|
||||
"content_tags": "Content Warning Tags",
|
||||
@@ -1217,6 +1223,7 @@
|
||||
"content_violence": "Violence",
|
||||
"content_adult": "Adult",
|
||||
"content_sex": "Sexual",
|
||||
"default_content_settings": "Default Content Settings",
|
||||
"cancel": "Cancel",
|
||||
"save": "Save"
|
||||
},
|
||||
|
||||
@@ -37,6 +37,27 @@ mixin newInstance
|
||||
el-radio-button(label='US East') {{ $t('dialog.new_instance.region_use') }}
|
||||
el-radio-button(label='Europe') {{ $t('dialog.new_instance.region_eu') }}
|
||||
el-radio-button(label='Japan') {{ $t('dialog.new_instance.region_jp') }}
|
||||
el-form-item(:label='$t("dialog.new_instance.content_settings")')
|
||||
el-select(
|
||||
v-model='newInstanceDialog.selectedContentSettings'
|
||||
multiple
|
||||
:placeholder='$t("dialog.new_instance.content_placeholder")'
|
||||
style='width: 100%'
|
||||
@change='buildInstance')
|
||||
el-option-group(:label='$t("dialog.new_instance.content_placeholder")')
|
||||
el-option.x-friend-item(value='emoji' :label='$t("dialog.new_instance.content_emoji")')
|
||||
el-option.x-friend-item(
|
||||
value='stickers'
|
||||
:label='$t("dialog.new_instance.content_stickers")')
|
||||
el-option.x-friend-item(
|
||||
value='pedestals'
|
||||
:label='$t("dialog.new_instance.content_pedestals")')
|
||||
el-option.x-friend-item(
|
||||
value='prints'
|
||||
:label='$t("dialog.new_instance.content_prints")')
|
||||
el-option.x-friend-item(
|
||||
value='drones'
|
||||
:label='$t("dialog.new_instance.content_drones")')
|
||||
el-form-item(
|
||||
:label='$t("dialog.new_instance.queueEnabled")'
|
||||
v-if='newInstanceDialog.accessType === "group"')
|
||||
|
||||
@@ -12,8 +12,6 @@ mixin tags
|
||||
br
|
||||
el-checkbox(v-model='setWorldTagsDialog.focusViewDisabled') {{ $t('dialog.set_world_tags.focus_view_disabled') }}
|
||||
br
|
||||
el-checkbox(v-model='setWorldTagsDialog.stickersDisabled') {{ $t('dialog.set_world_tags.stickers_disabled') }}
|
||||
br
|
||||
el-checkbox(v-model='setWorldTagsDialog.debugAllowed') {{ $t('dialog.set_world_tags.enable_debugging') }}
|
||||
div(style='font-size: 12px; margin-top: 10px')
|
||||
| {{ $t('dialog.set_world_tags.author_tags') }} #[br]
|
||||
@@ -36,6 +34,17 @@ mixin tags
|
||||
el-checkbox(v-model='setWorldTagsDialog.contentAdult') {{ $t('dialog.set_world_tags.content_adult') }}
|
||||
br
|
||||
el-checkbox(v-model='setWorldTagsDialog.contentSex') {{ $t('dialog.set_world_tags.content_sex') }}
|
||||
div(style='font-size: 12px; margin-top: 10px')
|
||||
| {{ $t('dialog.set_world_tags.default_content_settings') }} #[br]
|
||||
el-checkbox(v-model='setWorldTagsDialog.emoji') {{ $t('dialog.new_instance.content_emoji') }}
|
||||
br
|
||||
el-checkbox(v-model='setWorldTagsDialog.stickers') {{ $t('dialog.new_instance.content_stickers') }}
|
||||
br
|
||||
el-checkbox(v-model='setWorldTagsDialog.pedestals') {{ $t('dialog.new_instance.content_pedestals') }}
|
||||
br
|
||||
el-checkbox(v-model='setWorldTagsDialog.prints') {{ $t('dialog.new_instance.content_prints') }}
|
||||
br
|
||||
el-checkbox(v-model='setWorldTagsDialog.drones') {{ $t('dialog.new_instance.content_drones') }}
|
||||
//- el-input(type="textarea" v-model="setWorldTagsDialog.contentTags" size="mini" show-word-limit :autosize="{ minRows:2, maxRows:5 }" placeholder="" style="margin-top:10px")
|
||||
template(#footer)
|
||||
div(style='display: flex')
|
||||
|
||||
@@ -140,7 +140,7 @@ mixin userDialog
|
||||
size='mini'
|
||||
style='margin-right: 5px; margin-top: 5px') {{ userDialog.ref.last_platform }}
|
||||
el-tag.x-tag-age-verification(
|
||||
v-if='userDialog.ref.ageVerificationStatus && userDialog.ref.ageVerificationStatus !== "hidden"'
|
||||
v-if='userDialog.ref.ageVerificationStatus || userDialog.ref.ageVerificationStatus !== "hidden"'
|
||||
type='info'
|
||||
effect='plain'
|
||||
size='mini'
|
||||
|
||||
@@ -124,14 +124,6 @@
|
||||
style="margin-right: 5px; margin-top: 5px">
|
||||
{{ $t('dialog.world.tags.focus_view_disabled') }}
|
||||
</el-tag>
|
||||
<el-tag
|
||||
v-if="worldDialog.stickersDisabled"
|
||||
type="warning"
|
||||
effect="plain"
|
||||
size="mini"
|
||||
style="margin-right: 5px; margin-top: 5px">
|
||||
{{ $t('dialog.world.tags.stickers_disabled') }}
|
||||
</el-tag>
|
||||
<el-tag
|
||||
v-if="worldDialog.ref.unityPackageUrl"
|
||||
type="success"
|
||||
|
||||
11
src/vr.pug
11
src/vr.pug
@@ -219,7 +219,10 @@ doctype html
|
||||
span.time {{ feed.created_at | formatDate }}
|
||||
template(v-if='feed.displayName')
|
||||
| ✨ #[span.name(v-text='feed.displayName' style='margin-right: 5px' :style='{ color: feed.tagColour }')]
|
||||
| #[location(:location='feed.instanceId' :hint='feed.worldName' :grouphint='feed.groupName')]
|
||||
location(
|
||||
:location='feed.instanceId'
|
||||
:hint='feed.worldName'
|
||||
:grouphint='feed.groupName')
|
||||
template(v-else)
|
||||
| ✨ User has spawned a portal
|
||||
.x-friend-item(
|
||||
@@ -529,7 +532,11 @@ doctype html
|
||||
span.time {{ feed.created_at | formatDate }}
|
||||
template(v-if='feed.displayName')
|
||||
|#[span.name(v-text='feed.displayName' :style='{ color: feed.tagColour }')] has spawned a portal to
|
||||
| #[location(:location='feed.instanceId' :hint='feed.worldName' :grouphint='feed.groupName' style='margin-left: 5px')]
|
||||
location(
|
||||
:location='feed.instanceId'
|
||||
:hint='feed.worldName'
|
||||
:grouphint='feed.groupName'
|
||||
style='margin-left: 5px')
|
||||
template(v-else)
|
||||
| User has spawned a portal
|
||||
.x-friend-item(
|
||||
|
||||
Reference in New Issue
Block a user