mirror of
https://github.com/misskey-dev/misskey.git
synced 2026-03-21 03:30:42 +00:00
wip
This commit is contained in:
Binary file not shown.
Binary file not shown.
@@ -40,6 +40,7 @@ import { openedCardboardBox } from './objects/openedCardboardBox.js';
|
||||
import { pachira } from './objects/pachira.js';
|
||||
import { pc } from './objects/pc.js';
|
||||
import { petBottle } from './objects/petBottle.js';
|
||||
import { pictureFrame } from './objects/pictureFrame.js';
|
||||
import { plant } from './objects/plant.js';
|
||||
import { plant2 } from './objects/plant2.js';
|
||||
import { powerStrip } from './objects/powerStrip.js';
|
||||
@@ -94,6 +95,7 @@ export const OBJECT_DEFS = [
|
||||
pachira,
|
||||
pc,
|
||||
petBottle,
|
||||
pictureFrame,
|
||||
plant,
|
||||
plant2,
|
||||
powerStrip,
|
||||
|
||||
44
packages/frontend/src/utility/room/objects/pictureFrame.ts
Normal file
44
packages/frontend/src/utility/room/objects/pictureFrame.ts
Normal file
@@ -0,0 +1,44 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: syuilo and misskey-project
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
|
||||
import * as BABYLON from '@babylonjs/core';
|
||||
import { defineObject } from '../engine.js';
|
||||
|
||||
export const pictureFrame = defineObject({
|
||||
id: 'pictureFrame',
|
||||
name: 'Picture Frame',
|
||||
options: {
|
||||
schema: {
|
||||
frameColor: {
|
||||
type: 'color',
|
||||
label: 'Frame color',
|
||||
},
|
||||
},
|
||||
default: {
|
||||
frameColor: [0.71, 0.58, 0.39],
|
||||
},
|
||||
},
|
||||
placement: 'side',
|
||||
createInstance: ({ room, root, options, findMaterial }) => {
|
||||
const frameMaterial = findMaterial('__X_FRAME__');
|
||||
|
||||
const applyFrameColor = () => {
|
||||
const [r, g, b] = options.frameColor;
|
||||
frameMaterial.albedoColor = new BABYLON.Color3(r, g, b);
|
||||
};
|
||||
|
||||
applyFrameColor();
|
||||
|
||||
return {
|
||||
onInited: () => {
|
||||
|
||||
},
|
||||
onOptionsUpdated: ([k, v]) => {
|
||||
applyFrameColor();
|
||||
},
|
||||
interactions: {},
|
||||
};
|
||||
},
|
||||
});
|
||||
Reference in New Issue
Block a user