protected override void LoadSandboxInternal(Tuple <string, MyWorldInfo> save, bool MP) { base.LoadSandboxInternal(save, MP); if (save.Item1 == WORKSHOP_PATH_TAG) { var scenario = FindWorkshopScenario(save.Item2.WorkshopId.Value); MySteamWorkshop.CreateWorldInstanceAsync(scenario, MySteamWorkshop.MyWorkshopPathInfo.CreateScenarioInfo(), true, delegate(bool success, string sessionPath) { if (success) { //add briefing from workshop description ulong dummy; var checkpoint = MyLocalCache.LoadCheckpoint(sessionPath, out dummy); checkpoint.Briefing = save.Item2.Briefing; MyLocalCache.SaveCheckpoint(checkpoint, sessionPath); MyAnalyticsHelper.SetEntry(MyGameEntryEnum.Scenario); MyScenarioSystem.LoadMission(sessionPath, /*m_nameTextbox.Text, m_descriptionTextbox.Text,*/ MP, (MyOnlineModeEnum)m_onlineMode.GetSelectedKey(), (short)m_maxPlayersSlider.Value); } else { MyGuiSandbox.AddScreen(MyGuiSandbox.CreateMessageBox( messageText: MyTexts.Get(MySpaceTexts.MessageBoxTextWorkshopDownloadFailed), messageCaption: MyTexts.Get(MySpaceTexts.ScreenCaptionWorkshop))); } }); } else { MyAnalyticsHelper.SetEntry(MyGameEntryEnum.Scenario); MyScenarioSystem.LoadMission(save.Item1, /*m_nameTextbox.Text, m_descriptionTextbox.Text,*/ MP, (MyOnlineModeEnum)m_onlineMode.GetSelectedKey(), (short)m_maxPlayersSlider.Value); } }
protected override void LoadSandboxInternal(Tuple <string, MyWorldInfo> save, bool MP) { MyAnalyticsHelper.ReportTutorialStart(save.Item2.SessionName); base.LoadSandboxInternal(save, MP); MyAnalyticsHelper.SetEntry(MyGameEntryEnum.Tutorial); MyScenarioSystem.LoadMission(save.Item1, MP, MyOnlineModeEnum.OFFLINE, 5); }
public void SetTrue() { IsTrue = true; if (WwwLink != null && WwwLink.Length > 0) { MyGuiSandbox.OpenUrlWithFallback(WwwLink, "Scenario info", true); } if (NextMission != null && NextMission.Length > 0 && MySession.Static.IsScenario) { MyScenarioSystem.LoadNextScenario(NextMission); } }
private void LoadSandbox(bool MP) { MyLog.Default.WriteLine("LoadSandbox() - Start"); var row = m_scenarioTable.SelectedRow; if (row != null) { var save = FindSave(row); if (save != null) { if (save.Item1 == WORKSHOP_PATH_TAG) { var scenario = FindWorkshopScenario(save.Item2.WorkshopId.Value); MySteamWorkshop.CreateWorldInstanceAsync(scenario, MySteamWorkshop.MyWorkshopPathInfo.CreateScenarioInfo(), true, delegate(bool success, string sessionPath) { if (success) { //add briefing from workshop description ulong dummy; var checkpoint = MyLocalCache.LoadCheckpoint(sessionPath, out dummy); checkpoint.Briefing = save.Item2.Briefing; MyLocalCache.SaveCheckpoint(checkpoint, sessionPath); MyScenarioSystem.LoadMission(sessionPath, /*m_nameTextbox.Text, m_descriptionTextbox.Text,*/ MP, (MyOnlineModeEnum)m_onlineMode.GetSelectedKey(), (short)m_maxPlayersSlider.Value); } else { MyGuiSandbox.AddScreen(MyGuiSandbox.CreateMessageBox( messageText: MyTexts.Get(MySpaceTexts.MessageBoxTextWorkshopDownloadFailed), messageCaption: MyTexts.Get(MySpaceTexts.ScreenCaptionWorkshop))); } }); } else { MyScenarioSystem.LoadMission(save.Item1, /*m_nameTextbox.Text, m_descriptionTextbox.Text,*/ MP, (MyOnlineModeEnum)m_onlineMode.GetSelectedKey(), (short)m_maxPlayersSlider.Value); } } } MyLog.Default.WriteLine("LoadSandbox() - End"); }
protected override void LoadSandboxInternal(Tuple <string, MyWorldInfo> save, bool MP) { base.LoadSandboxInternal(save, MP); MyScenarioSystem.LoadMission(save.Item1, MP, MyOnlineModeEnum.OFFLINE, 5); }