Remove Helper folder

This commit is contained in:
miku-666
2024-06-22 13:20:45 +02:00
parent ba7a950f17
commit 2ea94d9a35
5 changed files with 25 additions and 43 deletions

View File

@@ -1,18 +1,15 @@
using System;
using System.IO;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using OMI.Formats.Material;
using OMI.Workers.Material;
namespace PckStudio.Helper
namespace PckStudio.Extensions
{
public static class MaterialResources
internal static class MaterialContainerExtensions
{
public static byte[] MaterialsFileInitializer()
{
using var stream = new MemoryStream();
var matFile = new MaterialContainer
{
private static readonly MaterialContainer.Material[] defaultMaterials = [
new MaterialContainer.Material("bat", "entity_alphatest"),
new MaterialContainer.Material("ender_dragon", "entity_emissive_alpha"),
new MaterialContainer.Material("blaze_head", "entity_emissive_alpha"),
@@ -35,10 +32,11 @@ namespace PckStudio.Helper
new MaterialContainer.Material("wither_boss", "entity_alphatest"),
new MaterialContainer.Material("wither_skeleton", "entity_alphatest"),
new MaterialContainer.Material("wolf", "entity_alphatest_change_color")
};
var writer = new MaterialFileWriter(matFile);
writer.WriteToStream(stream);
return stream.ToArray();
];
public static void InitializeDefault(this MaterialContainer materials)
{
materials.AddRange(defaultMaterials);
}
}
}

View File

@@ -30,8 +30,6 @@ using OMI.Formats.Pck;
using OMI.Workers.Color;
using PckStudio.Extensions;
using PckStudio.Helper;
using PckStudio.Internal;
using PckStudio.Internal.Deserializer;
using PckStudio.Internal.Json;
using PckStudio.Internal.Serializer;

View File

@@ -1,18 +0,0 @@
using System.IO;
using OMI.Formats.Behaviour;
using OMI.Workers.Behaviour;
namespace PckStudio.Helper
{
public static class BehaviourResources
{
internal static byte[] BehaviourFileInitializer()
{
using var stream = new MemoryStream();
var writer = new BehavioursWriter(new BehaviourFile());
writer.WriteToStream(stream);
return stream.ToArray();
}
}
}

View File

@@ -7,14 +7,20 @@ using System.Windows.Forms;
using System.Drawing.Drawing2D;
using System.Diagnostics;
using System.Drawing.Imaging;
using System.Text.RegularExpressions;
using OMI.Formats.Pck;
using OMI.Formats.GameRule;
using OMI.Formats.Languages;
using OMI.Formats.Model;
using OMI.Formats.GameRule;
using OMI.Formats.Material;
using OMI.Formats.Behaviour;
using OMI.Formats.Languages;
using OMI.Workers;
using OMI.Workers.Pck;
using OMI.Workers.GameRule;
using OMI.Workers.Language;
using OMI.Workers.Model;
using OMI.Workers.Behaviour;
using OMI.Workers.Material;
using PckStudio.Properties;
using PckStudio.FileFormats;
using PckStudio.Forms;
@@ -29,12 +35,9 @@ using PckStudio.Forms.Features;
using PckStudio.Extensions;
using PckStudio.Popups;
using PckStudio.Classes.Utils;
using PckStudio.Helper;
using System.Text.RegularExpressions;
using PckStudio.Internal.Json;
using PckStudio.Internal.Deserializer;
using PckStudio.Internal.Serializer;
using OMI.Workers;
using PckStudio.Internal.App;
namespace PckStudio
@@ -2368,7 +2371,7 @@ namespace PckStudio
return;
}
currentPCK.CreateNewAsset("behaviours.bin", PckAssetType.BehavioursFile, BehaviourResources.BehaviourFileInitializer);
currentPCK.CreateNewAsset("behaviours.bin", PckAssetType.BehavioursFile, new BehavioursWriter(new BehaviourFile()));
BuildMainTreeView();
}
@@ -2379,7 +2382,9 @@ namespace PckStudio
MessageBox.Show(this, "A behaviours file already exists in this PCK and a new one cannot be created.", "Operation aborted");
return;
}
currentPCK.CreateNewAsset("entityMaterials.bin", PckAssetType.MaterialFile, MaterialResources.MaterialsFileInitializer);
var materialContainer = new MaterialContainer();
materialContainer.InitializeDefault();
currentPCK.CreateNewAsset("entityMaterials.bin", PckAssetType.MaterialFile, new MaterialFileWriter(materialContainer));
BuildMainTreeView();
}

View File

@@ -133,6 +133,7 @@
<Reference Include="WindowsFormsIntegration" />
</ItemGroup>
<ItemGroup>
<Compile Include="Extensions\MaterialContainerExtensions.cs" />
<Compile Include="Forms\ContributorsForm.cs">
<SubType>Form</SubType>
</Compile>
@@ -383,8 +384,6 @@
<Compile Include="Forms\Additional-Popups\InProgressPrompt.Designer.cs">
<DependentUpon>InProgressPrompt.cs</DependentUpon>
</Compile>
<Compile Include="Helper\MaterialResources.cs" />
<Compile Include="Helper\BehaviourResources.cs" />
<Compile Include="Forms\Editor\BoxEditor.cs">
<SubType>Form</SubType>
</Compile>