Centralize legacy catalog access

This commit is contained in:
Meta Vens 2026-06-13 10:45:01 +01:00
commit be1c8801ed
5 changed files with 35 additions and 26 deletions

View file

@ -37,6 +37,7 @@ public class ActionGameManager : MonoBehaviour
public static string AetheriaStateFilePath => LegacyCatalogBoundary.GetStateFilePath(GameDataDirectory);
public static string LegacyAetherDatabasePath => LegacyCatalogBoundary.GetLegacyCatalogPath(GameDataDirectory);
public static ILegacyCatalogReader LegacyCatalog => LegacyCatalogBoundary.GetCatalog(GameDataDirectory);
private static PlayerSettings _playerSettings;
public static PlayerSettings PlayerSettings
@ -234,7 +235,7 @@ public class ActionGameManager : MonoBehaviour
Debug.Log($"Aetheria typed state file: {AetheriaStateFilePath}");
Debug.Log($"Aetheria legacy item catalog: {LegacyAetherDatabasePath}");
ItemManager = new ItemManager(
LegacyCatalogBoundary.GetCatalog(GameDataDirectory),
LegacyCatalog,
Settings.GameplaySettings,
Debug.Log);
ZoneRenderer.ItemManager = ItemManager;

View file

@ -117,7 +117,7 @@ public class MainMenu : MonoBehaviour
Settings.SectorGenerationSettings,
Settings.SectorBackgroundSettings,
Settings.NameGeneratorSettings,
LegacyCatalogBoundary.GetCatalog(ActionGameManager.GameDataDirectory),
ActionGameManager.LegacyCatalog,
Debug.Log,
setState);
Observable.NextFrame().Subscribe(_ =>
@ -143,7 +143,7 @@ public class MainMenu : MonoBehaviour
Settings.TutorialGenerationSettings,
Settings.TutorialBackgroundSettings,
Settings.NameGeneratorSettings,
LegacyCatalogBoundary.GetCatalog(ActionGameManager.GameDataDirectory),
ActionGameManager.LegacyCatalog,
ActionGameManager.PlayerSettings,
ActionGameManager.GameDataDirectory.CreateSubdirectory("Narrative"),
Debug.Log,

View file

@ -390,7 +390,7 @@ public class PropertiesPanel : MonoBehaviour
AddProperty("Quantity", () => simpleCommodity.Quantity.ToString());
var sheet = AddStatSheet();
var manufacturer = LegacyCatalogBoundary.GetCatalog(ActionGameManager.GameDataDirectory).Get<Faction>(data.Manufacturer);
var manufacturer = GameManager.ItemManager.ItemData.Get<Faction>(data.Manufacturer);
sheet.AddStat("Manufacturer", () => manufacturer?.Name ?? "GameCult");
sheet.AddStat("Mass", () => ActionGameManager.PlayerSettings.Format(GameManager.ItemManager.GetMass(item)));