mirror of
https://github.com/Laupetin/OpenAssetTools.git
synced 2025-11-17 18:52:06 +00:00
feat: show zone and asset statistics in modman
This commit is contained in:
@@ -45,7 +45,7 @@ enum class CommonAssetType : std::uint8_t
|
||||
// IW3, IW4, IW5, T5, T6
|
||||
FONT,
|
||||
// IW3, IW4, IW5, T5, T6
|
||||
MENULIST,
|
||||
MENU_LIST,
|
||||
// IW3, IW4, IW5, T5, T6
|
||||
MENU,
|
||||
// IW3, IW4, IW5, T5, T6
|
||||
|
||||
@@ -31,7 +31,7 @@ namespace IW3
|
||||
CommonAssetType::LIGHT_DEF, // ASSET_TYPE_LIGHT_DEF
|
||||
CommonAssetType::UI_MAP, // ASSET_TYPE_UI_MAP
|
||||
CommonAssetType::FONT, // ASSET_TYPE_FONT
|
||||
CommonAssetType::MENULIST, // ASSET_TYPE_MENULIST
|
||||
CommonAssetType::MENU_LIST, // ASSET_TYPE_MENULIST
|
||||
CommonAssetType::MENU, // ASSET_TYPE_MENU
|
||||
CommonAssetType::LOCALIZE_ENTRY, // ASSET_TYPE_LOCALIZE_ENTRY
|
||||
CommonAssetType::WEAPON, // ASSET_TYPE_WEAPON
|
||||
@@ -77,7 +77,7 @@ namespace IW3
|
||||
MAP_COMMON(CommonAssetType::LIGHT_DEF, ASSET_TYPE_LIGHT_DEF)
|
||||
MAP_COMMON(CommonAssetType::UI_MAP, ASSET_TYPE_UI_MAP)
|
||||
MAP_COMMON(CommonAssetType::FONT, ASSET_TYPE_FONT)
|
||||
MAP_COMMON(CommonAssetType::MENULIST, ASSET_TYPE_MENULIST)
|
||||
MAP_COMMON(CommonAssetType::MENU_LIST, ASSET_TYPE_MENULIST)
|
||||
MAP_COMMON(CommonAssetType::MENU, ASSET_TYPE_MENU)
|
||||
MAP_COMMON(CommonAssetType::LOCALIZE_ENTRY, ASSET_TYPE_LOCALIZE_ENTRY)
|
||||
MAP_COMMON(CommonAssetType::WEAPON, ASSET_TYPE_WEAPON)
|
||||
|
||||
@@ -36,7 +36,7 @@ namespace IW4
|
||||
CommonAssetType::LIGHT_DEF, // ASSET_TYPE_LIGHT_DEF
|
||||
CommonAssetType::UI_MAP, // ASSET_TYPE_UI_MAP
|
||||
CommonAssetType::FONT, // ASSET_TYPE_FONT
|
||||
CommonAssetType::MENULIST, // ASSET_TYPE_MENULIST
|
||||
CommonAssetType::MENU_LIST, // ASSET_TYPE_MENULIST
|
||||
CommonAssetType::MENU, // ASSET_TYPE_MENU
|
||||
CommonAssetType::LOCALIZE_ENTRY, // ASSET_TYPE_LOCALIZE_ENTRY
|
||||
CommonAssetType::WEAPON, // ASSET_TYPE_WEAPON
|
||||
@@ -92,7 +92,7 @@ namespace IW4
|
||||
MAP_COMMON(CommonAssetType::LIGHT_DEF, ASSET_TYPE_LIGHT_DEF)
|
||||
MAP_COMMON(CommonAssetType::UI_MAP, ASSET_TYPE_UI_MAP)
|
||||
MAP_COMMON(CommonAssetType::FONT, ASSET_TYPE_FONT)
|
||||
MAP_COMMON(CommonAssetType::MENULIST, ASSET_TYPE_MENULIST)
|
||||
MAP_COMMON(CommonAssetType::MENU_LIST, ASSET_TYPE_MENULIST)
|
||||
MAP_COMMON(CommonAssetType::MENU, ASSET_TYPE_MENU)
|
||||
MAP_COMMON(CommonAssetType::LOCALIZE_ENTRY, ASSET_TYPE_LOCALIZE_ENTRY)
|
||||
MAP_COMMON(CommonAssetType::WEAPON, ASSET_TYPE_WEAPON)
|
||||
|
||||
@@ -36,7 +36,7 @@ namespace IW5
|
||||
CommonAssetType::LIGHT_DEF, // ASSET_TYPE_LIGHT_DEF
|
||||
CommonAssetType::UI_MAP, // ASSET_TYPE_UI_MAP
|
||||
CommonAssetType::FONT, // ASSET_TYPE_FONT
|
||||
CommonAssetType::MENULIST, // ASSET_TYPE_MENULIST
|
||||
CommonAssetType::MENU_LIST, // ASSET_TYPE_MENULIST
|
||||
CommonAssetType::MENU, // ASSET_TYPE_MENU
|
||||
CommonAssetType::LOCALIZE_ENTRY, // ASSET_TYPE_LOCALIZE_ENTRY
|
||||
CommonAssetType::ATTACHMENT, // ASSET_TYPE_ATTACHMENT
|
||||
@@ -96,7 +96,7 @@ namespace IW5
|
||||
MAP_COMMON(CommonAssetType::LIGHT_DEF, ASSET_TYPE_LIGHT_DEF)
|
||||
MAP_COMMON(CommonAssetType::UI_MAP, ASSET_TYPE_UI_MAP)
|
||||
MAP_COMMON(CommonAssetType::FONT, ASSET_TYPE_FONT)
|
||||
MAP_COMMON(CommonAssetType::MENULIST, ASSET_TYPE_MENULIST)
|
||||
MAP_COMMON(CommonAssetType::MENU_LIST, ASSET_TYPE_MENULIST)
|
||||
MAP_COMMON(CommonAssetType::MENU, ASSET_TYPE_MENU)
|
||||
MAP_COMMON(CommonAssetType::LOCALIZE_ENTRY, ASSET_TYPE_LOCALIZE_ENTRY)
|
||||
MAP_COMMON(CommonAssetType::ATTACHMENT, ASSET_TYPE_ATTACHMENT)
|
||||
|
||||
@@ -32,7 +32,7 @@ namespace T5
|
||||
CommonAssetType::LIGHT_DEF, // ASSET_TYPE_LIGHT_DEF
|
||||
CommonAssetType::UI_MAP, // ASSET_TYPE_UI_MAP
|
||||
CommonAssetType::FONT, // ASSET_TYPE_FONT
|
||||
CommonAssetType::MENULIST, // ASSET_TYPE_MENULIST
|
||||
CommonAssetType::MENU_LIST, // ASSET_TYPE_MENULIST
|
||||
CommonAssetType::MENU, // ASSET_TYPE_MENU
|
||||
CommonAssetType::LOCALIZE_ENTRY, // ASSET_TYPE_LOCALIZE_ENTRY
|
||||
CommonAssetType::WEAPON, // ASSET_TYPE_WEAPON
|
||||
@@ -88,7 +88,7 @@ namespace T5
|
||||
MAP_COMMON(CommonAssetType::LIGHT_DEF, ASSET_TYPE_LIGHT_DEF)
|
||||
MAP_COMMON(CommonAssetType::UI_MAP, ASSET_TYPE_UI_MAP)
|
||||
MAP_COMMON(CommonAssetType::FONT, ASSET_TYPE_FONT)
|
||||
MAP_COMMON(CommonAssetType::MENULIST, ASSET_TYPE_MENULIST)
|
||||
MAP_COMMON(CommonAssetType::MENU_LIST, ASSET_TYPE_MENULIST)
|
||||
MAP_COMMON(CommonAssetType::MENU, ASSET_TYPE_MENU)
|
||||
MAP_COMMON(CommonAssetType::LOCALIZE_ENTRY, ASSET_TYPE_LOCALIZE_ENTRY)
|
||||
MAP_COMMON(CommonAssetType::WEAPON, ASSET_TYPE_WEAPON)
|
||||
|
||||
@@ -33,7 +33,7 @@ namespace T6
|
||||
CommonAssetType::UI_MAP, // ASSET_TYPE_UI_MAP
|
||||
CommonAssetType::FONT, // ASSET_TYPE_FONT
|
||||
CommonAssetType::FONT_ICON, // ASSET_TYPE_FONTICON
|
||||
CommonAssetType::MENULIST, // ASSET_TYPE_MENULIST
|
||||
CommonAssetType::MENU_LIST, // ASSET_TYPE_MENULIST
|
||||
CommonAssetType::MENU, // ASSET_TYPE_MENU
|
||||
CommonAssetType::LOCALIZE_ENTRY, // ASSET_TYPE_LOCALIZE_ENTRY
|
||||
CommonAssetType::WEAPON, // ASSET_TYPE_WEAPON
|
||||
@@ -106,7 +106,7 @@ namespace T6
|
||||
MAP_COMMON(CommonAssetType::UI_MAP, ASSET_TYPE_UI_MAP)
|
||||
MAP_COMMON(CommonAssetType::FONT, ASSET_TYPE_FONT)
|
||||
MAP_COMMON(CommonAssetType::FONT_ICON, ASSET_TYPE_FONTICON)
|
||||
MAP_COMMON(CommonAssetType::MENULIST, ASSET_TYPE_MENULIST)
|
||||
MAP_COMMON(CommonAssetType::MENU_LIST, ASSET_TYPE_MENULIST)
|
||||
MAP_COMMON(CommonAssetType::MENU, ASSET_TYPE_MENU)
|
||||
MAP_COMMON(CommonAssetType::LOCALIZE_ENTRY, ASSET_TYPE_LOCALIZE_ENTRY)
|
||||
MAP_COMMON(CommonAssetType::WEAPON, ASSET_TYPE_WEAPON)
|
||||
|
||||
@@ -11,7 +11,7 @@ namespace
|
||||
{
|
||||
std::unique_ptr<Zone> CreateZone(const ZoneCreationContext& context, const GameId gameId)
|
||||
{
|
||||
return std::make_unique<Zone>(context.m_definition->m_name, 0, gameId);
|
||||
return std::make_unique<Zone>(context.m_definition->m_name, 0, gameId, GamePlatform::PC);
|
||||
}
|
||||
|
||||
std::vector<Gdt*> CreateGdtList(const ZoneCreationContext& context)
|
||||
|
||||
@@ -27,7 +27,7 @@ NLOHMANN_JSON_SERIALIZE_ENUM(CommonAssetType,
|
||||
{CommonAssetType::LIGHT_DEF, "LIGHT_DEF" },
|
||||
{CommonAssetType::UI_MAP, "UI_MAP" },
|
||||
{CommonAssetType::FONT, "FONT" },
|
||||
{CommonAssetType::MENULIST, "MENULIST" },
|
||||
{CommonAssetType::MENU_LIST, "MENU_LIST" },
|
||||
{CommonAssetType::MENU, "MENU" },
|
||||
{CommonAssetType::LOCALIZE_ENTRY, "LOCALIZE_ENTRY" },
|
||||
{CommonAssetType::WEAPON, "WEAPON" },
|
||||
|
||||
@@ -5,6 +5,22 @@
|
||||
|
||||
#include "Json/JsonExtension.h"
|
||||
|
||||
NLOHMANN_JSON_SERIALIZE_ENUM(GameId,
|
||||
{
|
||||
{GameId::IW3, "IW3"},
|
||||
{GameId::IW4, "IW4"},
|
||||
{GameId::IW5, "IW5"},
|
||||
{GameId::T5, "T5" },
|
||||
{GameId::T6, "T6" },
|
||||
});
|
||||
|
||||
NLOHMANN_JSON_SERIALIZE_ENUM(GamePlatform,
|
||||
{
|
||||
{GamePlatform::PC, "PC" },
|
||||
{GamePlatform::XBOX, "XBOX"},
|
||||
{GamePlatform::PS3, "PS3" },
|
||||
});
|
||||
|
||||
namespace
|
||||
{
|
||||
class ZoneDto
|
||||
@@ -12,9 +28,11 @@ namespace
|
||||
public:
|
||||
std::string name;
|
||||
std::string filePath;
|
||||
GameId game;
|
||||
GamePlatform platform;
|
||||
};
|
||||
|
||||
NLOHMANN_DEFINE_TYPE_EXTENSION(ZoneDto, name, filePath);
|
||||
NLOHMANN_DEFINE_TYPE_EXTENSION(ZoneDto, name, filePath, game, platform);
|
||||
|
||||
class ZoneLoadProgressDto
|
||||
{
|
||||
@@ -46,6 +64,8 @@ namespace
|
||||
return ZoneDto{
|
||||
.name = loadedZone.m_zone->m_name,
|
||||
.filePath = loadedZone.m_file_path,
|
||||
.game = loadedZone.m_zone->m_game_id,
|
||||
.platform = loadedZone.m_zone->m_platform,
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -1,26 +1,139 @@
|
||||
<script setup lang="ts">
|
||||
import Button from "primevue/button";
|
||||
import Tag from "primevue/tag";
|
||||
import MeterGroup, { type MeterItem } from "primevue/metergroup";
|
||||
import Skeleton from "primevue/skeleton";
|
||||
import { dt } from "@primeuix/themes";
|
||||
import type { ZoneDto } from "@/native/ZoneBinds";
|
||||
import { useZoneStore } from "@/stores/ZoneStore";
|
||||
import { computed } from "vue";
|
||||
import { computed, ref, watch } from "vue";
|
||||
import type { CommonAssetType, ZoneAssetsDto } from "@/native/AssetBinds";
|
||||
import { webviewBinds } from "@/native";
|
||||
import { getAssetTypeNameCapitalized } from "@/utils/AssetTypeName";
|
||||
|
||||
const zoneStore = useZoneStore();
|
||||
|
||||
const props = defineProps<{
|
||||
selectedZone: string;
|
||||
selectedZone: string | null;
|
||||
}>();
|
||||
|
||||
const assets = ref<ZoneAssetsDto | null>(null);
|
||||
const assetCount = computed(() => assets.value?.assets.length ?? 0);
|
||||
const referenceCount = computed(() => assets.value?.references.length ?? 0);
|
||||
|
||||
const METER_COLORS = [
|
||||
dt("blue.600"),
|
||||
dt("red.600"),
|
||||
dt("yellow.600"),
|
||||
dt("green.600"),
|
||||
dt("purple.600"),
|
||||
dt("orange.600"),
|
||||
dt("teal.600"),
|
||||
dt("lime.600"),
|
||||
dt("pink.600"),
|
||||
];
|
||||
const meterItems = computed<MeterItem[]>(() => {
|
||||
const assetTypeCounts: Partial<Record<CommonAssetType, number>> = {};
|
||||
|
||||
for (const asset of assets.value?.assets ?? []) {
|
||||
if (!assetTypeCounts[asset.type]) {
|
||||
assetTypeCounts[asset.type] = 1;
|
||||
} else {
|
||||
assetTypeCounts[asset.type]!++;
|
||||
}
|
||||
}
|
||||
|
||||
// Do not display asset types with under 3 percent representation
|
||||
const minItemCountForDisplay = Math.floor(assetCount.value * 0.03);
|
||||
|
||||
const assetMeterItems: MeterItem[] = Object.entries(assetTypeCounts)
|
||||
.filter((entry) => entry[1] > minItemCountForDisplay)
|
||||
.sort((e0, e1) => e1[1] - e0[1])
|
||||
.map((entry) => ({
|
||||
label: getAssetTypeNameCapitalized(entry[0] as CommonAssetType),
|
||||
value: Math.round((entry[1] / assetCount.value) * 100),
|
||||
}));
|
||||
|
||||
// Since the PrimeVue component rounds to percent we want to fill up the bar completely
|
||||
const otherCount = 100 - assetMeterItems.reduce((val, entry) => val + entry.value, 0);
|
||||
|
||||
if (otherCount > 0) {
|
||||
assetMeterItems.push({
|
||||
label: "Other",
|
||||
value: otherCount,
|
||||
});
|
||||
}
|
||||
|
||||
return assetMeterItems.map(
|
||||
(item, index) =>
|
||||
({
|
||||
...item,
|
||||
color: METER_COLORS[index % METER_COLORS.length],
|
||||
}) satisfies MeterItem,
|
||||
);
|
||||
});
|
||||
|
||||
const selectedZoneDetails = computed<ZoneDto | null>(
|
||||
() => zoneStore.loadedZones.find((zone) => zone.name === props.selectedZone) ?? null,
|
||||
);
|
||||
|
||||
watch(
|
||||
() => props.selectedZone,
|
||||
(newValue) => {
|
||||
assets.value = null;
|
||||
if (!newValue) return;
|
||||
webviewBinds.getAssetsForZone(newValue).then((res) => {
|
||||
if (props.selectedZone === newValue) {
|
||||
assets.value = res;
|
||||
}
|
||||
});
|
||||
},
|
||||
{ immediate: true },
|
||||
);
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="zone-details">
|
||||
<h2>{{ selectedZone ?? "No zone selected" }}</h2>
|
||||
<Button label="Show assets" :disabled="!selectedZone" />
|
||||
<div v-if="selectedZoneDetails" class="zone-tags">
|
||||
<Tag :value="selectedZoneDetails.game" />
|
||||
<Tag :value="selectedZoneDetails.platform" />
|
||||
</div>
|
||||
<div class="zone-assets">
|
||||
<template v-if="assets">
|
||||
<div>{{ assetCount }} assets</div>
|
||||
<div>{{ referenceCount }} references</div>
|
||||
<MeterGroup class="asset-meter" :value="meterItems" />
|
||||
</template>
|
||||
<template v-else-if="selectedZone">
|
||||
<Skeleton class="count-skeleton" width="10em" />
|
||||
<Skeleton class="count-skeleton" width="10em" />
|
||||
<Skeleton class="count-skeleton" height="0.5lh" />
|
||||
</template>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.zone-details {
|
||||
.zone-tags {
|
||||
display: flex;
|
||||
margin-top: 0.5em;
|
||||
column-gap: 0.5em;
|
||||
row-gap: 0.5em;
|
||||
}
|
||||
|
||||
.zone-assets {
|
||||
margin-top: 0.5em;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.asset-meter {
|
||||
padding-top: 0.5em;
|
||||
}
|
||||
|
||||
.count-skeleton {
|
||||
margin-bottom: 0.5em;
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -17,7 +17,7 @@ export enum CommonAssetType {
|
||||
LIGHT_DEF = "LIGHT_DEF",
|
||||
UI_MAP = "UI_MAP",
|
||||
FONT = "FONT",
|
||||
MENULIST = "MENULIST",
|
||||
MENU_LIST = "MENU_LIST",
|
||||
MENU = "MENU",
|
||||
LOCALIZE_ENTRY = "LOCALIZE_ENTRY",
|
||||
WEAPON = "WEAPON",
|
||||
|
||||
@@ -1,6 +1,22 @@
|
||||
export enum GameId {
|
||||
IW3 = "IW3",
|
||||
IW4 = "IW4",
|
||||
IW5 = "IW5",
|
||||
T5 = "T5",
|
||||
T6 = "T6",
|
||||
}
|
||||
|
||||
export enum GamePlatform {
|
||||
PC = "PC",
|
||||
XBOX = "XBOX",
|
||||
PS3 = "PS3",
|
||||
}
|
||||
|
||||
export interface ZoneDto {
|
||||
name: string;
|
||||
filePath: string;
|
||||
game: GameId;
|
||||
platform: GamePlatform;
|
||||
}
|
||||
|
||||
export interface ZoneLoadProgressDto {
|
||||
|
||||
85
src/ModManUi/src/utils/AssetTypeName.ts
Normal file
85
src/ModManUi/src/utils/AssetTypeName.ts
Normal file
@@ -0,0 +1,85 @@
|
||||
import { CommonAssetType } from "@/native/AssetBinds";
|
||||
|
||||
const LOOKUP_CAPITALIZED: Record<CommonAssetType, string> = {
|
||||
[CommonAssetType.PHYS_PRESET]: "Phys preset",
|
||||
[CommonAssetType.XANIM]: "XAnim",
|
||||
[CommonAssetType.XMODEL]: "XModel",
|
||||
[CommonAssetType.MATERIAL]: "Material",
|
||||
[CommonAssetType.TECHNIQUE_SET]: "Technique set",
|
||||
[CommonAssetType.IMAGE]: "Image",
|
||||
[CommonAssetType.SOUND]: "Sound",
|
||||
[CommonAssetType.SOUND_CURVE]: "Sound curve",
|
||||
[CommonAssetType.LOADED_SOUND]: "Loaded sound",
|
||||
[CommonAssetType.CLIP_MAP]: "Clip map",
|
||||
[CommonAssetType.COM_WORLD]: "Com world",
|
||||
[CommonAssetType.GAME_WORLD_SP]: "Game world SP",
|
||||
[CommonAssetType.GAME_WORLD_MP]: "Game world MP",
|
||||
[CommonAssetType.MAP_ENTS]: "Map ents",
|
||||
[CommonAssetType.GFX_WORLD]: "Gfx world",
|
||||
[CommonAssetType.LIGHT_DEF]: "Light def",
|
||||
[CommonAssetType.UI_MAP]: "UI map",
|
||||
[CommonAssetType.FONT]: "Font",
|
||||
[CommonAssetType.MENU_LIST]: "Menu list",
|
||||
[CommonAssetType.MENU]: "Menu",
|
||||
[CommonAssetType.LOCALIZE_ENTRY]: "Localize entry",
|
||||
[CommonAssetType.WEAPON]: "Weapon",
|
||||
[CommonAssetType.SOUND_DRIVER_GLOBALS]: "Sound driver globals",
|
||||
[CommonAssetType.FX]: "FX",
|
||||
[CommonAssetType.IMPACT_FX]: "Impact FX",
|
||||
[CommonAssetType.AI_TYPE]: "AI type",
|
||||
[CommonAssetType.MP_TYPE]: "MP type",
|
||||
[CommonAssetType.CHARACTER]: "Character",
|
||||
[CommonAssetType.XMODEL_ALIAS]: "XModel alias",
|
||||
[CommonAssetType.RAW_FILE]: "Raw file",
|
||||
[CommonAssetType.STRING_TABLE]: "String table",
|
||||
[CommonAssetType.XMODEL_PIECES]: "XModel pieces",
|
||||
[CommonAssetType.PHYS_COLL_MAP]: "Phys coll map",
|
||||
[CommonAssetType.XMODEL_SURFS]: "XModel surfs",
|
||||
[CommonAssetType.PIXEL_SHADER]: "Pixel shader",
|
||||
[CommonAssetType.VERTEX_SHADER]: "Vertex shader",
|
||||
[CommonAssetType.VERTEX_DECL]: "Vertex decl",
|
||||
[CommonAssetType.FX_WORLD]: "FX world",
|
||||
[CommonAssetType.LEADERBOARD]: "Leaderboard",
|
||||
[CommonAssetType.STRUCTURED_DATA_DEF]: "Structured data def",
|
||||
[CommonAssetType.TRACER]: "Tracer",
|
||||
[CommonAssetType.VEHICLE]: "Vehicle",
|
||||
[CommonAssetType.ADDON_MAP_ENTS]: "Addon map ents",
|
||||
[CommonAssetType.GLASS_WORLD]: "Glass world",
|
||||
[CommonAssetType.PATH_DATA]: "Path data",
|
||||
[CommonAssetType.VEHICLE_TRACK]: "Vehicle track",
|
||||
[CommonAssetType.ATTACHMENT]: "Attachment",
|
||||
[CommonAssetType.SURFACE_FX]: "Surface FX",
|
||||
[CommonAssetType.SCRIPT]: "Script",
|
||||
[CommonAssetType.PHYS_CONSTRAINTS]: "Phys constraints",
|
||||
[CommonAssetType.DESTRUCTIBLE_DEF]: "Destructible def",
|
||||
[CommonAssetType.SOUND_PATCH]: "Sound patch",
|
||||
[CommonAssetType.WEAPON_DEF]: "Weapon def",
|
||||
[CommonAssetType.WEAPON_VARIANT]: "Weapon variant",
|
||||
[CommonAssetType.MP_BODY]: "MP body",
|
||||
[CommonAssetType.MP_HEAD]: "MP head",
|
||||
[CommonAssetType.PACK_INDEX]: "Pack index",
|
||||
[CommonAssetType.XGLOBALS]: "XGlobals",
|
||||
[CommonAssetType.DDL]: "DDL",
|
||||
[CommonAssetType.GLASSES]: "Glasses",
|
||||
[CommonAssetType.EMBLEM_SET]: "Emblem set",
|
||||
[CommonAssetType.FONT_ICON]: "Font icon",
|
||||
[CommonAssetType.WEAPON_FULL]: "Weapon full",
|
||||
[CommonAssetType.ATTACHMENT_UNIQUE]: "Attachment unique",
|
||||
[CommonAssetType.WEAPON_CAMO]: "Weapon camo",
|
||||
[CommonAssetType.KEY_VALUE_PAIRS]: "Key value pairs",
|
||||
[CommonAssetType.MEMORY_BLOCK]: "Memory block",
|
||||
[CommonAssetType.SKINNED_VERTS]: "Skinned verts",
|
||||
[CommonAssetType.QDB]: "Qdb",
|
||||
[CommonAssetType.SLUG]: "Slug",
|
||||
[CommonAssetType.FOOTSTEP_TABLE]: "Footstep table",
|
||||
[CommonAssetType.FOOTSTEP_FX_TABLE]: "Footstep FX table",
|
||||
[CommonAssetType.ZBARRIER]: "ZBarrier",
|
||||
};
|
||||
|
||||
export function getAssetTypeNameCapitalized(assetType: CommonAssetType): string {
|
||||
return LOOKUP_CAPITALIZED[assetType];
|
||||
}
|
||||
|
||||
export function getAssetTypeNameLower(assetType: CommonAssetType): string {
|
||||
return getAssetTypeNameCapitalized(assetType).toLocaleLowerCase();
|
||||
}
|
||||
@@ -2,11 +2,12 @@
|
||||
|
||||
#include "ZoneRegistry.h"
|
||||
|
||||
Zone::Zone(std::string name, const zone_priority_t priority, GameId gameId)
|
||||
Zone::Zone(std::string name, const zone_priority_t priority, const GameId gameId, const GamePlatform platform)
|
||||
: m_name(std::move(name)),
|
||||
m_priority(priority),
|
||||
m_language(GameLanguage::LANGUAGE_NONE),
|
||||
m_game_id(gameId),
|
||||
m_platform(platform),
|
||||
m_pools(ZoneAssetPools::CreateForGame(gameId, this, priority)),
|
||||
m_memory(std::make_unique<ZoneMemory>()),
|
||||
m_registered(false)
|
||||
|
||||
@@ -15,7 +15,7 @@ class ZoneAssetPools;
|
||||
class Zone
|
||||
{
|
||||
public:
|
||||
Zone(std::string name, zone_priority_t priority, GameId gameId);
|
||||
Zone(std::string name, zone_priority_t priority, GameId gameId, GamePlatform platform);
|
||||
~Zone();
|
||||
Zone(const Zone& other) = delete;
|
||||
Zone(Zone&& other) noexcept = default;
|
||||
@@ -30,6 +30,7 @@ public:
|
||||
zone_priority_t m_priority;
|
||||
GameLanguage m_language;
|
||||
GameId m_game_id;
|
||||
GamePlatform m_platform;
|
||||
ZoneScriptStrings m_script_strings;
|
||||
std::unique_ptr<ZoneAssetPools> m_pools;
|
||||
|
||||
|
||||
@@ -69,7 +69,7 @@ std::unique_ptr<ZoneLoader> ZoneLoaderFactory::CreateLoaderForHeader(const ZoneH
|
||||
return nullptr;
|
||||
|
||||
// Create new zone
|
||||
auto zone = std::make_unique<Zone>(fileName, 0, GameId::IW3);
|
||||
auto zone = std::make_unique<Zone>(fileName, 0, GameId::IW3, inspectResult->m_platform);
|
||||
auto* zonePtr = zone.get();
|
||||
zone->m_pools = std::make_unique<GameAssetPoolIW3>(zonePtr, 0);
|
||||
zone->m_language = GameLanguage::LANGUAGE_NONE;
|
||||
|
||||
@@ -211,7 +211,7 @@ std::unique_ptr<ZoneLoader> ZoneLoaderFactory::CreateLoaderForHeader(const ZoneH
|
||||
return nullptr;
|
||||
|
||||
// Create new zone
|
||||
auto zone = std::make_unique<Zone>(fileName, 0, GameId::IW4);
|
||||
auto zone = std::make_unique<Zone>(fileName, 0, GameId::IW4, inspectResult->m_generic_result.m_platform);
|
||||
auto* zonePtr = zone.get();
|
||||
zone->m_pools = std::make_unique<GameAssetPoolIW4>(zonePtr, 0);
|
||||
zone->m_language = GameLanguage::LANGUAGE_NONE;
|
||||
|
||||
@@ -165,7 +165,7 @@ std::unique_ptr<ZoneLoader> ZoneLoaderFactory::CreateLoaderForHeader(const ZoneH
|
||||
return nullptr;
|
||||
|
||||
// Create new zone
|
||||
auto zone = std::make_unique<Zone>(fileName, 0, GameId::IW5);
|
||||
auto zone = std::make_unique<Zone>(fileName, 0, GameId::IW5, inspectResult->m_platform);
|
||||
auto* zonePtr = zone.get();
|
||||
zone->m_pools = std::make_unique<GameAssetPoolIW5>(zonePtr, 0);
|
||||
zone->m_language = GameLanguage::LANGUAGE_NONE;
|
||||
|
||||
@@ -68,7 +68,7 @@ std::unique_ptr<ZoneLoader> ZoneLoaderFactory::CreateLoaderForHeader(const ZoneH
|
||||
return nullptr;
|
||||
|
||||
// Create new zone
|
||||
auto zone = std::make_unique<Zone>(fileName, 0, GameId::T5);
|
||||
auto zone = std::make_unique<Zone>(fileName, 0, GameId::T5, inspectResult->m_platform);
|
||||
auto* zonePtr = zone.get();
|
||||
zone->m_pools = std::make_unique<GameAssetPoolT5>(zonePtr, 0);
|
||||
zone->m_language = GameLanguage::LANGUAGE_NONE;
|
||||
|
||||
@@ -284,7 +284,7 @@ std::unique_ptr<ZoneLoader> ZoneLoaderFactory::CreateLoaderForHeader(const ZoneH
|
||||
return nullptr;
|
||||
|
||||
// Create new zone
|
||||
auto zone = std::make_unique<Zone>(fileName, 0, GameId::T6);
|
||||
auto zone = std::make_unique<Zone>(fileName, 0, GameId::T6, inspectResult->m_generic_result.m_platform);
|
||||
auto* zonePtr = zone.get();
|
||||
zone->m_pools = std::make_unique<GameAssetPoolT6>(zonePtr, 0);
|
||||
zone->m_language = GetZoneLanguage(fileName);
|
||||
|
||||
Reference in New Issue
Block a user