This commit is contained in:
syuilo 2026-05-27 09:55:12 +09:00
commit 807ade4c37
5 changed files with 30 additions and 9 deletions

View file

@ -3583,6 +3583,7 @@ _miRoom:
material_metallic: "光沢"
material_roughness: "粗さ"
light_brightness: "明るさ"
advancedCustomize: "高度なアレンジ"
_objects:
woodRingFloorLamp: "リングシェードフロアランプ"

View file

@ -785,9 +785,8 @@ function showOtherMenu(ev: PointerEvent) {
right: 16px;
z-index: 1;
padding: 16px;
box-sizing: border-box;
width: 300px;
max-height: 100%;
max-height: calc(100% - 16px - 16px);
box-sizing: border-box;
overflow: auto;
border-radius: 12px;

View file

@ -22,12 +22,14 @@ SPDX-License-Identifier: AGPL-3.0-only
<MkInput :modelValue="getHex(options[k].color)" type="color" :throttle="300" @update:modelValue="v => { const c = getRgb(v); if (c != null) updateMaterialColor(k, c); }">
<template #label>{{ i18n.ts.color }}</template>
</MkInput>
<MkRange :continuousUpdate="true" :min="0" :max="1" :step="0.1" :modelValue="options[k].metallic" @update:modelValue="v => updateMaterialMetallic(k, v)">
<template #label>{{ i18n.ts._miRoom.material_metallic }}</template>
</MkRange>
<MkRange :continuousUpdate="true" :min="0" :max="1" :step="0.1" :modelValue="options[k].roughness" @update:modelValue="v => updateMaterialRoughness(k, v)">
<template #label>{{ i18n.ts._miRoom.material_roughness }}</template>
</MkRange>
<template v-if="advancedCustomize">
<MkRange :continuousUpdate="true" :min="0" :max="1" :step="0.1" :modelValue="options[k].metallic" @update:modelValue="v => updateMaterialMetallic(k, v)">
<template #label>{{ i18n.ts._miRoom.material_metallic }}</template>
</MkRange>
<MkRange :continuousUpdate="true" :min="0" :max="1" :step="0.1" :modelValue="options[k].roughness" @update:modelValue="v => updateMaterialRoughness(k, v)">
<template #label>{{ i18n.ts._miRoom.material_roughness }}</template>
</MkRange>
</template>
</div>
<div v-else-if="s.type === 'light'" class="_gaps_s">
<!-- debounce or throttleしないとカラーピッカー上で高速でなぞったときになぜか無限ループになるワーカーとの間でラグがあるため少し前の値がまたmodelValueとしてフィードバックされてしまうためだと思われる -->
@ -68,6 +70,8 @@ SPDX-License-Identifier: AGPL-3.0-only
<MkRange :continuousUpdate="true" :min="0" :max="1000" :step="1" :modelValue="options[k]" @update:modelValue="v => emit('update', k, v)"></MkRange>
</div>
</MkFolder>
<MkSwitch v-model="advancedCustomize">{{ i18n.ts._miRoom.advancedCustomize }}</MkSwitch>
</div>
</div>
</template>
@ -76,7 +80,7 @@ SPDX-License-Identifier: AGPL-3.0-only
import { } from 'vue';
import * as Misskey from 'misskey-js';
import { getHex, getRgb } from 'misskey-world/src/utility.js';
import type { ObjectSchemaDef } from 'misskey-world/src/room/object.js';
import type { ObjectSchemaDef, RawOptions } from 'misskey-world/src/room/object.js';
import { i18n } from '@/i18n.js';
import MkButton from '@/components/MkButton.vue';
import MkSelect from '@/components/MkSelect.vue';
@ -88,6 +92,7 @@ import { chooseDriveFile } from '@/utility/drive.js';
import MkRadios from '@/components/MkRadios.vue';
import MkFolder from '@/components/MkFolder.vue';
import { OBJECT_UI_DEFS } from '@/world/room/object-ui-defs.js';
import { prefer } from '@/preferences.js';
const props = defineProps<{
schema: ObjectSchemaDef<any>;
@ -99,6 +104,8 @@ const emit = defineEmits<{
(ev: 'update', k: string, v: any): void;
}>();
const advancedCustomize = prefer.model('world.room.advancedCustomize');
function changeImageType(k: string, type: string) {
emit('update', k, { ...props.options[k], type, driveFileId: type === '_custom_' ? props.options[k].driveFileId : null });
}
@ -121,6 +128,13 @@ async function changeImage(k: string) {
});
return;
}
if (Math.max(file.properties.width ?? 0, file.properties.height ?? 0) > 2048) {
os.alert({
type: 'error',
text: 'The image dimensions exceed the limit of 2048x2048 pixels.',
});
return;
}
props.addFileAttachment(file);
emit('update', k, {
...props.options[k],

View file

@ -548,6 +548,9 @@ export const PREF_DEF = definePreferences({
'world.separateRenderingThread': {
default: true,
},
'world.room.advancedCustomize': {
default: false,
},
'experimental.stackingRouterView': {
default: false,

View file

@ -13370,6 +13370,10 @@ export interface Locale extends ILocale {
*
*/
"light_brightness": string;
/**
*
*/
"advancedCustomize": string;
"_objects": {
/**
*