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

53 lines
1.5 KiB
TypeScript
Raw Normal View History

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