Merge branch 'develop' into sw-notification-action

This commit is contained in:
tamaina
2021-03-09 19:57:02 +09:00
326 changed files with 3539 additions and 526 deletions

View File

@@ -0,0 +1,41 @@
import { Ref, ref } from 'vue';
import { popup } from '@/os';
class ReactionPicker {
private src: Ref<HTMLElement | null> = ref(null);
private manualShowing = ref(false);
private onChosen?: Function;
private onClosed?: Function;
constructor() {
// nop
}
public async init() {
await popup(import('@/components/emoji-picker-dialog.vue'), {
src: this.src,
asReactionPicker: true,
manualShowing: this.manualShowing
}, {
done: reaction => {
this.onChosen!(reaction);
},
close: () => {
this.manualShowing.value = false;
},
closed: () => {
this.src.value = null;
this.onClosed!();
}
});
}
public show(src: HTMLElement, onChosen: Function, onClosed: Function) {
this.src.value = src;
this.manualShowing.value = true;
this.onChosen = onChosen;
this.onClosed = onClosed;
}
}
export const reactionPicker = new ReactionPicker();

View File

@@ -340,7 +340,7 @@ export class Room {
@autobind
private loadRoom() {
const type = this.roomInfo.roomType;
new GLTFLoader().load(`/assets/room/rooms/${type}/${type}.glb`, gltf => {
new GLTFLoader().load(`/static-assets/client/room/rooms/${type}/${type}.glb`, gltf => {
gltf.scene.traverse(child => {
if (!(child instanceof THREE.Mesh)) return;
@@ -375,7 +375,7 @@ export class Room {
const def = furnitureDefs.find(d => d.id === furniture.type);
return new Promise<GLTF>((res, rej) => {
const loader = new GLTFLoader();
loader.load(`/assets/room/furnitures/${furniture.type}/${furniture.type}.glb`, gltf => {
loader.load(`/static-assets/client/room/furnitures/${furniture.type}/${furniture.type}.glb`, gltf => {
const model = gltf.scene;
// Load animation

View File

@@ -16,7 +16,7 @@ export function playFile(file: string, volume: number) {
if (cache.has(file)) {
audio = cache.get(file);
} else {
audio = new Audio(`/assets/sounds/${file}.mp3`);
audio = new Audio(`/static-assets/client/sounds/${file}.mp3`);
cache.set(file, audio);
}
audio.volume = masterVolume - ((1 - volume) * masterVolume);