-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
New features: Highlighter, SHA-256 hash, duplicate content with same offset.
- Loading branch information
Showing
21 changed files
with
856 additions
and
306 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.