decord/alpha/source/modules/games/getGameMediaRefURL.tsx

61 lines
1.7 KiB
TypeScript
Raw Normal View History

2026-10-09 10:00:15 +00:00
// Module ID: 2030
// Function ID: 2031
2026-07-20 16:05:17 +00:00
// Name: getGameMediaRefURL
2026-10-09 10:00:15 +00:00
// Dependencies: [2031, 1415, 2035, 2]
2026-07-20 16:05:17 +00:00
// Exports: default
2026-10-09 10:00:15 +00:00
// Module 2030 (getGameMediaRefURL)
import AvatarUtilsDefault from "AvatarUtils" /* 1415 */;
import StringUtils from "StringUtils" /* 2031 */;
import ImageProxyUtils from "ImageProxyUtils" /* 2035 */;
2026-10-03 08:58:59 +00:00
import size_mod from "module_2" /* 2 */;
2026-08-24 06:08:38 +00:00
2026-10-03 08:58:59 +00:00
let size = size_mod;
const result = size.fileFinishedImporting("modules/games/getGameMediaRefURL.tsx");
2026-07-20 16:05:17 +00:00
export default function getGameMediaRefURL(id, type, size) {
2026-10-03 08:58:59 +00:00
let format;
let keepAspectRatio;
2026-07-20 16:05:17 +00:00
if (null == type) {
return null;
} else {
type = type.type;
if ("hash" === type) {
2026-10-03 08:58:59 +00:00
let tmp9 = null;
const obj2 = StringUtils;
if (!obj2.isNullOrEmpty(type.value)) {
const obj3 = { id, hash: type.value };
const getGameAssetURL = AvatarUtilsDefault.getGameAssetURL;
AvatarUtilsDefault;
2026-07-20 16:05:17 +00:00
const merged = Object.assign(size);
2026-10-03 08:58:59 +00:00
let gameAssetURL = getGameAssetURL(obj3);
2026-07-29 08:29:29 +00:00
if (gameAssetURL == null) {
gameAssetURL = null;
2026-07-20 16:05:17 +00:00
}
2026-10-03 08:58:59 +00:00
tmp9 = gameAssetURL;
2026-07-20 16:05:17 +00:00
}
2026-10-03 08:58:59 +00:00
return tmp9;
2026-07-20 16:05:17 +00:00
} else if ("url" === type) {
size = undefined;
2026-10-03 08:58:59 +00:00
const getSizedImageAssetURL = ImageProxyUtils.getSizedImageAssetURL;
const value = type.value;
ImageProxyUtils;
2026-07-29 08:29:29 +00:00
if (size != null) {
2026-07-20 16:05:17 +00:00
size = size.size;
}
2026-10-03 08:58:59 +00:00
const obj = { size, keepAspectRatio, format };
keepAspectRatio = undefined;
2026-07-29 08:29:29 +00:00
if (size != null) {
2026-07-20 16:05:17 +00:00
keepAspectRatio = size.keepAspectRatio;
}
2026-10-03 08:58:59 +00:00
format = undefined;
2026-08-25 06:04:03 +00:00
if (size != null) {
format = size.format;
}
2026-10-03 08:58:59 +00:00
return getSizedImageAssetURL(value, obj);
2026-07-20 16:05:17 +00:00
} else {
return null;
}
}
};