mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/PCK-Studio.git
synced 2026-05-22 01:06:35 +00:00
Move extensions from 'PckFileExtensions' to 'PckAssetExtensions'
This commit is contained in:
@@ -18,6 +18,22 @@ namespace PckStudio.Extensions
|
||||
{
|
||||
private const string MipMap = "MipMapLevel";
|
||||
|
||||
internal static PckAsset CreateNewAssetIf(this PckFile pck, bool condition, string filename, PckAssetType filetype, IDataFormatWriter writer)
|
||||
{
|
||||
if (condition)
|
||||
{
|
||||
return pck.CreateNewAsset(filename, filetype, writer);
|
||||
}
|
||||
return default;
|
||||
}
|
||||
|
||||
internal static PckAsset CreateNewAsset(this PckFile pck, string filename, PckAssetType filetype, IDataFormatWriter writer)
|
||||
{
|
||||
PckAsset asset = pck.CreateNewAsset(filename, filetype);
|
||||
asset.SetData(writer);
|
||||
return asset;
|
||||
}
|
||||
|
||||
internal static Image GetTexture(this PckAsset asset)
|
||||
{
|
||||
if (asset.Type != PckAssetType.SkinFile &&
|
||||
|
||||
@@ -1,24 +0,0 @@
|
||||
using OMI.Formats.Pck;
|
||||
using OMI.Workers;
|
||||
|
||||
namespace PckStudio.Extensions
|
||||
{
|
||||
internal static class PckFileExtensions
|
||||
{
|
||||
internal static PckAsset CreateNewAssetIf(this PckFile pck, bool condition, string filename, PckAssetType filetype, IDataFormatWriter writer)
|
||||
{
|
||||
if (condition)
|
||||
{
|
||||
return pck.CreateNewAsset(filename, filetype, writer);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
internal static PckAsset CreateNewAsset(this PckFile pck, string filename, PckAssetType filetype, IDataFormatWriter writer)
|
||||
{
|
||||
PckAsset asset = pck.CreateNewAsset(filename, filetype);
|
||||
asset.SetData(writer);
|
||||
return asset;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -197,7 +197,6 @@
|
||||
<Compile Include="Extensions\ImageSection.cs" />
|
||||
<Compile Include="Extensions\ListExtensions.cs" />
|
||||
<Compile Include="Extensions\MathExtensions.cs" />
|
||||
<Compile Include="Extensions\PckFileExtensions.cs" />
|
||||
<Compile Include="Forms\Additional-Popups\NumericPrompt.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
|
||||
Reference in New Issue
Block a user