mirror of
https://github.com/misskey-dev/misskey.git
synced 2026-06-25 17:10:43 +00:00
wip
This commit is contained in:
parent
561e0c3813
commit
84203630a1
10 changed files with 111 additions and 0 deletions
|
|
@ -3638,6 +3638,10 @@ _miRoom:
|
|||
side: "側面設置"
|
||||
|
||||
_furnitures:
|
||||
haniwa: "はにわ"
|
||||
_haniwa:
|
||||
bodyMat: "本体の素材"
|
||||
insideColor: "中身の色"
|
||||
woodRingFloorLamp: "リングシェードフロアランプ"
|
||||
_woodRingFloorLamp:
|
||||
shadeMat: "シェードの素材"
|
||||
|
|
|
|||
|
|
@ -114,6 +114,7 @@ import { wireNet } from './furnitures/wireNet.js';
|
|||
import { woodRingFloorLamp } from './furnitures/woodRingFloorLamp.js';
|
||||
import { woodRingsPendantLight } from './furnitures/woodRingsPendantLight.js';
|
||||
import { woodSoundAbsorbingPanel } from './furnitures/woodSoundAbsorbingPanel.js';
|
||||
import { haniwa } from './furnitures/haniwa.js';
|
||||
|
||||
export const FUNITURE_DEFS = [
|
||||
a4Case,
|
||||
|
|
@ -225,6 +226,7 @@ export const FUNITURE_DEFS = [
|
|||
wireNet,
|
||||
clippedPicture,
|
||||
wireBasket,
|
||||
haniwa,
|
||||
] as FurnitureDef[];
|
||||
|
||||
export function getFurnitureDef(type: string): FurnitureDef {
|
||||
|
|
|
|||
|
|
@ -0,0 +1,40 @@
|
|||
/*
|
||||
* SPDX-FileCopyrightText: syuilo and misskey-project
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
|
||||
import * as BABYLON from '@babylonjs/core/pure';
|
||||
import { haniwa_schema } from 'misskey-world/src/room/furnitures/haniwa.schema.js';
|
||||
import { defineFuniture } from '../furniture.js';
|
||||
|
||||
export const haniwa = defineFuniture(haniwa_schema, {
|
||||
createInstance: ({ options, model }) => {
|
||||
const bodyMaterial = model.findMaterial('__X_BODY__');
|
||||
const insideMaterial = model.findMaterial('__X_INSIDE__');
|
||||
|
||||
const applyBodyMat = () => {
|
||||
bodyMaterial.albedoColor = new BABYLON.Color3(options.bodyMat.color[0], options.bodyMat.color[1], options.bodyMat.color[2]);
|
||||
bodyMaterial.roughness = options.bodyMat.roughness;
|
||||
bodyMaterial.metallic = options.bodyMat.metallic;
|
||||
};
|
||||
|
||||
applyBodyMat();
|
||||
|
||||
const applyInsideColor = () => {
|
||||
insideMaterial.emissiveColor = new BABYLON.Color3(options.insideColor.color[0], options.insideColor.color[1], options.insideColor.color[2]);
|
||||
};
|
||||
|
||||
applyInsideMat();
|
||||
|
||||
return {
|
||||
onOptionsUpdated: ([k, v]) => {
|
||||
switch (k) {
|
||||
case 'bodyMat': applyBodyMat(); break;
|
||||
case 'insideColor': applyInsideColor(); break;
|
||||
}
|
||||
},
|
||||
interactions: {},
|
||||
dispose: () => {},
|
||||
};
|
||||
},
|
||||
});
|
||||
Binary file not shown.
Binary file not shown.
|
|
@ -112,6 +112,7 @@ import { wireNet_ui } from './furnitures/wireNet.ui.js';
|
|||
import { woodRingFloorLamp_ui } from './furnitures/woodRingFloorLamp.ui.js';
|
||||
import { woodRingsPendantLight_ui } from './furnitures/woodRingsPendantLight.ui.js';
|
||||
import { woodSoundAbsorbingPanel_ui } from './furnitures/woodSoundAbsorbingPanel.ui.js';
|
||||
import { haniwa_ui } from './furnitures/haniwa.ui.js';
|
||||
import type { FurnitureUiDef } from './defineFurnitureUi.js';
|
||||
|
||||
export const FURNITURE_UI_DEFS = {
|
||||
|
|
@ -223,6 +224,7 @@ export const FURNITURE_UI_DEFS = {
|
|||
wireNet: wireNet_ui,
|
||||
clippedPicture: clippedPicture_ui,
|
||||
wireBasket: wireBasket_ui,
|
||||
haniwa: haniwa_ui,
|
||||
} as Record<string, FurnitureUiDef>;
|
||||
|
||||
export function getFurnitureUiDef(type: string): FurnitureUiDef {
|
||||
|
|
|
|||
20
packages/frontend/src/world/room/furnitures/haniwa.ui.ts
Normal file
20
packages/frontend/src/world/room/furnitures/haniwa.ui.ts
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
/*
|
||||
* SPDX-FileCopyrightText: syuilo and misskey-project
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
|
||||
import { defineFurnitureUi } from '../defineFurnitureUi.js';
|
||||
import type { haniwa_schema } from 'misskey-world/src/room/furnitures/haniwa.schema.js';
|
||||
import { i18n } from '@/i18n.js';
|
||||
|
||||
export const haniwa_ui = defineFurnitureUi<typeof haniwa_schema>({
|
||||
name: i18n.ts._miRoom._furnitures.haniwa,
|
||||
options: {
|
||||
bodyMat: {
|
||||
label: i18n.ts._miRoom._furnitures._haniwa.bodyMat,
|
||||
},
|
||||
insideColor: {
|
||||
label: i18n.ts._miRoom._furnitures._haniwa.insideColor,
|
||||
},
|
||||
},
|
||||
});
|
||||
|
|
@ -13561,6 +13561,20 @@ export interface Locale extends ILocale {
|
|||
"side": string;
|
||||
};
|
||||
"_furnitures": {
|
||||
/**
|
||||
* はにわ
|
||||
*/
|
||||
"haniwa": string;
|
||||
"_haniwa": {
|
||||
/**
|
||||
* 本体の素材
|
||||
*/
|
||||
"bodyMat": string;
|
||||
/**
|
||||
* 中身の色
|
||||
*/
|
||||
"insideColor": string;
|
||||
};
|
||||
/**
|
||||
* リングシェードフロアランプ
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -112,6 +112,7 @@ import { wireNet_schema } from './furnitures/wireNet.schema.js';
|
|||
import { woodRingFloorLamp_schema } from './furnitures/woodRingFloorLamp.schema.js';
|
||||
import { woodRingsPendantLight_schema } from './furnitures/woodRingsPendantLight.schema.js';
|
||||
import { woodSoundAbsorbingPanel_schema } from './furnitures/woodSoundAbsorbingPanel.schema.js';
|
||||
import { haniwa_schema } from './furnitures/haniwa.schema.js';
|
||||
import type { FurnitureSchemaDef } from './furniture.js';
|
||||
|
||||
export const FURNITURE_SCHEMA_DEFS = {
|
||||
|
|
@ -223,6 +224,7 @@ export const FURNITURE_SCHEMA_DEFS = {
|
|||
wireNet: wireNet_schema,
|
||||
clippedPicture: clippedPicture_schema,
|
||||
wireBasket: wireBasket_schema,
|
||||
haniwa: haniwa_schema,
|
||||
} as Record<string, FurnitureSchemaDef<any>>;
|
||||
|
||||
export function getFurnitureSchemaDef(type: string): FurnitureSchemaDef {
|
||||
|
|
|
|||
27
packages/misskey-world/src/room/furnitures/haniwa.schema.ts
Normal file
27
packages/misskey-world/src/room/furnitures/haniwa.schema.ts
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
/*
|
||||
* SPDX-FileCopyrightText: syuilo and misskey-project
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
|
||||
import { defineFurnitureSchema } from '../furniture.js';
|
||||
export const haniwa_schema = defineFurnitureSchema({
|
||||
id: 'haniwa',
|
||||
options: {
|
||||
schema: {
|
||||
bodyMat: {
|
||||
type: 'material',
|
||||
},
|
||||
insideColor: {
|
||||
type: 'color',
|
||||
},
|
||||
},
|
||||
default: {
|
||||
bodyMat: { color: [0.3, 0.3, 0.3], roughness: 0.6, metallic: 0 },
|
||||
insideColor: [1, 1, 1],
|
||||
},
|
||||
},
|
||||
placement: 'top',
|
||||
hasCollisions: false,
|
||||
hasTexture: false,
|
||||
canPreMeshesMerging: true,
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue