1
0
mirror of https://github.com/misskey-dev/misskey.git synced 2026-05-22 03:25:49 +02:00
This commit is contained in:
syuilo
2026-04-30 09:17:22 +09:00
parent c2d5a33400
commit 8f5c09daa1
6 changed files with 222 additions and 50 deletions

View File

@@ -7,23 +7,55 @@ SPDX-License-Identifier: AGPL-3.0-only
<div :class="$style.root">
<div class="_gaps">
<MkFolder>
<template #label>Wall N</template>
<XWallOption :options="options.walls.n" @update="v => { update({ walls: { ...options.walls, n: v } }); }"></XWallOption>
<template #label>Walls</template>
<div class="_gaps_s">
<MkFolder>
<template #label>Wall N</template>
<XWallOption :options="options.walls.n" @update="v => { update({ walls: { ...options.walls, n: v } }); }"></XWallOption>
</MkFolder>
<MkFolder>
<template #label>Wall S</template>
<XWallOption :options="options.walls.s" @update="v => { update({ walls: { ...options.walls, s: v } }); }"></XWallOption>
</MkFolder>
<MkFolder>
<template #label>Wall W</template>
<XWallOption :options="options.walls.w" @update="v => { update({ walls: { ...options.walls, w: v } }); }"></XWallOption>
</MkFolder>
<MkFolder>
<template #label>Wall E</template>
<XWallOption :options="options.walls.e" @update="v => { update({ walls: { ...options.walls, e: v } }); }"></XWallOption>
</MkFolder>
</div>
</MkFolder>
<MkFolder>
<template #label>Wall S</template>
<XWallOption :options="options.walls.s" @update="v => { update({ walls: { ...options.walls, s: v } }); }"></XWallOption>
</MkFolder>
<template #label>Pillars</template>
<MkFolder>
<template #label>Wall W</template>
<XWallOption :options="options.walls.w" @update="v => { update({ walls: { ...options.walls, w: v } }); }"></XWallOption>
</MkFolder>
<div class="_gaps_s">
<MkFolder>
<template #label>Pillar NW</template>
<XPillarOption :options="options.pillars.nw" @update="v => { update({ pillars: { ...options.pillars, nw: v } }); }"></XPillarOption>
</MkFolder>
<MkFolder>
<template #label>Wall E</template>
<XWallOption :options="options.walls.e" @update="v => { update({ walls: { ...options.walls, e: v } }); }"></XWallOption>
<MkFolder>
<template #label>Pillar NE</template>
<XPillarOption :options="options.pillars.ne" @update="v => { update({ pillars: { ...options.pillars, ne: v } }); }"></XPillarOption>
</MkFolder>
<MkFolder>
<template #label>Pillar SW</template>
<XPillarOption :options="options.pillars.sw" @update="v => { update({ pillars: { ...options.pillars, sw: v } }); }"></XPillarOption>
</MkFolder>
<MkFolder>
<template #label>Pillar SE</template>
<XPillarOption :options="options.pillars.se" @update="v => { update({ pillars: { ...options.pillars, se: v } }); }"></XPillarOption>
</MkFolder>
</div>
</MkFolder>
<MkFolder>
@@ -64,6 +96,7 @@ SPDX-License-Identifier: AGPL-3.0-only
<script lang="ts" setup>
import { computed, defineAsyncComponent, nextTick, onMounted, onUnmounted, ref, shallowRef, useTemplateRef, watch } from 'vue';
import XWallOption from './room.default-heya-wall-options.vue';
import XPillarOption from './room.default-heya-pillar-options.vue';
import type { ObjectDef } from '@/world/room/object.js';
import type { SimpleHeyaOptions } from '@/world/room/heya.js';
import { i18n } from '@/i18n.js';

View File

@@ -0,0 +1,57 @@
<!--
SPDX-FileCopyrightText: syuilo and misskey-project
SPDX-License-Identifier: AGPL-3.0-only
-->
<template>
<div :class="$style.root">
<div class="_gaps">
<MkSelect
:items="[
{ label: 'None', value: null },
{ label: 'Wood', value: 'wood' },
{ label: 'Concrete', value: 'concrete' },
]" :modelValue="options.material" @update:modelValue="v => { update({ material: v }); }"
>
<template #label>wallpaper</template>
</MkSelect>
<MkInput :modelValue="getHex(options.color)" type="color" @update:modelValue="v => { const c = getRgb(v); if (c != null) update({ color: c }); }">
<template #label>color</template>
</MkInput>
<MkSwitch :modelValue="options.show" @update:modelValue="v => { update({ show: v }); }">
<template #label>show</template>
</MkSwitch>
</div>
</div>
</template>
<script lang="ts" setup>
import { computed, defineAsyncComponent, nextTick, onMounted, onUnmounted, ref, shallowRef, useTemplateRef, watch } from 'vue';
import type { ObjectDef } from '@/world/room/object.js';
import type { SimpleHeyaOptions } from '@/world/room/heya.js';
import { i18n } from '@/i18n.js';
import MkButton from '@/components/MkButton.vue';
import MkSelect from '@/components/MkSelect.vue';
import * as os from '@/os.js';
import MkInput from '@/components/MkInput.vue';
import MkSwitch from '@/components/MkSwitch.vue';
import MkRange from '@/components/MkRange.vue';
import { getHex, getRgb } from '@/world/utility.js';
const props = defineProps<{
options: SimpleHeyaOptions['pillars']['nw' | 'ne' | 'sw' | 'se'];
}>();
const emit = defineEmits<{
(ev: 'update', v: SimpleHeyaOptions['pillars']['nw' | 'ne' | 'sw' | 'se']): void;
}>();
function update(v: Partial<SimpleHeyaOptions['pillars']['nw' | 'ne' | 'sw' | 'se']>) {
emit('update', { ...props.options, ...v });
}
</script>
<style lang="scss" module>
.root {
}
</style>

View File

@@ -207,6 +207,28 @@ const data = localStorage.getItem('roomData') != null ? JSON.parse(localStorage.
withHabaki: false,
},
},
pillars: {
nw: {
material: null,
color: [0.9, 0.9, 0.9],
show: false,
},
ne: {
material: null,
color: [0.9, 0.9, 0.9],
show: false,
},
sw: {
material: null,
color: [0.9, 0.9, 0.9],
show: false,
},
se: {
material: null,
color: [0.9, 0.9, 0.9],
show: false,
},
},
flooring: {
material: 'wood',
color: [0.9, 0.9, 0.9],
@@ -257,6 +279,30 @@ if (data.heya.options.walls == null) {
},
};
}
if (data.heya.options.pillars == null) {
data.heya.options.pillars = {
nw: {
material: null,
color: [0.9, 0.9, 0.9],
show: false,
},
ne: {
material: null,
color: [0.9, 0.9, 0.9],
show: false,
},
sw: {
material: null,
color: [0.9, 0.9, 0.9],
show: false,
},
se: {
material: null,
color: [0.9, 0.9, 0.9],
show: false,
},
};
}
let latestData = deepClone(data);