PckAssetBrowserEditor - Add armor resoucre handling

This commit is contained in:
miku-666
2025-11-26 08:56:22 +01:00
parent 0cec1a9f31
commit 87fd010ee0
3 changed files with 56 additions and 23 deletions

View File

@@ -365,6 +365,23 @@ namespace PckStudio.Controls
BuildMainTreeView();
}
break;
case ResourceCategory.ArmorTextures:
string assetName = Path.GetFileNameWithoutExtension(asset.Filename);
ArmorSetDescription armorSetDescription = ArmorSetDescription.GetFromAssetName(assetName);
Debug.WriteLineIf(!armorSetDescription.IsEmpty, armorSetDescription.Name);
ITryGet<string, Image> tryGet = TryGet<string, Image>.FromDelegate((string path, out Image img) =>
{
img = null;
if (EditorValue.File.TryGetAsset(path + ".png", PckAssetType.TextureFile, out PckAsset armorAsset))
{
img = armorAsset.GetTexture();
Debug.WriteLine($"Got texture for: {path}");
return true;
}
return false;
});
ArmorSet armorSet = armorSetDescription.GetArmorSet(tryGetTexture: tryGet);
break;
default:
Debug.WriteLine($"Unhandled Resource Category: {resourceLocation.Category}");
break;