Skip to content

Commit

Permalink
Version 1.3 beta
Browse files Browse the repository at this point in the history
New features: Highlighter, SHA-256 hash, duplicate content with same offset.
  • Loading branch information
THGSCST committed Aug 28, 2022
1 parent 72a8d0c commit 2208ac7
Show file tree
Hide file tree
Showing 21 changed files with 856 additions and 306 deletions.
8 changes: 7 additions & 1 deletion HPIZ Archiver/App.config
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8"/></startup></configuration>
<System.Windows.Forms.ApplicationConfigurationSection>
<add key="DpiAwareness" value="PerMonitorV2" />
</System.Windows.Forms.ApplicationConfigurationSection>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8"/>
</startup>
</configuration>
70 changes: 70 additions & 0 deletions HPIZ Archiver/FolderExtension.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace HPIZArchiver
{
static class FolderExtension
{
static readonly Dictionary<string, string[]> folderExtensionPairs = new Dictionary<string, string[]>()
{
{ @"ae", new string[] { "txt" } },
{ @"ai", new string[] { "txt" } },
{ @"anim3d", new string[] { "bos" } },
{ @"anims", new string[] { "gaf" } },
{ @"bitmaps", new string[] { "pcx" } },
{ @"bitmaps\glamour", new string[] { "pcx" } },
{ @"camps", new string[] { "tdf" } },
{ @"camps\briefs", new string[] { "txt", "wav" } },
{ @"camps\briefs-french", new string[] { "txt", "wav" } },
{ @"camps\briefs-german", new string[] { "txt", "wav" } },
{ @"camps\briefs-italian", new string[] { "txt", "wav" } },
{ @"camps\briefs-spanish", new string[] { "txt", "wav" } },
{ @"camps\useonly", new string[] { "tdf" } },
{ @"download", new string[] { "tdf" } },
{ @"features", new string[] { "tdf" } },
{ @"fonts", new string[] { "fnt" } },
{ @"gamedata", new string[] { "tdf" } },
{ @"gamedate", new string[] { "tdf" } },
{ @"guie", new string[] { "gui" } },
{ @"guis", new string[] { "gui" } },
{ @"maps", new string[] { "ota", "tnt" } },
{ @"objects3d", new string[] { "3do" } },
{ @"palettes", new string[] { "pal", "alp", "lht", "shd" } },
{ @"scripts", new string[] { "bos", "cob" } },
{ @"sections", new string[] { "sct" } },
{ @"sounds", new string[] { "wav" } },
{ @"textures", new string[] { "gaf" } },
{ @"unitpice", new string[] { "pcx" } },
{ @"unitpics", new string[] { "pcx" } },
{ @"units", new string[] { "fbi" } },
{ @"unitse", new string[] { "fbi" } },
{ @"weapone", new string[] { "tdf" } },
{ @"weapons", new string[] { "tdf" } }
};

public static bool CheckKnow(string path)
{
path = path.ToLower();
foreach (var folder in folderExtensionPairs.Keys)
if(path.StartsWith(folder,StringComparison.OrdinalIgnoreCase))
switch (path.Replace(folder, string.Empty).Split('\\').Length)
{
case 4:
if (folder == "sections") goto case 2;
break;
case 3:
if (folder == "features") goto case 2;
break;
case 2:
foreach (var extension in folderExtensionPairs[folder])
if (path.EndsWith("." + extension, StringComparison.OrdinalIgnoreCase))
return true;
break;
}
return false;
}
}
}
5 changes: 5 additions & 0 deletions HPIZ Archiver/HPIZ Archiver.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@
<Compile Include="CollapsibleListView.cs">
<SubType>Component</SubType>
</Compile>
<Compile Include="FolderExtension.cs" />
<Compile Include="ListViewItemComparer.cs" />
<Compile Include="MainForm.cs">
<SubType>Form</SubType>
Expand All @@ -99,6 +100,7 @@
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="TaskbarProgress.cs" />
<Compile Include="Utils.cs" />
<EmbeddedResource Include="MainForm.resx">
<DependentUpon>MainForm.cs</DependentUpon>
</EmbeddedResource>
Expand Down Expand Up @@ -147,6 +149,9 @@
<ItemGroup>
<None Include="Resources\Rules_32x.png" />
</ItemGroup>
<ItemGroup>
<None Include="Resources\Highlighter_32x.png" />
</ItemGroup>
<Import Project="..\HPIZ\HPIZ.projitems" Label="Shared" />
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>
Loading

0 comments on commit 2208ac7

Please sign in to comment.