public MyGuiContextMenuItemHelper(MyTextsWrapperEnum description, MyGuiContextMenuItemActionType actionType, bool enabled, MyTextsWrapperEnum? toolTip)
     : base(description)
 {
     ActionType = actionType;
     Enabled = enabled;
     m_toolTip = toolTip;
 }
 public MyHarvestOreSubmission(MyTextsWrapperEnum name, MyMissionID id, MyTextsWrapperEnum description, MyTexture2D icon, MyMission parentMission, MyMissionID[] requiredMissions, MyMissionLocation location, MyMwcObjectBuilder_Ore_TypesEnum ore, float amount, MyDialogueEnum successDialogId)
     : base(name, id, description, icon, parentMission, requiredMissions, null, successDialogId: successDialogId)
 {
     Location = location;
     m_amount = amount;
     m_ore = ore;
 }
        public static MyGuiScreenStartQuickLaunch CurrentScreen = null;    //  This is always filled with reference to actual instance of this scree. If there isn't, it's null.


        public MyGuiScreenStartQuickLaunch(MyMwcQuickLaunchType quickLaunchType, MyTextsWrapperEnum progressText) :
            base(new Vector2(0.5f, 0.5f), MyGuiConstants.SCREEN_BACKGROUND_COLOR, null)
        {
            m_quickLaunchType = quickLaunchType;
            m_backgroundFadeColor = MyGuiConstants.SCREEN_BACKGROUND_FADE_BLANK_DARK_PROGRESS_SCREEN;
            CurrentScreen = this;
        }
        public static MyGuiScreenStartSessionProgress CurrentScreen = null;    //  This is always filled with reference to actual instance of this scree. If there isn't, it's null.


        public MyGuiScreenStartSessionProgress(MyMwcStartSessionRequestTypeEnum sessionType,  MyTextsWrapperEnum progressText, MyMwcSectorIdentifier? sectorIdentifier, MyGameplayDifficultyEnum difficulty, string checkpointName, MyGuiScreenBase closeAfter) : 
            base(progressText, false)
        {
            // TODO: Not ready yet
            //Debug.Assert(sessionType != MyMwcStartSessionRequestTypeEnum.NEW_STORY && sessionType != MyMwcStartSessionRequestTypeEnum.LOAD_CHECKPOINT, "Invalid operation, call OndrejP");

            m_sectorIdentifier = sectorIdentifier;
            m_sessionType = sessionType;
            m_backgroundFadeColor = MyGuiConstants.SCREEN_BACKGROUND_FADE_BLANK_DARK_PROGRESS_SCREEN;
            m_closeAfter = closeAfter;
            m_difficulty = difficulty;
            m_checkpointName = checkpointName;
            CurrentScreen = this;

            OnSuccessEnter = new Action<MyGuiScreenGamePlayType, MyMwcStartSessionRequestTypeEnum, MyMwcObjectBuilder_Checkpoint>((screenType, sessType, checkpoint) =>
            {
                var newGameplayScreen = new MyGuiScreenGamePlay(screenType, null, checkpoint.CurrentSector, checkpoint.SectorObjectBuilder.Version, sessType);
                var loadScreen = new MyGuiScreenLoading(newGameplayScreen, MyGuiScreenGamePlay.Static);

                if (sessType == MyMwcStartSessionRequestTypeEnum.NEW_STORY)
                    loadScreen.AddEnterSectorResponse(checkpoint, MyMissionID.EAC_SURVEY_SITE);
                else
                    loadScreen.AddEnterSectorResponse(checkpoint, null);

                MyGuiManager.AddScreen(loadScreen);
            });
        }
Пример #5
0
        public MyUseObjective(
            MyTextsWrapperEnum name,
            MyMissionID id,
            MyTextsWrapperEnum description,
            MyTexture2D icon,
            MyMission parentMission,
            MyMissionID[] requiredMissions,
            MyMissionLocation location,
            MyTextsWrapperEnum notificationText,
            MyTextsWrapperEnum useCaption,
            MyTextsWrapperEnum useText,
            int requiredTime,
            MyUseObjectiveType objectiveType = MyUseObjectiveType.Hacking,
            MyDialogueEnum? successDialogId = null,
            MyDialogueEnum? startDialogId = null,
            float? radiusOverride = null,
            List<uint> fakeMissionIds = null,
            uint? realMissionId = null)
            : base(name, id, description, icon, parentMission, requiredMissions, location, fakeMissionIds, successDialogId, startDialogId, radiusOverride: radiusOverride)
        {
            m_notificationText = notificationText;
            m_useText = useText;
            m_useCaption = useCaption;
            m_requiredTime = requiredTime;
            m_realMissionEntityId = realMissionId;
            InitSounds(objectiveType);

            if (location != null)
            {
                if (location.LocationEntityIdentifier.LocationEntityId != null)
                {
                    RequiredEntityIDs.Add(location.LocationEntityIdentifier.LocationEntityId.Value);
                }
            }
        }
