mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/PCK-Studio.git
synced 2026-06-16 12:11:55 +00:00
PckAssetBrowserEditor - Add armor resoucre handling
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user