1
0
mirror of https://github.com/misskey-dev/misskey.git synced 2026-05-23 08:44:05 +02:00
This commit is contained in:
syuilo
2026-04-02 21:30:37 +09:00
parent 74c67b843e
commit b91409f5c6
7 changed files with 39 additions and 39 deletions

View File

@@ -46,7 +46,7 @@ export const allInOnePc = defineObject({
},
},
placement: 'top',
createInstance: ({ scene, options, model }) => {
createInstance: async ({ scene, options, model }) => {
const screenMesh = model.findMesh('__X_SCREEN__');
const bodyMaterial = model.findMaterial('__X_BODY__');
@@ -70,7 +70,7 @@ export const allInOnePc = defineObject({
applyFit();
const applyCustomPicture = () => {
const applyCustomPicture = () => new Promise<void>((resolve) => {
if (options.customPicture != null) {
const tex = new BABYLON.Texture(options.customPicture, scene, false, false);
tex.wrapU = BABYLON.Texture.MIRROR_ADDRESSMODE;
@@ -79,17 +79,17 @@ export const allInOnePc = defineObject({
screenMaterial.emissiveTexture = tex;
applyFit();
tex.onLoadObservable.addOnce(() => {
applyFit();
resolve();
});
} else {
screenMaterial.emissiveTexture = null;
resolve();
}
};
});
applyCustomPicture();
await applyCustomPicture();
const applyScreenBrightness = () => {
const b = options.screenBrightness;