From 14934a890cca8f48ea948ecf6af4c6e844fedd1b Mon Sep 17 00:00:00 2001 From: Raymond Date: Wed, 25 Aug 2021 18:40:37 -0400 Subject: [PATCH] Expose DataManager.GameData Why not? --- Dalamud/Data/DataManager.cs | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/Dalamud/Data/DataManager.cs b/Dalamud/Data/DataManager.cs index a6285e80b..a78f0eec3 100644 --- a/Dalamud/Data/DataManager.cs +++ b/Dalamud/Data/DataManager.cs @@ -29,11 +29,6 @@ namespace Dalamud.Data { private const string IconFileFormat = "ui/icon/{0:D3}000/{1}{2:D6}.tex"; - /// - /// A object which gives access to any excel/game data. - /// - private GameData gameData; - private Thread luminaResourceThread; private CancellationTokenSource luminaCancellationTokenSource; @@ -64,10 +59,15 @@ namespace Dalamud.Data [UsedImplicitly] public ReadOnlyDictionary ClientOpCodes { get; private set; } + /// + /// Gets a object which gives access to any excel/game data. + /// + public GameData GameData { get; private set; } + /// /// Gets an object which gives access to any of the game's sheet data. /// - public ExcelModule Excel => this.gameData?.Excel; + public ExcelModule Excel => this.GameData?.Excel; /// /// Gets a value indicating whether Game Data is ready to be read. @@ -118,7 +118,7 @@ namespace Dalamud.Data var filePath = GameData.ParseFilePath(path); if (filePath == null) return default; - return this.gameData.Repositories.TryGetValue(filePath.Repository, out var repository) ? repository.GetFile(filePath.Category, filePath) : default; + return this.GameData.Repositories.TryGetValue(filePath.Repository, out var repository) ? repository.GetFile(filePath.Category, filePath) : default; } /// @@ -128,7 +128,7 @@ namespace Dalamud.Data /// True if the file exists. public bool FileExists(string path) { - return this.gameData.FileExists(path); + return this.GameData.FileExists(path); } /// @@ -312,10 +312,10 @@ namespace Dalamud.Data var processModule = Process.GetCurrentProcess().MainModule; if (processModule != null) { - this.gameData = new GameData(Path.Combine(Path.GetDirectoryName(processModule.FileName), "sqpack"), luminaOptions); + this.GameData = new GameData(Path.Combine(Path.GetDirectoryName(processModule.FileName), "sqpack"), luminaOptions); } - Log.Information("Lumina is ready: {0}", this.gameData.DataPath); + Log.Information("Lumina is ready: {0}", this.GameData.DataPath); this.IsDataReady = true; @@ -326,9 +326,9 @@ namespace Dalamud.Data { while (!luminaCancellationToken.IsCancellationRequested) { - if (this.gameData.FileHandleManager.HasPendingFileLoads) + if (this.GameData.FileHandleManager.HasPendingFileLoads) { - this.gameData.ProcessFileHandleQueue(); + this.GameData.ProcessFileHandleQueue(); } else {