Пример #6
0
 public MyTimedObjective(MyTextsWrapperEnum name, MyMissionID id, MyTextsWrapperEnum description, MyTexture2D icon, MyMission parentMission, MyMissionID[] requiredMissions, TimeSpan submissionDuration, bool isOn)
     : this(name, id, description, icon, parentMission, requiredMissions, submissionDuration)
 {
     m_isOn = isOn;
     m_defaultState = m_isOn;
     DisplayCounter = true;
 }
Пример #7
0
        public MyGuiScreenLoading(MyGuiScreenGamePlay screenToLoad, MyGuiScreenGamePlay screenToUnload, MyTexture2D textureFromConstructor)
            : base(Vector2.Zero, null, null)
        {
            MyLoadingPerformance.Instance.StartTiming();

            System.Diagnostics.Debug.Assert(Static == null);
            Static = this;

            m_screenToLoad = screenToLoad;
            m_screenToUnload = screenToUnload;
            m_closeOnEsc = false;
            DrawMouseCursor = false;
            m_loadInDrawFinished = false;
            m_drawEvenWithoutFocus = true;
            m_currentQuoteOfTheDay = MyQuoteOfTheDay.GetRandomQuote();
            
            Vector2 loadingTextSize = MyGuiManager.GetNormalizedSize(MyGuiManager.GetFontMinerWarsBlue(),
                MyTextsWrapper.Get(MyTextsWrapperEnum.LoadingPleaseWait), MyGuiConstants.LOADING_PLEASE_WAIT_SCALE);
            m_rotatingWheelTexture = MyGuiManager.GetLoadingTexture();
            Controls.Add(new MyGuiControlRotatingWheel(this, MyGuiConstants.LOADING_PLEASE_WAIT_POSITION - new Vector2(0, 0.075f + loadingTextSize.Y),
                MyGuiConstants.ROTATING_WHEEL_COLOR, MyGuiConstants.ROTATING_WHEEL_DEFAULT_SCALE, MyGuiDrawAlignEnum.HORISONTAL_CENTER_AND_VERTICAL_CENTER, m_rotatingWheelTexture));
            m_backgroundTextureFromConstructor = textureFromConstructor;

            m_loadFinished = false;
            
            if (m_screenToLoad != null)
            {
                MyMinerGame.IsGameReady = false;
            }
        }
 public MyGuiScreenProgressAsync(MyTextsWrapperEnum text, bool enableCancel, Func<IAsyncResult> beginAction, Action<IAsyncResult, MyGuiScreenProgressAsync> endAction)
     : base(text, enableCancel)
 {
     FriendlyName = "MyGuiScreenProgressAsync";
     m_beginAction = beginAction;
     m_endAction = endAction;
 }
Пример #9
0
 public MyNotification(MyTextsWrapperEnum notificationText, int disapearTimeMs, MyEntity owner = null,
                       object[] textFormatArguments = null)
     : this(notificationText, GetCurrentScreen(), 1.0f, MyGuiConstants.DEFAULT_CONTROL_FONT,
            MyGuiDrawAlignEnum.HORISONTAL_CENTER_AND_VERTICAL_CENTER, disapearTimeMs, owner, false,
            textFormatArguments)
 {
 }
