diff --git a/README.md b/README.md index 6feab3b..17d17fd 100644 --- a/README.md +++ b/README.md @@ -2,26 +2,26 @@ Generate DAT files for items in torchlight 2 -http://torchmodders.com/forums/tips-tools/(request)-item-unit-file-maker-script-624/?topicseen + -## BETA!! +## BETA v0.9.2 -Releases: https://github.com/RobJames-Texas/TL2_ItemDatMaker/releases +Releases: Written in dot net core with Visual Studio 2017. -### Usage: +### Usage -#### Stand Alone versions: +#### Stand Alone versions -* Windows 7 and up 32/64bit **"TL2_ItemDatMaker.exe"** -* OSX 10.10 x64 and up **"TL2_ItemDatMaker"** +- Windows 7 and up 32/64bit **"TL2_ItemDatMaker.exe"** +- OSX 10.10 x64 and up **"TL2_ItemDatMaker"** -Either with the options below, *or* drag the mesh file in your mod folder over the executable and the application will ask for the rest of the options. +Either with the options below, _or_ drag the mesh file in your mod folder over the executable and the application will ask for the rest of the options. -#### options: +#### options -m | --3dmodel Meshfile and full path. (required) -r | --itemrarity Item Rarity: Normal, Magic (Blue), Unique or Legendary. (required) @@ -32,6 +32,6 @@ Either with the options below, *or* drag the mesh file in your mod folder over t Release notes: -* v0.9.2 -- Changed spaces to tabs in output DAT files. Updated nuget packages and unit tests. Updated to dot net core 2.1. -* v0.9.1 -- Corrected output file encoding. Removed extension from the string for the meshfile. -* v0.9.0 -- Initial release. \ No newline at end of file +- v0.9.2 -- Changed spaces to tabs in output DAT files. Updated nuget packages and unit tests. Updated to dot net core 2.1. +- v0.9.1 -- Corrected output file encoding. Removed extension from the string for the meshfile. +- v0.9.0 -- Initial release. diff --git a/TL2_ItemDatMaker/Components/UnitType.cs b/TL2_ItemDatMaker/Components/UnitType.cs index 19a46f8..f8374b7 100644 --- a/TL2_ItemDatMaker/Components/UnitType.cs +++ b/TL2_ItemDatMaker/Components/UnitType.cs @@ -58,12 +58,12 @@ private UnitType(string type, string meshFolder, string unitFolder, string baseF public static UnitType GetByMeshFolder(string meshFolder) { - return UnitType.List().Where(u => u.MeshFolder == meshFolder.ToUpper()).FirstOrDefault(); + return UnitType.List().Where(u => u.MeshFolder == meshFolder.ToUpperInvariant()).FirstOrDefault(); } public static IEnumerable List() { - return new UnitType[] + return new [] { Axes, Bows, diff --git a/TL2_ItemDatMaker/Constants.cs b/TL2_ItemDatMaker/Constants.cs index 7012a4e..8b78ca5 100644 --- a/TL2_ItemDatMaker/Constants.cs +++ b/TL2_ItemDatMaker/Constants.cs @@ -2,6 +2,6 @@ { public static class Constants { - public static string Tab = $@"{"\t"}"; + public readonly static string Tab = $@"{"\t"}"; } } diff --git a/TL2_ItemDatMaker/Models/PathInfo.cs b/TL2_ItemDatMaker/Models/PathInfo.cs index 7ddc998..9a884a4 100644 --- a/TL2_ItemDatMaker/Models/PathInfo.cs +++ b/TL2_ItemDatMaker/Models/PathInfo.cs @@ -22,7 +22,7 @@ public PathInfo(string fullPath) throw new ArgumentException("Invalid File"); } - List folders = Path.GetDirectoryName(fullPath).ToUpper().Split(Path.DirectorySeparatorChar).ToList(); + List folders = Path.GetDirectoryName(fullPath).ToUpperInvariant().Split(Path.DirectorySeparatorChar).ToList(); int index = folders.IndexOf("MEDIA"); Root = String.Join(Path.DirectorySeparatorChar.ToString(), folders.Take(index)); @@ -40,7 +40,7 @@ public PathInfo(string fullPath) throw new ArgumentException("Invalid Item Type Path"); } - BaseDatPath = string.Join(Path.DirectorySeparatorChar.ToString(), new string[] { "MEDIA", "UNITS", "ITEMS" }); + BaseDatPath = string.Join(Path.DirectorySeparatorChar.ToString(), new [] { "MEDIA", "UNITS", "ITEMS" }); } diff --git a/TL2_ItemDatMakerTests/PathInfoTests.cs b/TL2_ItemDatMakerTests/PathInfoTests.cs index 6d3450f..0e21f5e 100644 --- a/TL2_ItemDatMakerTests/PathInfoTests.cs +++ b/TL2_ItemDatMakerTests/PathInfoTests.cs @@ -13,7 +13,7 @@ public class PathInfoTests [TestMethod] public void ShouldFillInWithStaffPropertiesWhenPathIsGood() { - // ".\MEDIA\MODELS\WEAPONS\_STAVES\staff_model_01.MESH"; + // Example: ".\MEDIA\MODELS\WEAPONS\_STAVES\staff_model_01.MESH" List pathParts = new List { ".",