Skip to content

Commit

Permalink
Merge pull request #193 from ClayLivince/global
Browse files Browse the repository at this point in the history
7.0 related small lib updates
  • Loading branch information
Supamiu authored Jun 28, 2024
2 parents 25be933 + 93beff7 commit a2950f8
Show file tree
Hide file tree
Showing 9 changed files with 36 additions and 15 deletions.
1 change: 1 addition & 0 deletions SaintCoinach.Cmd/App.config
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
<section name="SaintCoinach.Cmd.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false"/>
</sectionGroup>
<section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false"/>
<section name="system.data" type="System.Data.Common.DbProviderFactoriesConfigurationHandler, System.Data, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->
</configSections>
<startup>
Expand Down
3 changes: 2 additions & 1 deletion SaintCoinach/IO/PackIdentifier.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ public struct PackIdentifier {
{ "ex1", 0x01 },
{ "ex2", 0x02 },
{ "ex3", 0x03 },
{ "ex4", 0x04 }
{ "ex4", 0x04 },
{ "ex5", 0x05 }
};
public static readonly Dictionary<byte, string> KeyToExpansionMap = ExpansionToKeyMap.ToDictionary(_ => _.Value, _ => _.Key);
#endregion
Expand Down
34 changes: 25 additions & 9 deletions SaintCoinach/Imaging/IconHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand All @@ -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;
}
}
Expand Down
1 change: 1 addition & 0 deletions SaintCoinach/Text/TagType.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
}
Expand Down
2 changes: 1 addition & 1 deletion SaintCoinach/Xiv/Item.cs
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ public class Item : ItemBase {
/// Gets a value indicating whether the current item is dyeable.
/// </summary>
/// <value>A value indicating whether the current item is dyeable.</value>
public bool IsDyeable { get { return AsBoolean("IsDyeable"); } }
public bool IsDyeable { get { return AsInt16("DyeCount") > 0; } }

/// <summary>
/// Gets a value indicating whether the current item is collectable.
Expand Down
1 change: 1 addition & 0 deletions SaintCoinach/Xiv/Items/Equipment.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
Expand Down
2 changes: 1 addition & 1 deletion SaintCoinach/Xiv/Recipe.cs
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ public Recipe(IXivSheet sheet, IRelationalRow sourceRow) : base(sheet, sourceRow
/// </summary>
/// <returns>An array of <see cref="RecipeIngredient" />s used in the current recipe.</returns>
private RecipeIngredient[] BuildIngredients() {
const int MaterialCount = 10;
const int MaterialCount = 8;
const int CrystalCategory = 59;

var ingredients = new List<RecipeIngredient>();
Expand Down
4 changes: 2 additions & 2 deletions SaintCoinach/Xiv/TripleTriadCard.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
3 changes: 2 additions & 1 deletion SaintCoinach/app.config
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@
<configSections>
<section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false"/>
<!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->
<section name="system.data" type="System.Data.Common.DbProviderFactoriesConfigurationHandler, System.Data, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
</configSections>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.1"/>

</startup>
<entityFramework>
<providers>
Expand Down

0 comments on commit a2950f8

Please sign in to comment.