Skipped 1 file(s) >100MB (GitHub limit): source/__polyfill/04xxx/module_4790.js (118.4 MB)
69 lines
2.7 KiB
TypeScript
69 lines
2.7 KiB
TypeScript
// Module ID: 17469
|
|
// Function ID: 17470
|
|
// Name: GuildRoomSpatialAudio
|
|
// Dependencies: [502, 4763, 4767, 4768, 504, 4805, 2]
|
|
// Exports: computeLivingRoomWorldPoints, livingRoomWorldPointToMediaEnginePoint, useGuildRoomSpatialAudio
|
|
|
|
// Module 17469 (GuildRoomSpatialAudio)
|
|
import initialize from "initialize" /* 504 */;
|
|
import GuildRoomsExperiment from "GuildRoomsExperiment" /* 4805 */;
|
|
import AuthenticationStore from "AuthenticationStore" /* 502 */;
|
|
import GuildRoomStore from "GuildRoomStore" /* 4763 */;
|
|
|
|
require = fn;
|
|
const GuildRoomConstants = fn(4767);
|
|
({ GUILD_ROOM_BACKGROUND_CONFIG: closure_4, GUILD_ROOM_SPATIAL_AUDIO_MODE } = GuildRoomConstants);
|
|
let c5 = false;
|
|
let closure_6 = { x: 50, y: 50 };
|
|
const size = fn(2);
|
|
const result = size.fileFinishedImporting("modules/guild_rooms/GuildRoomSpatialAudio.tsx");
|
|
|
|
export const GUILD_ROOM_SPATIAL_AUDIO_ENABLED = false;
|
|
export const computeLivingRoomWorldPoints = function computeLivingRoomWorldPoints(channelId) {
|
|
({ users, currentUserId } = channelId);
|
|
let aspectRatio;
|
|
value = users.get(currentUserId);
|
|
let position;
|
|
if (value != null) {
|
|
position = value.position;
|
|
}
|
|
if (position == null) {
|
|
position = null;
|
|
}
|
|
const room = GuildRoomStore.getRoom(channelId.channelId);
|
|
let background;
|
|
if (room != null) {
|
|
background = room.background;
|
|
}
|
|
if (background == null) {
|
|
background = currentUserId(position[3]).GuildRoomBackgrounds.DEFAULT;
|
|
}
|
|
aspectRatio = closure_4[background].aspectRatio;
|
|
let items = [...users.values()];
|
|
const found = items.filter((userId) => userId.userId !== currentUserId);
|
|
return Object.fromEntries(found.map((position) => {
|
|
position = position.position;
|
|
const items = [position.userId, ];
|
|
let point = position;
|
|
if (position == null) {
|
|
point = closure_6;
|
|
}
|
|
items[1] = { worldX: (position.x - point.x) / 100 * aspectRatio * 8, worldY: 0, worldZ: 8 * ((position.y - point.y) / 100) };
|
|
return items;
|
|
}));
|
|
};
|
|
export const livingRoomWorldPointToMediaEnginePoint = function livingRoomWorldPointToMediaEnginePoint(worldX) {
|
|
const point = { x: worldX.worldX, y: worldX.worldY, z: worldX.worldZ };
|
|
return point;
|
|
};
|
|
export const useGuildRoomSpatialAudio = function useGuildRoomSpatialAudio(arg0) {
|
|
({ channelId, guildId } = arg0);
|
|
const items = [AuthenticationStore];
|
|
const stateFromStores = initialize.useStateFromStores(items, () => id.getId());
|
|
const interactionsEnabled = GuildRoomsExperiment.useGuildRoomsExperiment({ guildId, location: "SpatialAudioPanel" }).interactionsEnabled;
|
|
const obj3 = { available, worldPoints: null };
|
|
const items1 = [GuildRoomStore];
|
|
const items2 = [false, channelId, stateFromStores];
|
|
obj3.worldPoints = initialize.useStateFromStores(items1, () => ({}), items2);
|
|
return obj3;
|
|
};
|