decord/source/modules/guild_rooms/GuildRoomSpatialAudio.tsx

71 lines
2.7 KiB
TypeScript
Raw Normal View History

2026-09-02 09:53:35 +00:00
// Module ID: 17190
// Function ID: 17191
2026-08-25 06:04:03 +00:00
// Name: GUILD_ROOM_SPATIAL_AUDIO_ENABLED
2026-09-02 09:53:35 +00:00
// Dependencies: [1215, 4679, 4683, 4684, 586, 4720, 2]
2026-08-25 06:04:03 +00:00
// Exports: computeLivingRoomWorldPoints, livingRoomWorldPointToMediaEnginePoint, useGuildRoomSpatialAudio
2026-07-20 16:05:17 +00:00
2026-09-02 09:53:35 +00:00
// Module 17190 (GUILD_ROOM_SPATIAL_AUDIO_ENABLED)
import initialize from "initialize" /* 586 */;
2026-09-01 10:26:29 +00:00
import GUILD_ROOMS_EXPERIMENT_ID from "GUILD_ROOMS_EXPERIMENT_ID" /* 4720 */;
2026-09-02 09:53:35 +00:00
import closure_2 from "fetchFingerprint" /* 1215 */;
2026-09-01 10:26:29 +00:00
import closure_3 from "resolveCreatingNotes" /* 4679 */;
import items from "items" /* 4683 */;
2026-07-23 10:11:24 +00:00
2026-08-25 06:04:03 +00:00
require = arg1;
2026-08-28 06:19:39 +00:00
({ GUILD_ROOM_BACKGROUND_CONFIG: c4, GUILD_ROOM_SPATIAL_AUDIO_MODE } = items);
let c5 = false;
let closure_6 = { x: 50, y: 50 };
2026-08-25 06:04:03 +00:00
const result = require("set").fileFinishedImporting("modules/guild_rooms/GuildRoomSpatialAudio.tsx");
export const GUILD_ROOM_SPATIAL_AUDIO_ENABLED = false;
export const computeLivingRoomWorldPoints = function computeLivingRoomWorldPoints(channelId) {
2026-07-24 07:16:23 +00:00
({ users, currentUserId } = channelId);
2026-07-29 08:29:29 +00:00
let position;
2026-07-23 10:11:24 +00:00
let aspectRatio;
2026-07-20 16:05:17 +00:00
const value = users.get(currentUserId);
2026-07-29 08:29:29 +00:00
position = undefined;
if (value != null) {
2026-07-20 16:05:17 +00:00
position = value.position;
}
2026-07-29 08:29:29 +00:00
if (position == null) {
position = null;
2026-07-20 16:05:17 +00:00
}
2026-07-24 07:16:23 +00:00
room = room.getRoom(channelId.channelId);
let background;
2026-07-29 08:29:29 +00:00
if (room != null) {
2026-07-24 07:16:23 +00:00
background = room.background;
}
2026-07-29 08:29:29 +00:00
if (background == null) {
2026-08-28 06:19:39 +00:00
background = currentUserId(position[3]).GuildRoomBackgrounds.DEFAULT;
2026-07-24 07:16:23 +00:00
}
aspectRatio = table[background].aspectRatio;
2026-07-23 10:11:24 +00:00
let items = [...users.values()];
2026-07-20 16:05:17 +00:00
const found = items.filter((userId) => userId.userId !== currentUserId);
2026-07-29 08:29:29 +00:00
return Object.fromEntries(found.map((position) => {
position = position.position;
const items = [position.userId, ];
let point = position;
if (position == null) {
2026-08-28 06:19:39 +00:00
point = closure_1_6;
2026-07-29 08:29:29 +00:00
}
items[1] = { worldX: (position.x - point.x) / 100 * aspectRatio * 8, worldY: 0, worldZ: 8 * ((position.y - point.y) / 100) };
2026-07-20 16:05:17 +00:00
return items;
}));
2026-08-25 06:04:03 +00:00
};
2026-07-20 16:05:17 +00:00
export const livingRoomWorldPointToMediaEnginePoint = function livingRoomWorldPointToMediaEnginePoint(worldX) {
return { x: worldX.worldX, y: worldX.worldY, z: worldX.worldZ };
};
2026-08-25 06:04:03 +00:00
export const useGuildRoomSpatialAudio = function useGuildRoomSpatialAudio(arg0) {
({ channelId, guildId } = arg0);
let obj = initialize;
2026-08-28 06:19:39 +00:00
const items = [closure_2];
2026-08-25 06:04:03 +00:00
const stateFromStores = obj.useStateFromStores(items, () => id.getId());
2026-08-28 06:19:39 +00:00
const interactionsEnabled = GUILD_ROOMS_EXPERIMENT_ID.useGuildRoomsExperiment({ guildId, location: "SpatialAudioPanel" }).interactionsEnabled;
obj = { available: c5, worldPoints: null };
const obj2 = GUILD_ROOMS_EXPERIMENT_ID;
const items1 = [closure_3];
2026-08-25 06:04:03 +00:00
const items2 = [false, channelId, stateFromStores];
obj[1] = initialize.useStateFromStores(items1, () => ({}), items2);
2026-07-20 16:05:17 +00:00
return obj;
};