diff --git a/Alpha/Gui/Windows/ExcelWindow.cs b/Alpha/Gui/Windows/ExcelWindow.cs index a42b405..d4d6d27 100644 --- a/Alpha/Gui/Windows/ExcelWindow.cs +++ b/Alpha/Gui/Windows/ExcelWindow.cs @@ -52,7 +52,7 @@ ILogger logger this.config = config; this.GameData = gameData; this.logger = logger; - this.excel.GameData = gameData; + this.excel.SetGameData(gameData); this.InitialSize = new Vector2(800, 600); } diff --git a/Alpha/Services/Excel/ExcelService.cs b/Alpha/Services/Excel/ExcelService.cs index 3febea6..3f4e1fb 100644 --- a/Alpha/Services/Excel/ExcelService.cs +++ b/Alpha/Services/Excel/ExcelService.cs @@ -13,9 +13,7 @@ public class ExcelService(WindowManagerService windowManager, ILogger SheetsCache = new(); public readonly Dictionary SheetDefinitions = new(); - public string[] Sheets => (this.GameData?.GameData.Excel.SheetNames.ToArray() - .OrderBy(s => s) - .ToArray()) ?? []; + public string[] Sheets = []; private readonly HttpClient httpClient = new(); private readonly List resolvingDefinitions = new(); @@ -29,6 +27,9 @@ public void SetGameData(AlphaGameData gameData) { this.SheetsCache.Clear(); this.SheetDefinitions.Clear(); this.resolvingDefinitions.Clear(); + this.Sheets = this.GameData?.GameData.Excel.SheetNames.ToArray() + .OrderBy(s => s) + .ToArray() ?? []; } public IAlphaSheet? GetSheet(string name, bool skipCache = false, bool resolveDefinition = true) {