Пример #10
0
 // construction from: precopyed MyTextWrapperEnum in normalized position with scale and textColor, with textAlign
 // and asociated user function or delegate returns approvement of the event with added textFormatArguments for MyTextWrapperEnum
 // and also settings for the time disapeartin of the notification
 public MyNotification(MyTextsWrapperEnum notificationText, MyGuiScreenGamePlayType LifeArea, float scale,
                       MyGuiFont font,
                       MyGuiDrawAlignEnum textAlign, int disapearTimeMs, MyEntity owner = null, bool showConfirmMessage = false,
                       object[] textFormatArguments = null)
     : this((int)notificationText, null, LifeArea, scale, font, textAlign, disapearTimeMs, owner, showConfirmMessage, textFormatArguments)
 {                
 }
        public MyMultipleUseObjective(
            MyTextsWrapperEnum name,
            MyMissionID id,
            MyTextsWrapperEnum description,
            MyTexture2D icon,
            MyMission parentMission,
            MyMissionID[] requiredMissions,
            MyTextsWrapperEnum notificationText,
            MyTextsWrapperEnum useCaption,
            MyTextsWrapperEnum useText,
            int requiredTime,
            List<uint> MissionEntityIDs,
            MyUseObjectiveType objectiveType = MyUseObjectiveType.Hacking,


            MyDialogueEnum? startDialogId = null)
            : base(name, id, description, icon, parentMission, requiredMissions, null, MissionEntityIDs, startDialogId: startDialogId)
        {
            m_notificationText = notificationText;
            m_useText = useText;
            m_useCaption = useCaption;
            m_requiredTime = requiredTime;

            m_objectiveType = objectiveType;
        }
 public MyAspectRatioEx(bool isTripleHead, MyAspectRatioEnum aspectRatioEnum, float aspectRatioNumber, MyTextsWrapperEnum textLong, MyTextsWrapperEnum textShort)
 {
     IsTripleHead = isTripleHead;
     AspectRatioEnum = aspectRatioEnum;
     AspectRatioNumber = aspectRatioNumber;
     TextLong = textLong;
     TextShort = textShort;
 }
Пример #13
0
        public static StringBuilder Get(MyTextsWrapperEnum textEnum)
        {
            if (m_sb == null)
                return MyMwcUtils.EmptyStringBuilder;

            //return m_sb[(int)textEnum];
            return m_sb[(int)textEnum];
        }
Пример #14
0
 private void Notify(MyTextsWrapperEnum text, object[] args)
 {
     var handler = OnNotification;
     if (handler != null)
     {
         handler(text, args);
     }
 }
 public MyObjectiveDisablePrefabs(MyTextsWrapperEnum name, MyMissionID id, MyTextsWrapperEnum description, MyTexture2D icon, MyMission parentMission, 
         MyMissionID[] requiredMissions, List<uint> toDisable, List<uint> disableBy, bool displayObjectivesCount = true, 
         bool markObjectsToDisable = true, MyDialogueEnum? successDialogId = null, MyDialogueEnum? startDialogId = null)
     : base(name, id, description, icon, parentMission, requiredMissions, null, disableBy, successDialogId, startDialogId,  displayObjectivesCount: displayObjectivesCount)
 {
     m_toDisable = toDisable;
     m_markObjectsToDisable = markObjectsToDisable;
     RequiredEntityIDs.AddRange(toDisable);
 }
Пример #16
0
 public MyFactionProperties(
     MyTextsWrapperEnum NameEnum,
     MyTextsWrapperEnum DescriptionEnum,
     MyTransparentMaterialEnum? SolarMapIcon)
 {
     this.NameEnum = NameEnum;
     this.DescriptionEnum = DescriptionEnum;
     this.SolarMapIcon = SolarMapIcon;
 }
        public void SendMissionProgress(MyMissionBase mission, MyMissionProgressType progressType, MyTextsWrapperEnum? messageEnum = null)
        {
            MyEventMissionProgress message = new MyEventMissionProgress();
            message.MissionId = mission != null ? (int)mission.ID : (int?)null;
            message.ProgressType = progressType;
            message.MessageEnum = messageEnum.HasValue ? (int)messageEnum.Value : (int?)null;

            Peers.SendToAll(ref message, NetDeliveryMethod.ReliableOrdered);
        }
Пример #18
0
 public MyObjectiveDestroy(MyTextsWrapperEnum name, MyMissionID id, MyTextsWrapperEnum description, MyTexture2D icon, MyMission parentMission, MyMissionID[] requiredMissions, List<uint> toKill, List<uint> toKillSpawnpoints, bool showMarks = true, bool displayObjectivesCount = true, MyDialogueEnum? successDialogID = null, MyDialogueEnum? startDialogID = null)
     : base(name, id, description, icon, parentMission, requiredMissions, null, displayObjectivesCount: displayObjectivesCount, successDialogId: successDialogID, startDialogId: startDialogID)
 {
     m_toKill = toKill;
     m_toKillSpawnpoints = toKillSpawnpoints;
     m_showMarks = showMarks;
     FailIfEntityDestroyed = false;
     MakeEntityIndestructible = false;
 }
