- Convert match() function calls to if-else chains (match keyword conflict) - Remove unsupported bracket attributes [table=..., columns=...] - Expand inline statement with bracket attributes to explicit if block Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
132 lines
3.7 KiB
Plaintext
132 lines
3.7 KiB
Plaintext
type assetlist [display="Asset List"]
|
|
{
|
|
const PTR_INLINE = -1;
|
|
|
|
u32 stringlist_count;
|
|
ui("stringlist_count", "String List Count");
|
|
|
|
i32 stringlist_ptr;
|
|
ui("stringlist_ptr", "String List Ptr");
|
|
|
|
u32 asset_count;
|
|
ui("asset_count", "Asset Count");
|
|
|
|
i32 assets_ptr;
|
|
ui("assets_ptr", "Assets Ptr");
|
|
|
|
// Parse string list inline
|
|
stringlist = 0;
|
|
if (stringlist_ptr != 0) {
|
|
actual_count = stringlist_count - 1;
|
|
|
|
// Skip string pointers
|
|
if (actual_count > 0) {
|
|
skip actual_count * 4;
|
|
}
|
|
|
|
// Parse strings
|
|
strings = 0;
|
|
repeat(actual_count) {
|
|
_str = parse_here("scriptstring");
|
|
strings = push("strings", _str);
|
|
}
|
|
|
|
// Table: strings (columns: ptr,value)
|
|
skip_tree("strings");
|
|
stringlist = strings;
|
|
}
|
|
|
|
if (assets_ptr != 0) {
|
|
// First pass: Parse all asset headers
|
|
assets = 0;
|
|
repeat(asset_count) {
|
|
_a = parse_here("assetheader");
|
|
if (stringlist != 0) {
|
|
_a_stringlist = stringlist;
|
|
}
|
|
assets = push("assets", _a);
|
|
}
|
|
|
|
// Table: assets (columns: asset_ptr,raw_type,asset_type)
|
|
skip_tree("assets");
|
|
|
|
// Second pass: Parse actual asset data based on headers
|
|
parsed_assets = 0;
|
|
repeat(asset_count) {
|
|
_header = get(assets, _i);
|
|
_ptr = get(_header, "asset_ptr");
|
|
_type = get(_header, "asset_type");
|
|
|
|
// Parse inline asset data (ptr == -1)
|
|
if (_ptr == PTR_INLINE) {
|
|
match(_type) {
|
|
"techset" => {
|
|
_asset = parse_here("materialtechniqueset");
|
|
parsed_assets = push("parsed_assets", _asset);
|
|
}
|
|
"material" => {
|
|
_asset = parse_here("material");
|
|
parsed_assets = push("parsed_assets", _asset);
|
|
}
|
|
"rawfile" => {
|
|
_asset = parse_here("rawfile");
|
|
parsed_assets = push("parsed_assets", _asset);
|
|
}
|
|
"gfx_map" => {
|
|
_asset = parse_here("gfxworld");
|
|
parsed_assets = push("parsed_assets", _asset);
|
|
}
|
|
"image" => {
|
|
_asset = parse_here("image");
|
|
parsed_assets = push("parsed_assets", _asset);
|
|
}
|
|
"pixelshader" => {
|
|
_asset = parse_here("pixelshader");
|
|
parsed_assets = push("parsed_assets", _asset);
|
|
}
|
|
"font" => {
|
|
_asset = parse_here("font");
|
|
parsed_assets = push("parsed_assets", _asset);
|
|
}
|
|
"localize" => {
|
|
_asset = parse_here("localize");
|
|
parsed_assets = push("parsed_assets", _asset);
|
|
}
|
|
"menu" => {
|
|
_asset = parse_here("menu");
|
|
parsed_assets = push("parsed_assets", _asset);
|
|
}
|
|
"sound" => {
|
|
_asset = parse_here("sound");
|
|
parsed_assets = push("parsed_assets", _asset);
|
|
}
|
|
"loaded_sound" => {
|
|
_asset = parse_here("loaded_sound");
|
|
parsed_assets = push("parsed_assets", _asset);
|
|
}
|
|
"sndcurve" => {
|
|
_asset = parse_here("sndcurve");
|
|
parsed_assets = push("parsed_assets", _asset);
|
|
}
|
|
"xmodel" => {
|
|
_asset = parse_here("xmodel");
|
|
parsed_assets = push("parsed_assets", _asset);
|
|
}
|
|
"stringtable" => {
|
|
_asset = parse_here("stringtable_asset");
|
|
parsed_assets = push("parsed_assets", _asset);
|
|
}
|
|
"weapon" => {
|
|
_asset = parse_here("weapon");
|
|
parsed_assets = push("parsed_assets", _asset);
|
|
}
|
|
"menufile" | "menulist" => {
|
|
_asset = parse_here("menulist");
|
|
parsed_assets = push("parsed_assets", _asset);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|