summaryrefslogtreecommitdiff
path: root/src/client/scripts
diff options
context:
space:
mode:
authorsyuilo <Syuilotan@yahoo.co.jp>2021-03-06 23:23:54 +0900
committersyuilo <Syuilotan@yahoo.co.jp>2021-03-06 23:23:54 +0900
commitf7e9725e59dd241b11fda729cc5c96a64d7e2545 (patch)
treeca09dd961685d789efa53dad8b6eba240b643eac /src/client/scripts
parentMerge branch 'develop' (diff)
parent12.74.0 (diff)
downloadmisskey-f7e9725e59dd241b11fda729cc5c96a64d7e2545.tar.gz
misskey-f7e9725e59dd241b11fda729cc5c96a64d7e2545.tar.bz2
misskey-f7e9725e59dd241b11fda729cc5c96a64d7e2545.zip
Merge branch 'develop'
Diffstat (limited to 'src/client/scripts')
-rw-r--r--src/client/scripts/reaction-picker.ts41
-rw-r--r--src/client/scripts/room/room.ts4
-rw-r--r--src/client/scripts/sound.ts2
3 files changed, 44 insertions, 3 deletions
diff --git a/src/client/scripts/reaction-picker.ts b/src/client/scripts/reaction-picker.ts
new file mode 100644
index 0000000000..e923326ece
--- /dev/null
+++ b/src/client/scripts/reaction-picker.ts
@@ -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();
diff --git a/src/client/scripts/room/room.ts b/src/client/scripts/room/room.ts
index 45ccd59b70..8fe3ebdeb0 100644
--- a/src/client/scripts/room/room.ts
+++ b/src/client/scripts/room/room.ts
@@ -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/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/room/furnitures/${furniture.type}/${furniture.type}.glb`, gltf => {
const model = gltf.scene;
// Load animation
diff --git a/src/client/scripts/sound.ts b/src/client/scripts/sound.ts
index 176d2b68bf..bb4cfee06a 100644
--- a/src/client/scripts/sound.ts
+++ b/src/client/scripts/sound.ts
@@ -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/sounds/${file}.mp3`);
cache.set(file, audio);
}
audio.volume = masterVolume - ((1 - volume) * masterVolume);