From d934cf04778f326885338a3175809d4595da6879 Mon Sep 17 00:00:00 2001 From: Rob James Date: Tue, 4 Aug 2020 19:24:04 -0500 Subject: [PATCH 1/3] Additional changes for codacy --- TL2_ItemDatMaker/Components/UnitType.cs | 4 ++-- TL2_ItemDatMaker/Constants.cs | 2 +- TL2_ItemDatMaker/Models/PathInfo.cs | 4 ++-- TL2_ItemDatMakerTests/PathInfoTests.cs | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) 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 { ".", From 370d3211865d76c0785c3a06e9aa08b45e1d3e67 Mon Sep 17 00:00:00 2001 From: Rob James Date: Wed, 5 Aug 2020 10:16:30 -0500 Subject: [PATCH 2/3] Fix markdown warnings for codacy --- README.md | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index 6feab3b..57253b7 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. -#### 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. \ No newline at end of file From c2cdf59281d5904ed11ee3e483915c5f9a116d27 Mon Sep 17 00:00:00 2001 From: Rob James Date: Wed, 5 Aug 2020 10:28:49 -0500 Subject: [PATCH 3/3] Used remark linter --- README.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 57253b7..17d17fd 100644 --- a/README.md +++ b/README.md @@ -16,10 +16,10 @@ Written in dot net core with Visual Studio 2017. #### 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 @@ -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.