7 protected MissionWorkshopItem m_Scenario;
24 protected void Init(MissionWorkshopItem scenario)
31 widgets.m_ScenarioNameText.SetText(header.m_sName);
33 widgets.m_ScenarioNameText.SetText(scenario.Name());
38 string image = header.m_sIcon;
41 widgets.m_ScenarioImage.LoadImageTexture(0, image,
false,
true);
44 widgets.m_ScenarioImage.SetVisible(
false);
47 widgets.m_ScenarioImage.SetVisible(
false);
53 if (!header.IsMultiplayer())
55 widgets.m_HostButton.SetVisible(
false);
56 widgets.m_HostButton.SetEnabled(
false);
64 override void OnMenuOpen()
68 widgets.m_PlayButtonComponent.m_OnActivated.Insert(OnPlay);
69 widgets.m_HostButtonComponent.m_OnActivated.Insert(OnHost);
70 widgets.m_JoinButtonComponent.m_OnActivated.Insert(OnJoin);
100 ref DSConfig config =
new DSConfig;
101 ref DSGameConfig game =
new DSGameConfig;
104 game.maxPlayers =
m_Scenario.GetPlayerCount();
105 game.name =
m_Scenario.Name() +
" - " + System.GetMachineName();
106 WorkshopItem hostedMod =
m_Scenario.GetOwner();
108 game.hostedScenarioModId = hostedMod.Id();
110 ref array<WorkshopItem> offlineMods =
new array<WorkshopItem>;
111 ref array<ref DSMod> modIds =
new array<ref DSMod>;
112 GetGame().GetBackendApi().GetWorkshop().GetOfflineItems(offlineMods);
113 foreach(
auto mod : offlineMods)
115 ref DSMod modData =
new DSMod;
116 modData.modId = mod.Id();
117 modData.name = mod.Name();
118 modData.version = mod.GetActiveRevision().GetVersion();
119 modIds.Insert(modData);
121 config.game.mods = modIds;
127 override protected void OnConfirm()