Use C# event for mission selection
This commit is contained in:
parent
1c3c4cacb4
commit
56a5aa6869
|
@ -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)
|
||||
{
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue