From ee0cd72cd66c915656cb9b5ea8a4c1f7b935f59e Mon Sep 17 00:00:00 2001 From: Clay Livince Date: Tue, 16 Jan 2024 23:21:24 +0800 Subject: [PATCH 1/3] fix: EF6 config for .net 7 and tripletriad icon offset fix --- SaintCoinach.Cmd/App.config | 1 + SaintCoinach/Xiv/TripleTriadCard.cs | 4 ++-- SaintCoinach/app.config | 3 ++- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/SaintCoinach.Cmd/App.config b/SaintCoinach.Cmd/App.config index c32e52e5..f035dab9 100644 --- a/SaintCoinach.Cmd/App.config +++ b/SaintCoinach.Cmd/App.config @@ -5,6 +5,7 @@
+
diff --git a/SaintCoinach/Xiv/TripleTriadCard.cs b/SaintCoinach/Xiv/TripleTriadCard.cs index affcabcf..67feabde 100644 --- a/SaintCoinach/Xiv/TripleTriadCard.cs +++ b/SaintCoinach/Xiv/TripleTriadCard.cs @@ -8,8 +8,8 @@ namespace SaintCoinach.Xiv { public class TripleTriadCard : XivRow { - public const int PlateIconOffset = 82100; - public const int IconOffset = 82500; + public const int PlateIconOffset = 87000; + public const int IconOffset = 88000; #region Fields private TripleTriadCardResident _Resident; diff --git a/SaintCoinach/app.config b/SaintCoinach/app.config index 169f48c8..7101af6c 100644 --- a/SaintCoinach/app.config +++ b/SaintCoinach/app.config @@ -3,9 +3,10 @@
+
- + From 4ac4784a7aac66ff05ba9a12c1ccee00debf0ff9 Mon Sep 17 00:00:00 2001 From: Clay Livince Date: Sat, 9 Mar 2024 11:29:47 +0800 Subject: [PATCH 2/3] Prefer HighRes option on IconHelper --- SaintCoinach/Imaging/IconHelper.cs | 34 ++++++++++++++++++++++-------- 1 file changed, 25 insertions(+), 9 deletions(-) diff --git a/SaintCoinach/Imaging/IconHelper.cs b/SaintCoinach/Imaging/IconHelper.cs index 26e39622..59e97c2e 100644 --- a/SaintCoinach/Imaging/IconHelper.cs +++ b/SaintCoinach/Imaging/IconHelper.cs @@ -9,7 +9,24 @@ namespace SaintCoinach.Imaging { using IO; public static class IconHelper { + static bool PreferHighRes = false; + const string IconFileFormat = "ui/icon/{0:D3}000/{1}{2:D6}.tex"; + const string IconHr1FileFormat = "ui/icon/{0:D3}000/{1}{2:D6}_hr1.tex"; + + private static File GetIconFile(IO.PackCollection pack, string filePathFormat, string type, int nr) { + var filePath = string.Format(filePathFormat, nr / 1000, type, nr); + if (!pack.TryGetFile(filePath, out var file) && type.Length > 0) { + // Couldn't get specific type, try for generic version. + filePath = string.Format(filePathFormat, nr / 1000, string.Empty, nr); + if (!pack.TryGetFile(filePath, out file)) { + // Couldn't get generic version either, that's a shame. + file = null; + } + } + return file; + } + public static Imaging.ImageFile GetIcon(IO.PackCollection pack, int nr) { return GetIcon(pack, string.Empty, nr); } @@ -24,16 +41,15 @@ public static Imaging.ImageFile GetIcon(IO.PackCollection pack, string type, int if (type.Length > 0 && !type.EndsWith("/")) type = type + "/"; - var filePath = string.Format(IconFileFormat, nr / 1000, type, nr); - - if (!pack.TryGetFile(filePath, out var file) && type.Length > 0) { - // Couldn't get specific type, try for generic version. - filePath = string.Format(IconFileFormat, nr / 1000, string.Empty, nr); - if (!pack.TryGetFile(filePath, out file)) { - // Couldn't get generic version either, that's a shame. - file = null; - } + File file = null; + // we prefer hr1 then. + if (PreferHighRes) { + file = GetIconFile(pack, IconHr1FileFormat, type, nr); } + if (file == null) { + file = GetIconFile(pack, IconFileFormat, type, nr); + } + return file as Imaging.ImageFile; } } From 93beff7bd356d2a3323158a4621dc4cf22da1dbb Mon Sep 17 00:00:00 2001 From: Clay Livince Date: Fri, 28 Jun 2024 10:00:54 +0800 Subject: [PATCH 3/3] 7.0 small lib updates --- SaintCoinach/IO/PackIdentifier.cs | 3 ++- SaintCoinach/Text/TagType.cs | 1 + SaintCoinach/Xiv/Item.cs | 2 +- SaintCoinach/Xiv/Items/Equipment.cs | 1 + SaintCoinach/Xiv/Recipe.cs | 2 +- 5 files changed, 6 insertions(+), 3 deletions(-) diff --git a/SaintCoinach/IO/PackIdentifier.cs b/SaintCoinach/IO/PackIdentifier.cs index 91a43df3..ff51798e 100644 --- a/SaintCoinach/IO/PackIdentifier.cs +++ b/SaintCoinach/IO/PackIdentifier.cs @@ -36,7 +36,8 @@ public struct PackIdentifier { { "ex1", 0x01 }, { "ex2", 0x02 }, { "ex3", 0x03 }, - { "ex4", 0x04 } + { "ex4", 0x04 }, + { "ex5", 0x05 } }; public static readonly Dictionary KeyToExpansionMap = ExpansionToKeyMap.ToDictionary(_ => _.Value, _ => _.Key); #endregion diff --git a/SaintCoinach/Text/TagType.cs b/SaintCoinach/Text/TagType.cs index f01b3288..87c50c11 100644 --- a/SaintCoinach/Text/TagType.cs +++ b/SaintCoinach/Text/TagType.cs @@ -60,6 +60,7 @@ public enum TagType : byte { InstanceContent = 0x40, // Presumably so it can be clicked? UIForeground = 0x48, UIGlow = 0x49, + RubyCharaters = 0x4A, // Mostly used on Japanese, which means ZeroPaddedValue = 0x50, Unknown60 = 0x60, // TODO: Used as prefix in Gold Saucer announcements. } diff --git a/SaintCoinach/Xiv/Item.cs b/SaintCoinach/Xiv/Item.cs index d36ec7a0..5fa2c7af 100644 --- a/SaintCoinach/Xiv/Item.cs +++ b/SaintCoinach/Xiv/Item.cs @@ -69,7 +69,7 @@ public class Item : ItemBase { /// Gets a value indicating whether the current item is dyeable. /// /// A value indicating whether the current item is dyeable. - public bool IsDyeable { get { return AsBoolean("IsDyeable"); } } + public bool IsDyeable { get { return AsInt16("DyeCount") > 0; } } /// /// Gets a value indicating whether the current item is collectable. diff --git a/SaintCoinach/Xiv/Items/Equipment.cs b/SaintCoinach/Xiv/Items/Equipment.cs index 2e201134..80bb7c4c 100644 --- a/SaintCoinach/Xiv/Items/Equipment.cs +++ b/SaintCoinach/Xiv/Items/Equipment.cs @@ -273,6 +273,7 @@ public int GetModelCharacterType() { case 16: return 1501; // Hrothgar male case 17: return 1801; // Viera female case 18: return 1701; // Viera male + case 19: return 1601; // Hrothgar female default: throw new NotImplementedException(); } diff --git a/SaintCoinach/Xiv/Recipe.cs b/SaintCoinach/Xiv/Recipe.cs index de28852e..e046c136 100644 --- a/SaintCoinach/Xiv/Recipe.cs +++ b/SaintCoinach/Xiv/Recipe.cs @@ -199,7 +199,7 @@ public Recipe(IXivSheet sheet, IRelationalRow sourceRow) : base(sheet, sourceRow /// /// An array of s used in the current recipe. private RecipeIngredient[] BuildIngredients() { - const int MaterialCount = 10; + const int MaterialCount = 8; const int CrystalCategory = 59; var ingredients = new List();