Exemple #1
0
        protected override void OnOkClick(MyGuiControlButton sender)
        {
            MyMwcSectorTypeEnum sectorType = string.IsNullOrEmpty(m_playerName.Text) ? MyMwcSectorTypeEnum.STORY : MyMwcSectorTypeEnum.SANDBOX;
            bool namedSector = !string.IsNullOrEmpty(m_sector_name.Text);
            MyMwcSectorIdentifier sectorIdentifier;

            if (namedSector)
            {
                sectorIdentifier = new MyMwcSectorIdentifier(sectorType, null, new MyMwcVector3Int(0, 0, 0), m_sector_name.Text);
            }
            else
            {
                int x, y, z;
                if (!int.TryParse(m_sectorIdentifierX.Text, out x) ||
                    !int.TryParse(m_sectorIdentifierY.Text, out y) ||
                    !int.TryParse(m_sectorIdentifierZ.Text, out z))
                {
                    MyGuiManager.AddScreen(new MyGuiScreenMessageBox(MyMessageBoxType.ERROR,
                                                                     MyTextsWrapperEnum.BadSectorIdentifierInput, MyTextsWrapperEnum.MessageBoxCaptionError,
                                                                     MyTextsWrapperEnum.Ok, null));
                    return;
                }

                sectorIdentifier = new MyMwcSectorIdentifier(sectorType, null, new MyMwcVector3Int(x, y, z), null);
            }

            // This screen will be closed on successfull load from progress screen
            MyGuiManager.AddScreen(new MyGuiScreenEditorLoadSectorObjectsProgress(
                                       this, MyTextsWrapperEnum.LoadingPleaseWait, m_playerName.Text, sectorIdentifier));
        }
Exemple #2
0
        public string              SectorName;          //  Name of sector

        public MyMwcSectorIdentifier(MyMwcSectorTypeEnum sectorType, int?userId, MyMwcVector3Int position, string sectorName)
        {
            SectorType = sectorType;
            UserId     = userId;
            Position   = position;
            SectorName = sectorName == null ? string.Empty : sectorName;
        }
Exemple #3
0
        //  TODO: This is just temporary method that launches editor. Later must be differentiate according to what user picked
        void Run(MyMwcStartSessionRequestTypeEnum sessionRequestType, bool global)
        {
            MyMwcSectorTypeEnum sectorType = MyMwcClientServer.GetSectorTypeFromSessionType(sessionRequestType);

            MyGuiManager.AddScreen(new MyGuiScreenLoadSectorIdentifiersProgress(sectorType, global, new MyGuiScreenEnterSectorMap(m_closeAfterSuccessfulEnter,
                                                                                                                                  sessionRequestType, MyTextsWrapperEnum.StartEditorInProgressPleaseWait, MyConfig.LastSandboxSector)));
        }
 public MyGuiScreenLoadSectorIdentifiersProgress(MyMwcSectorTypeEnum sectorType, bool global, Action<List<MyMwcSectorIdentifier>> successAction)
     : base(MyTextsWrapperEnum.LoadSectorIdentifiersPleaseWait, false)
 {
     m_backgroundFadeColor = MyGuiConstants.SCREEN_BACKGROUND_FADE_BLANK_DARK_PROGRESS_SCREEN;
     m_successAction = successAction;
     m_sectorType = sectorType;
     m_loadGlobal = global;
 }
