Skip to content

Commit d8e8f66

Browse files
committed
Update v2.3.5.4
2 parents de803bd + 65da420 commit d8e8f66

File tree

23 files changed

+314
-84
lines changed

23 files changed

+314
-84
lines changed

xivModdingFramework/Cache/XivCache.cs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@
1818
using xivModdingFramework.Resources;
1919
using xivModdingFramework.SqPack.FileTypes;
2020

21+
using Index = xivModdingFramework.SqPack.FileTypes.Index;
22+
2123
namespace xivModdingFramework.Cache
2224
{
2325

@@ -145,9 +147,10 @@ public enum CacheRebuildReason
145147
/// <param name="gameDirectory"></param>
146148
/// <param name="language"></param>
147149
/// <param name="validateCache"></param>
148-
public static void SetGameInfo(DirectoryInfo gameDirectory = null, XivLanguage language = XivLanguage.None, int dxMode = 11, bool validateCache = true, bool enableCacheWorker = true)
150+
public static void SetGameInfo(DirectoryInfo gameDirectory = null, XivLanguage language = XivLanguage.None, int dxMode = 11, bool validateCache = true, bool enableCacheWorker = true,
151+
DirectoryInfo luminaDirectory = null, bool useLumina = false)
149152
{
150-
var gi = new GameInfo(gameDirectory, language, dxMode);
153+
var gi = new GameInfo(gameDirectory, language, dxMode, luminaDirectory, useLumina);
151154
SetGameInfo(gi, enableCacheWorker);
152155
}
153156
public static void SetGameInfo(GameInfo gameInfo = null, bool enableCacheWorker = true)

xivModdingFramework/Cache/XivDependencyGraph.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@
2626
using xivModdingFramework.Variants.FileTypes;
2727
using static xivModdingFramework.Cache.XivCache;
2828

29+
using Index = xivModdingFramework.SqPack.FileTypes.Index;
30+
2931
namespace xivModdingFramework.Cache
3032
{
3133

xivModdingFramework/Exd/FileTypes/Ex.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@
2323
using xivModdingFramework.Helpers;
2424
using xivModdingFramework.SqPack.FileTypes;
2525

26+
using Index = xivModdingFramework.SqPack.FileTypes.Index;
27+
2628
namespace xivModdingFramework.Exd.FileTypes
2729
{
2830
/// <summary>

xivModdingFramework/General/CMP.cs

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,19 @@ internal static async Task ApplyRgspFile(string filePath, IndexFile index = null
4040
var _dat = new Dat(XivCache.GameInfo.GameDirectory);
4141
var rgspData = await _dat.GetType2Data(filePath, false, index, modlist);
4242

43-
var rgsp = new RacialGenderScalingParameter(rgspData);
43+
await ApplyRgspFile(rgspData);
44+
}
45+
46+
/// <summary>
47+
/// Applies a custom .rgsp file to the main Human.CMP file.
48+
/// </summary>
49+
/// <param name="data"></param>
50+
/// <param name="index"></param>
51+
/// <param name="modlist"></param>
52+
/// <returns></returns>
53+
internal static async Task ApplyRgspFile(byte[] data, IndexFile index = null, ModList modlist = null)
54+
{
55+
var rgsp = new RacialGenderScalingParameter(data);
4456

4557
await SetScalingParameter(rgsp, index, modlist);
4658
}

xivModdingFramework/General/GameInfo.cs

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,20 @@ public class GameInfo
3030
public DirectoryInfo GameDirectory { get; }
3131

3232

33+
// These Lumina settings live here mostly for convenience, as they also should not be highly changeable data.
34+
// In the future, it may make sense to move them into the SQL metadata cache, but for now this is a more known-stable place to keep them.
35+
36+
/// <summary>
37+
/// Lumina output directory.
38+
/// </summary>
39+
public DirectoryInfo LuminaDirectory { get; }
40+
41+
/// <summary>
42+
/// Should mod output be redirected to Lumina?
43+
/// </summary>
44+
public bool UseLumina { get; }
45+
46+
3347
/// <summary>
3448
/// The current version of the game.
3549
/// </summary>
@@ -49,11 +63,13 @@ public class GameInfo
4963
/// </summary>
5064
/// <param name="gameDirectory">The directory in which the game is installed.</param>
5165
/// <param name="xivLanguage">The language to use when parsing the game data.</param>
52-
public GameInfo(DirectoryInfo gameDirectory, XivLanguage xivLanguage, int dxMode = 11)
66+
public GameInfo(DirectoryInfo gameDirectory, XivLanguage xivLanguage, int dxMode = 11, DirectoryInfo luminaDirectory = null, bool useLumina = false)
5367
{
5468
GameDirectory = gameDirectory;
5569
GameLanguage = xivLanguage;
5670
GameVersion = GetGameVersion();
71+
LuminaDirectory = luminaDirectory;
72+
UseLumina = useLumina;
5773
DxMode = dxMode;
5874

5975
if (!gameDirectory.FullName.Contains(Path.Combine("game", "sqpack", "ffxiv")))

xivModdingFramework/General/XivModelChara.cs

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
using System.Collections.Generic;
1818
using System.IO;
1919
using System.Threading.Tasks;
20+
using xivModdingFramework.Cache;
2021
using xivModdingFramework.Exd.Enums;
2122
using xivModdingFramework.Exd.FileTypes;
2223
using xivModdingFramework.Helpers;
@@ -98,11 +99,25 @@ public static XivModelInfo GetModelInfo(Dictionary<int, byte[]> modelCharaEx, in
9899

99100
// These are the offsets to relevant data
100101
// These will need to be changed if data gets added or removed with a patch
101-
const int modelDataOffset = 4;
102+
int startOffset = 4;
103+
int modelDataOffset = 8;
104+
if (XivCache.GameInfo.GameLanguage == Enums.XivLanguage.Chinese)
105+
{
106+
startOffset = 0;
107+
modelDataOffset = 4;
108+
109+
} else if (XivCache.GameInfo.GameLanguage == Enums.XivLanguage.Korean)
110+
{
111+
startOffset = 0;
112+
modelDataOffset = 4;
113+
}
102114

103115
// Big Endian Byte Order
104116
using (var br = new BinaryReaderBE(new MemoryStream(modelCharaEx[index])))
105117
{
118+
119+
120+
br.BaseStream.Seek(startOffset, SeekOrigin.Begin);
106121
xivModelInfo.PrimaryID = br.ReadInt16();
107122

108123
br.BaseStream.Seek(modelDataOffset, SeekOrigin.Begin);

xivModdingFramework/HUD/FileTypes/Uld.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@
2525
using xivModdingFramework.Helpers;
2626
using xivModdingFramework.SqPack.FileTypes;
2727

28+
using Index = xivModdingFramework.SqPack.FileTypes.Index;
29+
2830
namespace xivModdingFramework.HUD.FileTypes
2931
{
3032
/// <summary>

xivModdingFramework/Helpers/ProblemChecker.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@
2525
using xivModdingFramework.Resources;
2626
using xivModdingFramework.Cache;
2727

28+
using Index = xivModdingFramework.SqPack.FileTypes.Index;
29+
2830
namespace xivModdingFramework.Helpers
2931
{
3032
public class ProblemChecker

xivModdingFramework/Items/Categories/Gear.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@
3636
using xivModdingFramework.Textures.Enums;
3737
using xivModdingFramework.Variants.FileTypes;
3838

39+
using Index = xivModdingFramework.SqPack.FileTypes.Index;
40+
3941
namespace xivModdingFramework.Items.Categories
4042
{
4143
/// <summary>

xivModdingFramework/Items/Categories/Housing.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@
3333
using xivModdingFramework.Resources;
3434
using xivModdingFramework.SqPack.FileTypes;
3535

36+
using Index = xivModdingFramework.SqPack.FileTypes.Index;
37+
3638
namespace xivModdingFramework.Items.Categories
3739
{
3840
public class Housing

0 commit comments

Comments
 (0)