public void OnOkClick(MyGuiControlButton sender) { if (m_mapsCombobox.GetSelectedItemKey() == null) { return; } //AddFriendSectorsResponse not called? if (m_sectorIdentifiers == null) { return; } MyMwcSectorIdentifier sectorIdentifier = m_sectorIdentifiers[m_mapsCombobox.GetSelectedItemKey().Value]; MyConfig.LastFriendName = m_findPlayerName.Text; MyConfig.LastFriendSectorPosition = sectorIdentifier.Position; MyConfig.LastFriendSectorUserId = sectorIdentifier.UserId.Value; MyConfig.Save(); MyGuiManager.CloseAllScreensNowExcept(MyGuiScreenGamePlay.Static); if (CustomLoadAction != null) { CustomLoadAction(sectorIdentifier); } else { MyGuiManager.AddScreen(new MyGuiScreenStartSessionProgress(m_startSessionType, m_startSessionProgressText, sectorIdentifier, MyGameplayDifficultyEnum.EASY, null, m_closeAfterSuccessfulEnter)); } }
public void OnOkClick(MyGuiControlButton sender) { if (m_sectors.Count == 0) { return; } MyMwcSectorIdentifier sectorIdentifier = m_sectors[m_sectorsListbox.GetSelectedItemKey().Value]; if (m_startSessionType == MyMwcStartSessionRequestTypeEnum.SANDBOX_FRIENDS) { //Remove 25D sectors from 2081 game and non 25D sectors from 25D game. if (sectorIdentifier.SectorName.ToUpper().Contains("2.5D") || sectorIdentifier.SectorName.ToUpper().Contains("2,5D")) { if (!MyClientServer.MW25DEnabled) { MyGuiManager.AddScreen(new MyGuiScreenMessageBox(MyMessageBoxType.MESSAGE, MyTextsWrapperEnum.YouNeed25D, MyTextsWrapperEnum.MessageBoxCaptionFeatureDisabled, MyTextsWrapperEnum.Ok, null)); return; } } else if (!MyClientServer.HasFullGame) { MyGuiManager.AddScreen(new MyGuiScreenMessageBox(MyMessageBoxType.MESSAGE, MyTextsWrapperEnum.YouNeedFullGame, MyTextsWrapperEnum.MessageBoxCaptionFeatureDisabled, MyTextsWrapperEnum.Ok, null)); return; } } MyConfig.LastSandboxSector = sectorIdentifier.Position; MyConfig.Save(); MyGuiManager.CloseAllScreensNowExcept(MyGuiScreenGamePlay.Static); if (CustomLoadAction != null) { CustomLoadAction(sectorIdentifier); } else { MyGuiManager.AddScreen(new MyGuiScreenStartSessionProgress(m_startSessionType, m_startSessionProgressText, sectorIdentifier, CommonLIB.AppCode.ObjectBuilders.MyGameplayDifficultyEnum.EASY, null, m_closeAfterSuccessfulEnter)); } }