Use C# event for mission selection

This commit is contained in:
Jarrod Doyle 2024-08-25 10:01:43 +01:00
parent 1c3c4cacb4
commit 56a5aa6869
Signed by: Jayrude
GPG Key ID: 38B57B16E7C0ADF7
2 changed files with 4 additions and 4 deletions

View File

@ -49,7 +49,7 @@ public partial class Mission : Node3D
_installPaths = new ResourcePathManager(extractPath);
var missionSelector = GetNode<Control>("%MissionSelector") as MissionSelector;
missionSelector.pathManager = _installPaths;
missionSelector.LoadMission += (string campaign, string mission) =>
missionSelector.MissionSelected += (string campaign, string mission) =>
{
if (campaign == null)
{

View File

@ -5,8 +5,8 @@ namespace KeepersCompound.TMV.UI;
public partial class MissionSelector : Control
{
[Signal]
public delegate void LoadMissionEventHandler(string campaign, string mission);
public event MissionSelectedEventHandler MissionSelected;
public delegate void MissionSelectedEventHandler(string campaign, string mission);
public ResourcePathManager pathManager;
@ -100,7 +100,7 @@ public partial class MissionSelector : Control
var missionIdx = missionIdxs[0];
var campaignName = campaignIdx == 0 ? null : _Campaigns.GetItemText(campaignIdx);
var missionName = _Missions.GetItemText(missionIdx);
EmitSignal(SignalName.LoadMission, campaignName, missionName);
MissionSelected(campaignName, missionName);
Visible = false;
}