From 56a5aa6869b2823c3a63e80e8db49de3c47dc36c Mon Sep 17 00:00:00 2001 From: Jarrod Doyle Date: Sun, 25 Aug 2024 10:01:43 +0100 Subject: [PATCH] Use C# event for mission selection --- project/code/TMV/Mission.cs | 2 +- project/code/TMV/UI/MissionSelector.cs | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/project/code/TMV/Mission.cs b/project/code/TMV/Mission.cs index 918fbf6..eb66f39 100644 --- a/project/code/TMV/Mission.cs +++ b/project/code/TMV/Mission.cs @@ -49,7 +49,7 @@ public partial class Mission : Node3D _installPaths = new ResourcePathManager(extractPath); var missionSelector = GetNode("%MissionSelector") as MissionSelector; missionSelector.pathManager = _installPaths; - missionSelector.LoadMission += (string campaign, string mission) => + missionSelector.MissionSelected += (string campaign, string mission) => { if (campaign == null) { diff --git a/project/code/TMV/UI/MissionSelector.cs b/project/code/TMV/UI/MissionSelector.cs index 712f945..b84a15e 100644 --- a/project/code/TMV/UI/MissionSelector.cs +++ b/project/code/TMV/UI/MissionSelector.cs @@ -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; }