mirror of
https://github.com/misskey-dev/misskey.git
synced 2026-06-04 21:44:09 +02:00
wip
This commit is contained in:
@@ -84,13 +84,21 @@ export const allInOnePc = defineObject({
|
|||||||
|
|
||||||
applyFit();
|
applyFit();
|
||||||
|
|
||||||
|
const applyScreenBrightness = () => {
|
||||||
|
const b = options.screenBrightness;
|
||||||
|
screenMaterial.emissiveColor = new BABYLON.Color3(b, b, b);
|
||||||
|
light.intensity = (5 * b) * WORLD_SCALE * WORLD_SCALE;
|
||||||
|
};
|
||||||
|
|
||||||
|
applyScreenBrightness();
|
||||||
|
|
||||||
const applyCustomPicture = () => new Promise<void>((resolve) => {
|
const applyCustomPicture = () => new Promise<void>((resolve) => {
|
||||||
if (options.customPicture != null) {
|
if (options.customPicture != null) {
|
||||||
screenMaterial.unfreeze();
|
screenMaterial.unfreeze();
|
||||||
const tex = new BABYLON.Texture(options.customPicture, scene, false, false, undefined, () => {
|
const tex = new BABYLON.Texture(options.customPicture, scene, false, false, undefined, () => {
|
||||||
screenMaterial.emissiveColor = new BABYLON.Color3(1, 1, 1);
|
|
||||||
screenMaterial.emissiveTexture = tex;
|
screenMaterial.emissiveTexture = tex;
|
||||||
applyFit();
|
applyFit();
|
||||||
|
applyScreenBrightness();
|
||||||
resolve();
|
resolve();
|
||||||
}, (message, exception) => {
|
}, (message, exception) => {
|
||||||
console.warn('Failed to load texture:', message, exception);
|
console.warn('Failed to load texture:', message, exception);
|
||||||
@@ -107,14 +115,6 @@ export const allInOnePc = defineObject({
|
|||||||
|
|
||||||
await applyCustomPicture();
|
await applyCustomPicture();
|
||||||
|
|
||||||
const applyScreenBrightness = () => {
|
|
||||||
const b = options.screenBrightness;
|
|
||||||
screenMaterial.emissiveColor = new BABYLON.Color3(b, b, b);
|
|
||||||
light.intensity = (5 * b) * WORLD_SCALE * WORLD_SCALE;
|
|
||||||
};
|
|
||||||
|
|
||||||
applyScreenBrightness();
|
|
||||||
|
|
||||||
const applyBodyColor = () => {
|
const applyBodyColor = () => {
|
||||||
const [r, g, b] = options.bodyColor;
|
const [r, g, b] = options.bodyColor;
|
||||||
bodyMaterial.albedoColor = new BABYLON.Color3(r, g, b);
|
bodyMaterial.albedoColor = new BABYLON.Color3(r, g, b);
|
||||||
|
|||||||
@@ -60,13 +60,20 @@ export const djPlayer = defineObject({
|
|||||||
|
|
||||||
applyFit();
|
applyFit();
|
||||||
|
|
||||||
|
const applyScreenBrightness = () => {
|
||||||
|
const b = options.screenBrightness;
|
||||||
|
screenMaterial.emissiveColor = new BABYLON.Color3(b, b, b);
|
||||||
|
};
|
||||||
|
|
||||||
|
applyScreenBrightness();
|
||||||
|
|
||||||
const applyCustomPicture = () => new Promise<void>((resolve) => {
|
const applyCustomPicture = () => new Promise<void>((resolve) => {
|
||||||
if (options.customPicture != null && options.customPicture !== '') {
|
if (options.customPicture != null && options.customPicture !== '') {
|
||||||
screenMaterial.unfreeze();
|
screenMaterial.unfreeze();
|
||||||
const tex = new BABYLON.Texture(options.customPicture, scene, false, false, undefined, () => {
|
const tex = new BABYLON.Texture(options.customPicture, scene, false, false, undefined, () => {
|
||||||
screenMaterial.emissiveColor = new BABYLON.Color3(1, 1, 1);
|
|
||||||
screenMaterial.emissiveTexture = tex;
|
screenMaterial.emissiveTexture = tex;
|
||||||
applyFit();
|
applyFit();
|
||||||
|
applyScreenBrightness();
|
||||||
resolve();
|
resolve();
|
||||||
}, (message, exception) => {
|
}, (message, exception) => {
|
||||||
console.warn('Failed to load texture:', message, exception);
|
console.warn('Failed to load texture:', message, exception);
|
||||||
@@ -84,13 +91,6 @@ export const djPlayer = defineObject({
|
|||||||
|
|
||||||
await applyCustomPicture();
|
await applyCustomPicture();
|
||||||
|
|
||||||
const applyScreenBrightness = () => {
|
|
||||||
const b = options.screenBrightness;
|
|
||||||
screenMaterial.emissiveColor = new BABYLON.Color3(b, b, b);
|
|
||||||
};
|
|
||||||
|
|
||||||
applyScreenBrightness();
|
|
||||||
|
|
||||||
return {
|
return {
|
||||||
onOptionsUpdated: ([k, v]) => {
|
onOptionsUpdated: ([k, v]) => {
|
||||||
switch (k) {
|
switch (k) {
|
||||||
|
|||||||
@@ -45,6 +45,7 @@ export const electronicDisplayBoard = defineObject({
|
|||||||
|
|
||||||
const tex = new BABYLON.Texture('/client-assets/room/textures/dot-matrix-chars.png', scene, false, false, undefined, () => {
|
const tex = new BABYLON.Texture('/client-assets/room/textures/dot-matrix-chars.png', scene, false, false, undefined, () => {
|
||||||
tex.level = 2;
|
tex.level = 2;
|
||||||
|
textMaterial.emissiveColor = new BABYLON.Color3(1, 1, 1);
|
||||||
textMaterial.emissiveTexture = tex;
|
textMaterial.emissiveTexture = tex;
|
||||||
textMaterial.albedoTexture = tex;
|
textMaterial.albedoTexture = tex;
|
||||||
textMaterial.disableLighting = true;
|
textMaterial.disableLighting = true;
|
||||||
|
|||||||
@@ -94,13 +94,21 @@ export const laptopPc = defineObject({
|
|||||||
|
|
||||||
applyFit();
|
applyFit();
|
||||||
|
|
||||||
|
const applyScreenBrightness = () => {
|
||||||
|
const b = options.screenBrightness;
|
||||||
|
screenMaterial.emissiveColor = new BABYLON.Color3(b, b, b);
|
||||||
|
light.intensity = (2 * b) * WORLD_SCALE * WORLD_SCALE;
|
||||||
|
};
|
||||||
|
|
||||||
|
applyScreenBrightness();
|
||||||
|
|
||||||
const applyCustomPicture = () => new Promise<void>((resolve) => {
|
const applyCustomPicture = () => new Promise<void>((resolve) => {
|
||||||
if (options.customPicture != null) {
|
if (options.customPicture != null) {
|
||||||
screenMaterial.unfreeze();
|
screenMaterial.unfreeze();
|
||||||
const tex = new BABYLON.Texture(options.customPicture, scene, false, false, undefined, () => {
|
const tex = new BABYLON.Texture(options.customPicture, scene, false, false, undefined, () => {
|
||||||
screenMaterial.emissiveColor = new BABYLON.Color3(1, 1, 1);
|
|
||||||
screenMaterial.emissiveTexture = tex;
|
screenMaterial.emissiveTexture = tex;
|
||||||
applyFit();
|
applyFit();
|
||||||
|
applyScreenBrightness();
|
||||||
resolve();
|
resolve();
|
||||||
}, (message, exception) => {
|
}, (message, exception) => {
|
||||||
console.warn('Failed to load texture:', message, exception);
|
console.warn('Failed to load texture:', message, exception);
|
||||||
@@ -117,14 +125,6 @@ export const laptopPc = defineObject({
|
|||||||
|
|
||||||
await applyCustomPicture();
|
await applyCustomPicture();
|
||||||
|
|
||||||
const applyScreenBrightness = () => {
|
|
||||||
const b = options.screenBrightness;
|
|
||||||
screenMaterial.emissiveColor = new BABYLON.Color3(b, b, b);
|
|
||||||
light.intensity = (2 * b) * WORLD_SCALE * WORLD_SCALE;
|
|
||||||
};
|
|
||||||
|
|
||||||
applyScreenBrightness();
|
|
||||||
|
|
||||||
const applyBodyColor = () => {
|
const applyBodyColor = () => {
|
||||||
const [r, g, b] = options.bodyColor;
|
const [r, g, b] = options.bodyColor;
|
||||||
bodyMaterial.albedoColor = new BABYLON.Color3(r, g, b);
|
bodyMaterial.albedoColor = new BABYLON.Color3(r, g, b);
|
||||||
|
|||||||
@@ -79,6 +79,14 @@ export const monitor = defineObject({
|
|||||||
|
|
||||||
applyFit();
|
applyFit();
|
||||||
|
|
||||||
|
const applyScreenBrightness = () => {
|
||||||
|
const b = options.screenBrightness;
|
||||||
|
screenMaterial.emissiveColor = new BABYLON.Color3(b, b, b);
|
||||||
|
light.intensity = (5 * b) * WORLD_SCALE * WORLD_SCALE;
|
||||||
|
};
|
||||||
|
|
||||||
|
applyScreenBrightness();
|
||||||
|
|
||||||
const applyCustomPicture = () => new Promise<void>((resolve) => {
|
const applyCustomPicture = () => new Promise<void>((resolve) => {
|
||||||
if (options.customPicture != null) {
|
if (options.customPicture != null) {
|
||||||
screenMaterial.unfreeze();
|
screenMaterial.unfreeze();
|
||||||
@@ -86,6 +94,7 @@ export const monitor = defineObject({
|
|||||||
screenMaterial.emissiveColor = new BABYLON.Color3(1, 1, 1);
|
screenMaterial.emissiveColor = new BABYLON.Color3(1, 1, 1);
|
||||||
screenMaterial.emissiveTexture = tex;
|
screenMaterial.emissiveTexture = tex;
|
||||||
applyFit();
|
applyFit();
|
||||||
|
applyScreenBrightness();
|
||||||
resolve();
|
resolve();
|
||||||
}, (message, exception) => {
|
}, (message, exception) => {
|
||||||
console.warn('Failed to load texture:', message, exception);
|
console.warn('Failed to load texture:', message, exception);
|
||||||
@@ -102,14 +111,6 @@ export const monitor = defineObject({
|
|||||||
|
|
||||||
await applyCustomPicture();
|
await applyCustomPicture();
|
||||||
|
|
||||||
const applyScreenBrightness = () => {
|
|
||||||
const b = options.screenBrightness;
|
|
||||||
screenMaterial.emissiveColor = new BABYLON.Color3(b, b, b);
|
|
||||||
light.intensity = (5 * b) * WORLD_SCALE * WORLD_SCALE;
|
|
||||||
};
|
|
||||||
|
|
||||||
applyScreenBrightness();
|
|
||||||
|
|
||||||
const applyBodyColor = () => {
|
const applyBodyColor = () => {
|
||||||
const [r, g, b] = options.bodyColor;
|
const [r, g, b] = options.bodyColor;
|
||||||
bodyMaterial.albedoColor = new BABYLON.Color3(r, g, b);
|
bodyMaterial.albedoColor = new BABYLON.Color3(r, g, b);
|
||||||
|
|||||||
Reference in New Issue
Block a user