Пример #19
0
        public MyGuiControlLabel(IMyGuiControlsParent parent, Vector2 position, Vector2? size, MyTextsWrapperEnum textEnum, Vector4 textColor, float textScale, MyGuiDrawAlignEnum textAlign)
            : base(parent, position, size, null, null, false)
        {
            m_type = MyGuiControlLabelType.DEFINED_BY_TEXT_WRAPPER_ENUM;

            m_textEnum = textEnum;

            Init(textColor, textScale, textAlign);
        }
        public static MyGuiScreenSelectSandboxProgress CurrentScreen = null;    //  This is always filled with reference to actual instance of this scree. If there isn't, it's null.


        public MyGuiScreenSelectSandboxProgress(MyMwcSelectSectorRequestTypeEnum selectSandboxType, MyTextsWrapperEnum progressText, MyGuiScreenBase openAfterSuccessfulEnter, string findPlayerName, AddResponseDelegate responseHandler) : 
            base(progressText, false)
        {
            m_selectSandboxType = selectSandboxType;
            m_backgroundFadeColor = MyGuiConstants.SCREEN_BACKGROUND_FADE_BLANK_DARK_PROGRESS_SCREEN;
            m_openAfterSuccessfulEnter = openAfterSuccessfulEnter;
            m_findPlayerName = findPlayerName;
            CurrentScreen = this;
            m_responseHandler = responseHandler;
        }
        public MyGuiScreenUseProgressBar(MyTextsWrapperEnum caption, StringBuilder text, float value, MySoundCuesEnum? progressCueEnum, MySoundCuesEnum? cancelCueEnum, MyGameControlEnums gameControl, int closeTime, int successTime, int decimals, MySoundCuesEnum? successCueEnum = null)
            : base(caption, text, value, progressCueEnum, cancelCueEnum, decimals, successCueEnum)
        {
            DrawMouseCursor = false;

            m_gameControl = gameControl;
            m_closeTime = closeTime;
            m_successTime = successTime;            
            //m_startedTime = MyMinerGame.TotalGamePlayTimeInMilliseconds;
        }        
 public MyGuiScreenEditorObject3DBase(MyEntity physObject, Vector2 position, Vector4 backgroundColor, Vector2? size, MyTextsWrapperEnum caption, Vector2? screenPosition = null)
     : base(position, backgroundColor, size)
 {
     m_caption = caption;
     m_newObjectPosition = MySpectator.Target + 2000 * MySpectator.Orientation;
     m_entity = physObject;
     m_backgroundFadeColor = MyGuiConstants.SCREEN_BACKGROUND_FADE_BLANK_DARK;
     m_backgroundFadeColor.W = 0.75f;
     m_screenPosition = screenPosition;
     this.OnEnterCallback = OnEnterClick;
 }
            public MyBarthsMoonSubmissionTalkWithThomasBarth(MyTextsWrapperEnum Name, MyMissionID ID, MyTextsWrapperEnum Description, MyMission ParentMission, MyMissionID[] RequiredMissions, MyDialogueEnum? dialogue, bool restartPatrol = true, MyDialogueEnum? startDialogue = null, string pathName = "interior2")
                : base(Name, ID, Description, null, ParentMission, RequiredMissions, null, null, dialogue) 
            {                
                m_botToTalkId = (uint)EntityID.ThomasBartId;

                m_botDetectorId = (uint)EntityID.ThomasBartDetectorId;
                m_distanceToTalk = 100;
                m_restartPatrol = restartPatrol;
                m_pathName = pathName;
                MissionEntityIDs.Add(m_botToTalkId);
            }
