mirror of
https://github.com/misskey-dev/misskey.git
synced 2026-05-28 10:04:43 +02:00
wip
This commit is contained in:
Binary file not shown.
Binary file not shown.
@@ -12,6 +12,10 @@ export const tv = defineObject({
|
|||||||
name: 'TV',
|
name: 'TV',
|
||||||
options: {
|
options: {
|
||||||
schema: {
|
schema: {
|
||||||
|
bodyColor: {
|
||||||
|
type: 'color',
|
||||||
|
label: 'Body color',
|
||||||
|
},
|
||||||
screenBrightness: {
|
screenBrightness: {
|
||||||
type: 'range',
|
type: 'range',
|
||||||
label: 'Screen brightness',
|
label: 'Screen brightness',
|
||||||
@@ -21,6 +25,7 @@ export const tv = defineObject({
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
default: {
|
default: {
|
||||||
|
bodyColor: [0, 0, 0],
|
||||||
screenBrightness: 0.5,
|
screenBrightness: 0.5,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@@ -51,9 +56,19 @@ export const tv = defineObject({
|
|||||||
|
|
||||||
applyScreenBrightness();
|
applyScreenBrightness();
|
||||||
|
|
||||||
|
const bodyMaterial = model.findMaterial('__X_BODY__');
|
||||||
|
|
||||||
|
const applyBodyColor = () => {
|
||||||
|
const [r, g, b] = options.bodyColor;
|
||||||
|
bodyMaterial.albedoColor = new BABYLON.Color3(r, g, b);
|
||||||
|
};
|
||||||
|
|
||||||
|
applyBodyColor();
|
||||||
|
|
||||||
return {
|
return {
|
||||||
onOptionsUpdated: ([k, v]) => {
|
onOptionsUpdated: ([k, v]) => {
|
||||||
switch (k) {
|
switch (k) {
|
||||||
|
case 'bodyColor': applyBodyColor(); break;
|
||||||
case 'screenBrightness': applyScreenBrightness(); break;
|
case 'screenBrightness': applyScreenBrightness(); break;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user