Skip to content

Commit 0d4f5fd

Browse files
committed
Addition of Export All Bones config option.
1 parent 9fbd5cb commit 0d4f5fd

File tree

2 files changed

+21
-2
lines changed

2 files changed

+21
-2
lines changed

xivModdingFramework/Cache/XivCache.cs

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1261,7 +1261,7 @@ public static async Task<List<IItem>> GetFullItemList()
12611261
/// </summary>
12621262
/// <param name="key"></param>
12631263
/// <param name="value"></param>
1264-
public static void SetMetaValue(string key, string value = null)
1264+
public static void SetMetaValue(string key, string value)
12651265
{
12661266
using (var db = new SQLiteConnection(CacheConnectionString))
12671267
{
@@ -1275,6 +1275,20 @@ public static void SetMetaValue(string key, string value = null)
12751275
}
12761276
}
12771277
}
1278+
public static void SetMetaValue(string key, bool value)
1279+
{
1280+
SetMetaValue(key, value ? "True" : "False");
1281+
}
1282+
public static bool GetMetaValueBoolean(string key)
1283+
{
1284+
var st = GetMetaValue(key);
1285+
1286+
bool result = false;
1287+
bool success = Boolean.TryParse(st, out result);
1288+
1289+
if (!success) return false;
1290+
return result;
1291+
}
12781292

12791293
/// <summary>
12801294
/// Retrieves a meta value from the cache.

xivModdingFramework/Models/DataContainers/TTModel.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -293,6 +293,8 @@ public uint IndexCount
293293
/// </summary>
294294
public class TTModel
295295
{
296+
public static string _SETTINGS_KEY_EXPORT_ALL_BONES = "setting_export_all_bones";
297+
296298
/// <summary>
297299
/// The internal or external file path where this TTModel originated from.
298300
/// </summary>
@@ -832,7 +834,10 @@ public void SaveToFile(string filePath, Action<bool, string> loggingFunction = n
832834
var connectionString = "Data Source=" + filePath + ";Pooling=False;";
833835
try
834836
{
835-
var boneDict = ResolveBoneHeirarchy(null, XivRace.All_Races, Bones, loggingFunction);
837+
var useAllBones = XivCache.GetMetaValueBoolean(_SETTINGS_KEY_EXPORT_ALL_BONES);
838+
var bones = useAllBones ? null : Bones;
839+
840+
var boneDict = ResolveBoneHeirarchy(null, XivRace.All_Races, bones, loggingFunction);
836841

837842
const string creationScript = "CreateImportDB.sql";
838843
// Spawn a DB connection to do the raw queries.

0 commit comments

Comments
 (0)