From b81b9e1da72aa628f0e045ebeec961beb23d300b Mon Sep 17 00:00:00 2001 From: syuilo <4439005+syuilo@users.noreply.github.com> Date: Sun, 31 May 2026 11:16:56 +0900 Subject: [PATCH] wip --- locales/ja-JP.yml | 2 + packages/frontend/src/navbar.ts | 5 + packages/frontend/src/pages/rooms/index.vue | 26 ++- .../frontend/src/pages/rooms/room.core.vue | 156 +++++++++--------- packages/i18n/src/autogen/locale.ts | 8 + 5 files changed, 120 insertions(+), 77 deletions(-) diff --git a/locales/ja-JP.yml b/locales/ja-JP.yml index 87c49d40dd..3e0a32f366 100644 --- a/locales/ja-JP.yml +++ b/locales/ja-JP.yml @@ -3563,6 +3563,7 @@ _miWorld: separateRenderingThread: "描画を別スレッドに分離" separateRenderingThread_description: "有効にするとパフォーマンスが向上します。不安定になる場合は無効すると改善する可能性があります。" graphicsQuality: "グラフィックの品質" + graphicsSettings: "グラフィック設定" frameRate: "フレームレート" resolution: "解像度" failedToInitialize: "初期化に失敗しました" @@ -3607,6 +3608,7 @@ _miRoom: exitEditMode: "エディットモードを終了" installFurniture: "家具を設置" roomCustomize: "部屋のカスタマイズ" + changeRoomName: "部屋名を編集" _objects: woodRingFloorLamp: "リングシェードフロアランプ" diff --git a/packages/frontend/src/navbar.ts b/packages/frontend/src/navbar.ts index c5b77c498a..d312bf1bb5 100644 --- a/packages/frontend/src/navbar.ts +++ b/packages/frontend/src/navbar.ts @@ -145,6 +145,11 @@ export const navbarItemDef = reactive<{ icon: 'ti ti-device-gamepad', to: '/games', }, + rooms: { + title: 'Rooms', + icon: 'ti ti-door', + to: '/rooms', + }, ui: { title: i18n.ts.switchUi, icon: 'ti ti-devices', diff --git a/packages/frontend/src/pages/rooms/index.vue b/packages/frontend/src/pages/rooms/index.vue index bf5d14516e..3082c44de5 100644 --- a/packages/frontend/src/pages/rooms/index.vue +++ b/packages/frontend/src/pages/rooms/index.vue @@ -7,12 +7,22 @@ SPDX-License-Identifier: AGPL-3.0-only
Create + + +
+
+ +
{{ room.name }}
+
+
+
+
diff --git a/packages/frontend/src/pages/rooms/room.core.vue b/packages/frontend/src/pages/rooms/room.core.vue index 52e30a2bd4..08a8b03e74 100644 --- a/packages/frontend/src/pages/rooms/room.core.vue +++ b/packages/frontend/src/pages/rooms/room.core.vue @@ -582,66 +582,22 @@ function impor() { function showOtherMenu(ev: PointerEvent) { os.popupMenu([{ - type: 'radio', - text: i18n.ts._miWorld.graphicsQuality, - caption: graphicsQualityRaw.value == null ? i18n.ts.auto : graphicsQualityRaw.value === GRAPHICS_QUALITY.HIGH ? 'High' : graphicsQualityRaw.value === GRAPHICS_QUALITY.MEDIUM ? 'Medium' : 'Low', - options: [{ - label: `${i18n.ts.auto} (${graphicsQualityAutoValue.value === GRAPHICS_QUALITY.HIGH ? 'High' : graphicsQualityAutoValue.value === GRAPHICS_QUALITY.MEDIUM ? 'Medium' : 'Low'})`, - value: null, - }, { type: 'divider' }, { - label: 'High', - value: GRAPHICS_QUALITY.HIGH, - }, { - label: 'Medium', - value: GRAPHICS_QUALITY.MEDIUM, - }, { - label: 'Low', - value: GRAPHICS_QUALITY.LOW, - }], - ref: graphicsQualityRaw, - }, { - type: 'radio', - text: i18n.ts._miWorld.frameRate, - caption: fpsRaw.value == null ? i18n.ts.auto : fpsRaw.value === 'max' ? 'Max' : `~${fpsRaw.value}fps`, - options: [{ - label: `${i18n.ts.auto} (${fpsAutoValue.value}fps)`, - value: null, - }, { type: 'divider' }, { - label: 'Max', - value: 'max', - }, { - label: '~120fps', - value: '120', - }, { - label: '~60fps', - value: '60', - }, { - label: '~30fps', - value: '30', - }], - ref: fpsRaw, - }, { - type: 'radio', - text: i18n.ts._miWorld.resolution, - caption: resolutionRaw.value == null ? i18n.ts.auto : resolutionRaw.value + 'x', - options: [{ - label: `${i18n.ts.auto} (${resolutionAutoValue.value}x)`, - value: null, - }, { type: 'divider' }, { - label: '2x', - value: 2, - }, { - label: '1x', - value: 1, - }, { - label: '0.5x', - value: 0.5, - }], - ref: resolutionRaw, - }, { - type: 'switch', - text: i18n.ts._miWorld.antialiasing, - ref: antialias, + text: i18n.ts._miRoom.changeRoomName, + icon: 'ti ti-forms', + action: async () => { + const { canceled, result } = await os.inputText({ + title: i18n.ts.name, + default: props.room.name, + }); + if (canceled) return; + + os.apiWithDialog('world/rooms/update', { + roomId: props.room.id, + name: result, + }).then(() => { + props.room.name = result; + }); + }, }, { type: 'divider', }, { @@ -650,24 +606,73 @@ function showOtherMenu(ev: PointerEvent) { }, { text: 'Import', action: impor, - }, { - text: 'Delete', - danger: true, - action: () => { - os.confirm({ - type: 'warning', - title: i18n.ts.areYouSure, - }).then(({ canceled }) => { - if (canceled) return; - - // TODO - }); - }, }, { type: 'divider', }, { - text: 'Refresh', - action: refresh, + type: 'parent', + text: i18n.ts._miWorld.graphicsSettings, + children: [{ + type: 'radio', + text: i18n.ts._miWorld.graphicsQuality, + caption: graphicsQualityRaw.value == null ? i18n.ts.auto : graphicsQualityRaw.value === GRAPHICS_QUALITY.HIGH ? 'High' : graphicsQualityRaw.value === GRAPHICS_QUALITY.MEDIUM ? 'Medium' : 'Low', + options: [{ + label: `${i18n.ts.auto} (${graphicsQualityAutoValue.value === GRAPHICS_QUALITY.HIGH ? 'High' : graphicsQualityAutoValue.value === GRAPHICS_QUALITY.MEDIUM ? 'Medium' : 'Low'})`, + value: null, + }, { type: 'divider' }, { + label: 'High', + value: GRAPHICS_QUALITY.HIGH, + }, { + label: 'Medium', + value: GRAPHICS_QUALITY.MEDIUM, + }, { + label: 'Low', + value: GRAPHICS_QUALITY.LOW, + }], + ref: graphicsQualityRaw, + }, { + type: 'radio', + text: i18n.ts._miWorld.frameRate, + caption: fpsRaw.value == null ? i18n.ts.auto : fpsRaw.value === 'max' ? 'Max' : `~${fpsRaw.value}fps`, + options: [{ + label: `${i18n.ts.auto} (${fpsAutoValue.value}fps)`, + value: null, + }, { type: 'divider' }, { + label: 'Max', + value: 'max', + }, { + label: '~120fps', + value: '120', + }, { + label: '~60fps', + value: '60', + }, { + label: '~30fps', + value: '30', + }], + ref: fpsRaw, + }, { + type: 'radio', + text: i18n.ts._miWorld.resolution, + caption: resolutionRaw.value == null ? i18n.ts.auto : resolutionRaw.value + 'x', + options: [{ + label: `${i18n.ts.auto} (${resolutionAutoValue.value}x)`, + value: null, + }, { type: 'divider' }, { + label: '2x', + value: 2, + }, { + label: '1x', + value: 1, + }, { + label: '0.5x', + value: 0.5, + }], + ref: resolutionRaw, + }, { + type: 'switch', + text: i18n.ts._miWorld.antialiasing, + ref: antialias, + }], }], ev.currentTarget ?? ev.target); } @@ -768,6 +773,7 @@ function enterOnline() { display: flex; align-items: center; gap: 16px; + pointer-events: none; } .topMenu { diff --git a/packages/i18n/src/autogen/locale.ts b/packages/i18n/src/autogen/locale.ts index e70ee1d5d6..52a356cbc9 100644 --- a/packages/i18n/src/autogen/locale.ts +++ b/packages/i18n/src/autogen/locale.ts @@ -13295,6 +13295,10 @@ export interface Locale extends ILocale { * グラフィックの品質 */ "graphicsQuality": string; + /** + * グラフィック設定 + */ + "graphicsSettings": string; /** * フレームレート */ @@ -13450,6 +13454,10 @@ export interface Locale extends ILocale { * 部屋のカスタマイズ */ "roomCustomize": string; + /** + * 部屋名を編集 + */ + "changeRoomName": string; "_objects": { /** * リングシェードフロアランプ