Skipped 1 file(s) >100MB (GitHub limit): source/__polyfill/05xxx/module_5014.js (118.4 MB)
229 lines
7.2 KiB
TypeScript
229 lines
7.2 KiB
TypeScript
// Module ID: 2001
|
|
// Function ID: 2002
|
|
// Name: GameRecord
|
|
// Dependencies: [1387, 2002, 1978, 2009, 1397, 1370, 2]
|
|
|
|
// Module 2001 (GameRecord)
|
|
import GlobalUtils from "GlobalUtils" /* 1370 */;
|
|
import AvatarUtils from "AvatarUtils" /* 1397 */;
|
|
import Server from "Server" /* 1978 */;
|
|
import getGameMediaRefURLDefault from "getGameMediaRefURL" /* 2009 */;
|
|
import Record from "Record" /* 1387 */;
|
|
import ApplicationRecord from "ApplicationRecord" /* 2002 */;
|
|
|
|
require = fn;
|
|
const createExecutable = fn(2002).createExecutable;
|
|
let size = fn(2);
|
|
const result = size.fileFinishedImporting("modules/games/GameRecord.tsx");
|
|
class GameRecord extends tmp2 {
|
|
constructor(arg0) {
|
|
tmp5 = new GameRecord(tmp4, tmp3, tmp2, tmp, new.target, new.target);
|
|
({ id: tmp5.id, name: tmp5.name, description: tmp5.description, aliases } = global);
|
|
if (aliases == null) {
|
|
aliases = [];
|
|
}
|
|
tmp5.aliases = aliases;
|
|
executables = global.executables;
|
|
if (executables == null) {
|
|
executables = [];
|
|
}
|
|
tmp5.executables = executables.map(createExecutable);
|
|
flag = global.overlay;
|
|
if (flag == null) {
|
|
flag = false;
|
|
}
|
|
tmp5.overlay = flag;
|
|
flag2 = global.overlay_warn;
|
|
if (flag2 == null) {
|
|
flag2 = false;
|
|
}
|
|
tmp5.overlayWarn = flag2;
|
|
flag3 = global.overlay_compatibility_hook;
|
|
if (flag3 == null) {
|
|
flag3 = false;
|
|
}
|
|
tmp5.overlayCompatibilityHook = flag3;
|
|
flag4 = global.hook;
|
|
if (flag4 == null) {
|
|
flag4 = true;
|
|
}
|
|
tmp5.hook = flag4;
|
|
tmp5.supportsOutOfProcessOverlay = closure_3.supportsOutOfProcessOverlay(global.overlay_methods);
|
|
third_party_skus = global.third_party_skus;
|
|
if (third_party_skus == null) {
|
|
third_party_skus = [];
|
|
}
|
|
tmp5.thirdPartySkus = third_party_skus;
|
|
themes = global.themes;
|
|
if (themes == null) {
|
|
themes = [];
|
|
}
|
|
tmp5.themes = themes;
|
|
({ linked_applications: tmp5.linkedApplications, genres } = global);
|
|
if (genres == null) {
|
|
genres = [];
|
|
}
|
|
tmp5.genres = genres;
|
|
platforms = global.platforms;
|
|
if (platforms == null) {
|
|
platforms = [];
|
|
}
|
|
tmp5.platforms = platforms;
|
|
prop = global.platform_availability;
|
|
if (prop == null) {
|
|
prop = [];
|
|
}
|
|
tmp5.platformAvailability = prop;
|
|
websites = global.websites;
|
|
if (websites == null) {
|
|
websites = [];
|
|
}
|
|
tmp5.websites = websites;
|
|
({ companies: tmp5.companies, screenshot_hashes: tmp5.screenshotHashes, screenshot_urls: tmp5.screenshotUrls, trailers: tmp5.trailers, l30_rank: tmp5.l30Rank, summary_localized: tmp5.summaryLocalized, media: tmp5.media, first_release_date: tmp5.firstReleaseDate, shop_collection_ids: tmp5.shopCollectionIds, steam_release_status: tmp5.steamReleaseStatus, reviews } = global);
|
|
steam = undefined;
|
|
if (reviews != null) {
|
|
steam = reviews.steam;
|
|
}
|
|
if (null != steam) {
|
|
tmp9 = undefined;
|
|
if (null != reviews.steam) {
|
|
obj = { rating: null, ratingCount: null, recentRating: null, recentRatingCount: null, localizedRating: null, localizedRatingCount: null };
|
|
obj.rating = reviews.steam.rating;
|
|
obj.ratingCount = reviews.steam.rating_count;
|
|
obj.recentRating = reviews.steam.recent_rating;
|
|
obj.recentRatingCount = reviews.steam.recent_rating_count;
|
|
obj.localizedRating = reviews.steam.localized_rating;
|
|
obj.localizedRatingCount = reviews.steam.localized_rating_count;
|
|
tmp9 = obj;
|
|
}
|
|
obj1 = { steam: null, opencritic: null };
|
|
obj1.steam = tmp9;
|
|
tmp10 = undefined;
|
|
if (null != reviews.opencritic) {
|
|
obj4 = { topCriticRating: null, topCriticRatingCount: null, tier: null };
|
|
obj4.topCriticRating = reviews.opencritic.top_critic_rating;
|
|
obj4.topCriticRatingCount = reviews.opencritic.top_critic_rating_count;
|
|
obj4.tier = reviews.opencritic.tier;
|
|
tmp10 = obj4;
|
|
}
|
|
obj1.opencritic = tmp10;
|
|
tmp8 = obj1;
|
|
} else {
|
|
opencritic = undefined;
|
|
if (reviews != null) {
|
|
opencritic = reviews.opencritic;
|
|
}
|
|
}
|
|
tmp5.reviews = tmp8;
|
|
({ opencritic_url: tmp5.opencriticUrl, game_flags } = global);
|
|
if (game_flags == null) {
|
|
game_flags = 0;
|
|
}
|
|
tmp5.gameFlags = game_flags;
|
|
tmp5.contentClassification = global.content_classification;
|
|
return tmp5;
|
|
}
|
|
}
|
|
const prototype = GameRecord.prototype;
|
|
prototype["getOfficialApplicationId"] = function getOfficialApplicationId() {
|
|
const linkedApplications = this.linkedApplications;
|
|
let id;
|
|
if (linkedApplications != null) {
|
|
const found = linkedApplications.find((type) => type.type === Server.GameLinkTypes.OFFICIAL);
|
|
if (found != null) {
|
|
id = found.id;
|
|
}
|
|
}
|
|
return id;
|
|
};
|
|
prototype["getIconURL"] = function getIconURL(size, format) {
|
|
const media = this.media;
|
|
let icon;
|
|
if (media != null) {
|
|
icon = media.icon;
|
|
}
|
|
return getGameMediaRefURLDefault(this.id, icon, { size, format });
|
|
};
|
|
prototype["getBannerURL"] = function getBannerURL(size) {
|
|
const media = this.media;
|
|
let banner;
|
|
if (media != null) {
|
|
banner = media.banner;
|
|
}
|
|
return getGameMediaRefURLDefault(this.id, banner, { keepAspectRatio: true, size });
|
|
};
|
|
prototype["getCoverURL"] = function getCoverURL(size) {
|
|
const media = this.media;
|
|
let cover;
|
|
if (media != null) {
|
|
cover = media.cover;
|
|
}
|
|
let str = "png";
|
|
if (AvatarUtils.SUPPORTS_WEBP) {
|
|
str = "webp";
|
|
}
|
|
return getGameMediaRefURLDefault(this.id, cover, { keepAspectRatio: true, format: str, size });
|
|
};
|
|
prototype["getArtworkURLs"] = function getArtworkURLs(size) {
|
|
const self = this;
|
|
let str = null;
|
|
if (str(self[4]).SUPPORTS_WEBP) {
|
|
str = "webp";
|
|
}
|
|
const media = this.media;
|
|
let artwork;
|
|
if (media != null) {
|
|
artwork = media.artwork;
|
|
}
|
|
if (artwork == null) {
|
|
artwork = [];
|
|
}
|
|
const mapped = artwork.map((item) => getGameMediaRefURLDefault(self.id, item, { size, format: str, keepAspectRatio: true }));
|
|
return mapped.filter(str(self[5]).isNotNullish);
|
|
};
|
|
prototype["getScreenshotURL"] = function getScreenshotURL(index, size) {
|
|
const screenshotUrls = this.screenshotUrls;
|
|
let tmp;
|
|
if (screenshotUrls != null) {
|
|
tmp = screenshotUrls[index];
|
|
}
|
|
let tmp7Result = null;
|
|
if (null != tmp) {
|
|
const obj = { type: "url", value: tmp };
|
|
const obj2 = { size, format: null, keepAspectRatio: true };
|
|
let str = null;
|
|
if (AvatarUtils.SUPPORTS_WEBP) {
|
|
str = "webp";
|
|
}
|
|
obj2.format = str;
|
|
tmp7Result = getGameMediaRefURLDefault(this.id, obj, obj2);
|
|
}
|
|
return tmp7Result;
|
|
};
|
|
prototype["getScreenshotURLs"] = function getScreenshotURLs(arg0) {
|
|
const self = this;
|
|
closure_0 = arg0;
|
|
let screenshotUrls = this.screenshotUrls;
|
|
if (screenshotUrls == null) {
|
|
screenshotUrls = [];
|
|
}
|
|
const mapped = screenshotUrls.map((item, index) => self.getScreenshotURL(index, closure_0));
|
|
return mapped.filter(GlobalUtils.isNotNullish);
|
|
};
|
|
prototype["getCompanyByRole"] = function getCompanyByRole(DEVELOPER) {
|
|
closure_0 = DEVELOPER;
|
|
const companies = this.companies;
|
|
let found;
|
|
if (companies != null) {
|
|
found = companies.filter((roles) => {
|
|
roles = roles.roles;
|
|
return roles.includes(closure_0);
|
|
});
|
|
}
|
|
if (found == null) {
|
|
found = [];
|
|
}
|
|
return found;
|
|
};
|
|
|
|
export default GameRecord;
|