mirror of
https://github.com/misskey-dev/misskey.git
synced 2026-05-20 19:55:28 +02:00
Update ironWoodShelf.ts
This commit is contained in:
@@ -16,14 +16,20 @@ export const ironWoodShelfH = defineObject({
|
|||||||
type: 'color',
|
type: 'color',
|
||||||
label: 'Frame color',
|
label: 'Frame color',
|
||||||
},
|
},
|
||||||
|
boardColor: {
|
||||||
|
type: 'color',
|
||||||
|
label: 'Board color',
|
||||||
|
},
|
||||||
},
|
},
|
||||||
default: {
|
default: {
|
||||||
frameColor: [0.2, 0.2, 0.2],
|
frameColor: [0.2, 0.2, 0.2],
|
||||||
|
boardColor: [0.8, 0.4, 0.1],
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
placement: 'floor',
|
placement: 'floor',
|
||||||
createInstance: ({ options, model }) => {
|
createInstance: ({ options, model }) => {
|
||||||
const frameMaterial = model.findMaterial('__X_FRAME__');
|
const frameMaterial = model.findMaterial('__X_FRAME__');
|
||||||
|
const boardMaterial = model.findMaterial('__X_BOARD__');
|
||||||
|
|
||||||
const applyFrameColor = () => {
|
const applyFrameColor = () => {
|
||||||
const [r, g, b] = options.frameColor;
|
const [r, g, b] = options.frameColor;
|
||||||
@@ -32,9 +38,17 @@ export const ironWoodShelfH = defineObject({
|
|||||||
|
|
||||||
applyFrameColor();
|
applyFrameColor();
|
||||||
|
|
||||||
|
const applyBoardColor = () => {
|
||||||
|
const [r, g, b] = options.boardColor;
|
||||||
|
boardMaterial.albedoColor = new BABYLON.Color3(r, g, b);
|
||||||
|
};
|
||||||
|
|
||||||
|
applyBoardColor();
|
||||||
|
|
||||||
return {
|
return {
|
||||||
onOptionsUpdated: ([k, v]) => {
|
onOptionsUpdated: ([k, v]) => {
|
||||||
applyFrameColor();
|
applyFrameColor();
|
||||||
|
applyBoardColor();
|
||||||
},
|
},
|
||||||
interactions: {},
|
interactions: {},
|
||||||
};
|
};
|
||||||
@@ -51,14 +65,20 @@ export const ironWoodShelfV = defineObject({
|
|||||||
type: 'color',
|
type: 'color',
|
||||||
label: 'Frame color',
|
label: 'Frame color',
|
||||||
},
|
},
|
||||||
|
boardColor: {
|
||||||
|
type: 'color',
|
||||||
|
label: 'Board color',
|
||||||
|
},
|
||||||
},
|
},
|
||||||
default: {
|
default: {
|
||||||
frameColor: [0.2, 0.2, 0.2],
|
frameColor: [0.2, 0.2, 0.2],
|
||||||
|
boardColor: [0.8, 0.4, 0.1],
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
placement: 'floor',
|
placement: 'floor',
|
||||||
createInstance: ({ options, model }) => {
|
createInstance: ({ options, model }) => {
|
||||||
const frameMaterial = model.findMaterial('__X_FRAME__');
|
const frameMaterial = model.findMaterial('__X_FRAME__');
|
||||||
|
const boardMaterial = model.findMaterial('__X_BOARD__');
|
||||||
|
|
||||||
const applyFrameColor = () => {
|
const applyFrameColor = () => {
|
||||||
const [r, g, b] = options.frameColor;
|
const [r, g, b] = options.frameColor;
|
||||||
@@ -67,9 +87,17 @@ export const ironWoodShelfV = defineObject({
|
|||||||
|
|
||||||
applyFrameColor();
|
applyFrameColor();
|
||||||
|
|
||||||
|
const applyBoardColor = () => {
|
||||||
|
const [r, g, b] = options.boardColor;
|
||||||
|
boardMaterial.albedoColor = new BABYLON.Color3(r, g, b);
|
||||||
|
};
|
||||||
|
|
||||||
|
applyBoardColor();
|
||||||
|
|
||||||
return {
|
return {
|
||||||
onOptionsUpdated: ([k, v]) => {
|
onOptionsUpdated: ([k, v]) => {
|
||||||
applyFrameColor();
|
applyFrameColor();
|
||||||
|
applyBoardColor();
|
||||||
},
|
},
|
||||||
interactions: {},
|
interactions: {},
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user