Пример #24
0
        public MyMeetObjective(MyTextsWrapperEnum Name, MyMissionID ID, MyTextsWrapperEnum Description, MyMission ParentMission, MyMissionID[] RequiredMissions, uint? detectorId, uint? botId, float distanceToTalk = 50, float slowdown = 0.25f, MyDialogueEnum? successDialogueId = null, MyDialogueEnum? startDialogueId = null, bool stopFollow = true)
            : base(Name, ID, Description, null, ParentMission, RequiredMissions, null, null, successDialogueId, startDialogueId)
        {
            m_botToTalkId = botId;
            m_botDetectorId = detectorId;
            m_distanceToTalk = distanceToTalk;
            m_slowdown = slowdown;
            //m_detectorDialog = detectorDialogId;

            m_stopFollow = stopFollow;
            FollowMe = true;
        }
        public MyGuiScreenEnterFriendSectorMap(MyMwcStartSessionRequestTypeEnum startSessionType, MyTextsWrapperEnum startSessionProgressText, MyGuiScreenBase closeAfterSuccesfullEnter)
            : base(new Vector2(0.5f, 0.5f), MyGuiConstants.SCREEN_BACKGROUND_COLOR, new Vector2(700f / 1600f, 700 / 1200f))
        {
            m_startSessionType = startSessionType;
            m_startSessionProgressText = startSessionProgressText;
            m_enableBackgroundFade = true;
            m_sectorIdentifiers = null;
            m_closeAfterSuccessfulEnter = closeAfterSuccesfullEnter;
            m_backgroundTexture = MyTextureManager.GetTexture<MyTexture2D>("Textures\\GUI\\BackgroundScreen\\ConfigWheelBackground", flags: TextureFlags.IgnoreQuality);
            RecreateControls();

        }
Пример #26
0
        private void Notify(MyTextsWrapperEnum text, object arg0 = null, object arg1 = null, object arg2 = null, object arg3 = null)
        {
            var handler = OnNotification;
            if (handler != null)
            {
                m_textArgs[0] = arg0;
                m_textArgs[1] = arg1;
                m_textArgs[2] = arg2;
                m_textArgs[3] = arg3;

                handler(text, m_textArgs);
            }
        }
Пример #27
0
 public MySabotageSubmission(
     StringBuilder name, 
     MyMissionID id, 
     StringBuilder description, 
     MyTexture2D icon, 
     MyMission parentMission, 
     MyMissionID[] requiredMissions, 
     MyMissionLocation location, 
     MyTextsWrapperEnum notificationText)
     : base(name, id, description, icon, parentMission, requiredMissions, location, null)
 {
     m_notificationText = notificationText;
 }
Пример #28
0
        public MyGlobalEvent(MyGlobalEventEnum Type, MyTextsWrapperEnum Name, MyTextsWrapperEnum Description, float RatePerHour, MyTexture2D Icon, EventHandler Action, bool WriteToEventLog, bool Enabled)
        {
            this.Type = Type;

            this.Name = Name;
            this.Description = Description;

            this.RatePerHour = RatePerHour; //occurences per hour
            this.ActivationDateTime = null;
            this.Icon = Icon;
            this.Action = Action;
            this.WriteToEventLog = WriteToEventLog;
            this.Enabled = Enabled;
        }
        public MyGuiScreenSimpleProgress(MyTextsWrapperEnum caption, StringBuilder text) 
            : base(new Vector2(0.5f, 0.5f), MyGuiConstants.SCREEN_BACKGROUND_COLOR, new Vector2(0.4f, 0.4f))
        {
            m_text = text;
            m_closeOnEsc = false;
            m_isTopMostScreen = true;

            AddCaption(caption, new Vector2(0f, 0.021f));

            m_progressWheel = new MyGuiControlRotatingWheel(this, Vector2.Zero, MyGuiConstants.DEFAULT_CONTROL_FOREGROUND_COLOR.ToVector4(), 0.5f, MyGuiDrawAlignEnum.HORISONTAL_CENTER_AND_VERTICAL_CENTER, MyGuiManager.GetLoadingTexture());
            Controls.Add(m_progressWheel);

            m_progressText = new MyGuiControlLabel(this, new Vector2(0f, 0.12f), null, m_text, MyGuiConstants.LABEL_TEXT_COLOR, MyGuiConstants.LABEL_TEXT_SCALE, MyGuiDrawAlignEnum.HORISONTAL_CENTER_AND_VERTICAL_CENTER);
            Controls.Add(m_progressText);
        }
        public MyGuiScreenProgressBase(MyTextsWrapperEnum progressText, bool enableCancel) :
            base(new Vector2(0.5f, 0.5f), MyGuiConstants.SCREEN_BACKGROUND_COLOR, null)
        {
            m_progressText = progressText;
            m_enableCancel = enableCancel;

            m_enableBackgroundFade = true;
            DrawMouseCursor = enableCancel;
            m_closeOnEsc = enableCancel;
           
            m_drawEvenWithoutFocus = true;
            
            // There is no reason for hiding progress screens!
            m_screenCanHide = false;
        }