Exemple #5
0
 public MyGuiScreenLoadSectorIdentifiersProgress(MyMwcSectorTypeEnum sectorType, bool global, Action <List <MyMwcSectorIdentifier> > successAction)
     : base(MyTextsWrapperEnum.LoadSectorIdentifiersPleaseWait, false)
 {
     m_backgroundFadeColor = MyGuiConstants.SCREEN_BACKGROUND_FADE_BLANK_DARK_PROGRESS_SCREEN;
     m_successAction       = successAction;
     m_sectorType          = sectorType;
     m_loadGlobal          = global;
 }
 public MyGuiScreenLoadCheckpointProgress(MyMwcSectorTypeEnum sessionType, MyMwcSessionStateEnum sessionStartType, int? userId, MyMwcVector3Int? position, string checkpointName, System.Action<MyMwcObjectBuilder_Checkpoint> enterSectorSuccessfulAction)
     : base(MyTextsWrapperEnum.EnterSectorInProgressPleaseWait, false, TimeSpan.FromSeconds(360)) // Some missions loads very long (Roch's junkyard)
 {
     m_backgroundFadeColor = MyGuiConstants.SCREEN_BACKGROUND_FADE_BLANK_DARK_PROGRESS_SCREEN;
     m_sessionType = sessionType;
     m_sessionStartType = sessionStartType;
     m_userId = userId;
     m_sectorPosition = position;
     m_checkpointName = checkpointName;
     m_loadCheckpointSuccessfulAction = enterSectorSuccessfulAction;
 }
 public MyGuiScreenLoadCheckpointProgress(MyMwcSectorTypeEnum sessionType, MyMwcSessionStateEnum sessionStartType, int?userId, MyMwcVector3Int?position, string checkpointName, System.Action <MyMwcObjectBuilder_Checkpoint> enterSectorSuccessfulAction)
     : base(MyTextsWrapperEnum.EnterSectorInProgressPleaseWait, false, TimeSpan.FromSeconds(360)) // Some missions loads very long (Roch's junkyard)
 {
     m_backgroundFadeColor = MyGuiConstants.SCREEN_BACKGROUND_FADE_BLANK_DARK_PROGRESS_SCREEN;
     m_sessionType         = sessionType;
     m_sessionStartType    = sessionStartType;
     m_userId         = userId;
     m_sectorPosition = position;
     m_checkpointName = checkpointName;
     m_loadCheckpointSuccessfulAction = enterSectorSuccessfulAction;
 }
        void ChooseSandbox(MyMwcStartSessionRequestTypeEnum sessionRequestType, bool global)
        {
            MyMwcSectorTypeEnum sectorType = MyMwcClientServer.GetSectorTypeFromSessionType(sessionRequestType);

            var selectSectorScreen = new MyGuiScreenEnterSectorMap(m_closeAfterSuccessfulEnter, sessionRequestType, MyTextsWrapperEnum.StartGameInProgressPleaseWait, MyConfig.LastSandboxSector);

            selectSectorScreen.CustomLoadAction = StartSandbox;

            bool isOfficialSandbox = sessionRequestType == MyMwcStartSessionRequestTypeEnum.SANDBOX_FRIENDS && global;

            if (isOfficialSandbox)
            {
                selectSectorScreen.SetSectorSourceAction(MyLocalCache.GetOfficialMultiplayerSectorIdentifiers);
                MyGuiManager.AddScreen(selectSectorScreen);
            }
            else
            {
                MyGuiScreenMainMenu.AddLoginScreen(new MyGuiScreenLoadSectorIdentifiersProgress(sectorType, global, selectSectorScreen));
            }
        }
Exemple #9
0
 public static bool IsSupported(MyMwcSectorTypeEnum sectorType, int?userId)
 {
     return(sectorType == CommonLIB.AppCode.Networking.MyMwcSectorTypeEnum.STORY && userId != null);
 }
 public MyGuiScreenLoadSectorIdentifiersProgress(MyMwcSectorTypeEnum sectorType, bool global, MyGuiScreenEnterSectorMap openAfterSuccessfulEnter)
     :this(sectorType, global, new Action<List<MyMwcSectorIdentifier>>((sectors) => OpenScreen(openAfterSuccessfulEnter, sectors)))
 {
 }
Exemple #11
0
 public MyGuiScreenLoadSectorIdentifiersProgress(MyMwcSectorTypeEnum sectorType, bool global, MyGuiScreenEnterSectorMap openAfterSuccessfulEnter)
     : this(sectorType, global, new Action <List <MyMwcSectorIdentifier> >((sectors) => OpenScreen(openAfterSuccessfulEnter, sectors)))
 {
 }