Skip to content

Commit 2208ac7

Browse files
committed
Version 1.3 beta
New features: Highlighter, SHA-256 hash, duplicate content with same offset.
1 parent 72a8d0c commit 2208ac7

21 files changed

+856
-306
lines changed

HPIZ Archiver/App.config

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<configuration>
3-
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8"/></startup></configuration>
3+
<System.Windows.Forms.ApplicationConfigurationSection>
4+
<add key="DpiAwareness" value="PerMonitorV2" />
5+
</System.Windows.Forms.ApplicationConfigurationSection>
6+
<startup>
7+
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8"/>
8+
</startup>
9+
</configuration>

HPIZ Archiver/FolderExtension.cs

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Linq;
4+
using System.Text;
5+
using System.Threading.Tasks;
6+
7+
namespace HPIZArchiver
8+
{
9+
static class FolderExtension
10+
{
11+
static readonly Dictionary<string, string[]> folderExtensionPairs = new Dictionary<string, string[]>()
12+
{
13+
{ @"ae", new string[] { "txt" } },
14+
{ @"ai", new string[] { "txt" } },
15+
{ @"anim3d", new string[] { "bos" } },
16+
{ @"anims", new string[] { "gaf" } },
17+
{ @"bitmaps", new string[] { "pcx" } },
18+
{ @"bitmaps\glamour", new string[] { "pcx" } },
19+
{ @"camps", new string[] { "tdf" } },
20+
{ @"camps\briefs", new string[] { "txt", "wav" } },
21+
{ @"camps\briefs-french", new string[] { "txt", "wav" } },
22+
{ @"camps\briefs-german", new string[] { "txt", "wav" } },
23+
{ @"camps\briefs-italian", new string[] { "txt", "wav" } },
24+
{ @"camps\briefs-spanish", new string[] { "txt", "wav" } },
25+
{ @"camps\useonly", new string[] { "tdf" } },
26+
{ @"download", new string[] { "tdf" } },
27+
{ @"features", new string[] { "tdf" } },
28+
{ @"fonts", new string[] { "fnt" } },
29+
{ @"gamedata", new string[] { "tdf" } },
30+
{ @"gamedate", new string[] { "tdf" } },
31+
{ @"guie", new string[] { "gui" } },
32+
{ @"guis", new string[] { "gui" } },
33+
{ @"maps", new string[] { "ota", "tnt" } },
34+
{ @"objects3d", new string[] { "3do" } },
35+
{ @"palettes", new string[] { "pal", "alp", "lht", "shd" } },
36+
{ @"scripts", new string[] { "bos", "cob" } },
37+
{ @"sections", new string[] { "sct" } },
38+
{ @"sounds", new string[] { "wav" } },
39+
{ @"textures", new string[] { "gaf" } },
40+
{ @"unitpice", new string[] { "pcx" } },
41+
{ @"unitpics", new string[] { "pcx" } },
42+
{ @"units", new string[] { "fbi" } },
43+
{ @"unitse", new string[] { "fbi" } },
44+
{ @"weapone", new string[] { "tdf" } },
45+
{ @"weapons", new string[] { "tdf" } }
46+
};
47+
48+
public static bool CheckKnow(string path)
49+
{
50+
path = path.ToLower();
51+
foreach (var folder in folderExtensionPairs.Keys)
52+
if(path.StartsWith(folder,StringComparison.OrdinalIgnoreCase))
53+
switch (path.Replace(folder, string.Empty).Split('\\').Length)
54+
{
55+
case 4:
56+
if (folder == "sections") goto case 2;
57+
break;
58+
case 3:
59+
if (folder == "features") goto case 2;
60+
break;
61+
case 2:
62+
foreach (var extension in folderExtensionPairs[folder])
63+
if (path.EndsWith("." + extension, StringComparison.OrdinalIgnoreCase))
64+
return true;
65+
break;
66+
}
67+
return false;
68+
}
69+
}
70+
}

HPIZ Archiver/HPIZ Archiver.csproj

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@
8989
<Compile Include="CollapsibleListView.cs">
9090
<SubType>Component</SubType>
9191
</Compile>
92+
<Compile Include="FolderExtension.cs" />
9293
<Compile Include="ListViewItemComparer.cs" />
9394
<Compile Include="MainForm.cs">
9495
<SubType>Form</SubType>
@@ -99,6 +100,7 @@
99100
<Compile Include="Program.cs" />
100101
<Compile Include="Properties\AssemblyInfo.cs" />
101102
<Compile Include="TaskbarProgress.cs" />
103+
<Compile Include="Utils.cs" />
102104
<EmbeddedResource Include="MainForm.resx">
103105
<DependentUpon>MainForm.cs</DependentUpon>
104106
</EmbeddedResource>
@@ -147,6 +149,9 @@
147149
<ItemGroup>
148150
<None Include="Resources\Rules_32x.png" />
149151
</ItemGroup>
152+
<ItemGroup>
153+
<None Include="Resources\Highlighter_32x.png" />
154+
</ItemGroup>
150155
<Import Project="..\HPIZ\HPIZ.projitems" Label="Shared" />
151156
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
152157
</Project>

0 commit comments

Comments
 (0)