From 3270d89b05f9213ff4c193b1fa5a37093e1b98af Mon Sep 17 00:00:00 2001 From: Jarrod Doyle Date: Sun, 25 Aug 2024 10:08:48 +0100 Subject: [PATCH] Store campaign and mission name on Mission --- project/code/TMV/Mission.cs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/project/code/TMV/Mission.cs b/project/code/TMV/Mission.cs index cad5774..eec2a2d 100644 --- a/project/code/TMV/Mission.cs +++ b/project/code/TMV/Mission.cs @@ -39,6 +39,8 @@ public partial class Mission : Node3D [Export] public bool Dump = false; + string _campaignName; + string _missionName; ResourcePathManager _installPaths; DbFile _file; TextureLoader _textureLoader; @@ -51,6 +53,8 @@ public partial class Mission : Node3D missionSelector.pathManager = _installPaths; missionSelector.MissionSelected += (string campaign, string mission) => { + _campaignName = campaign; + _missionName = mission; FileName = _installPaths.GetMissionPath(campaign, mission); Build = true; }; @@ -94,8 +98,7 @@ public partial class Mission : Node3D ClearMap(); // TODO: This shouldn't be set for things that aren't actually FMs - var fmName = FileName.GetBaseDir().GetFile(); - _textureLoader = new TextureLoader(fmName); + _textureLoader = new TextureLoader(_campaignName); _file = new(FileName); UseChunk("TXLIST", LoadTextures); UseChunk("WREXT", BuildWrMeshes);