示例#1
0
        public StringBuilder GetName()
        {
            switch (EventType)
            {
            case EventTypeEnum.GlobalEvent:
                var globalEvent = MyGlobalEvents.GetGlobalEventByType((MyGlobalEventEnum)EventTypeID);
                if (globalEvent != null)
                {
                    return(MyTextsWrapper.Get(globalEvent.Name));
                }
                break;

            case EventTypeEnum.MissionStarted:
            case EventTypeEnum.MissionFinished:
            case EventTypeEnum.SubmissionAvailable:
            case EventTypeEnum.SubmissionFinished:
                //case EventTypeEnum.Story:
                var mission = MyMissions.GetMissionByID((MyMissionID)EventTypeID);
                if (mission != null)
                {
                    return(mission.NameTemp);
                }
                break;
            }
            return(null);
            //return MyTextsWrapperEnum.Null;
        }
        public override void RecreateControls(bool contructor)
        {
            Controls.Clear();

            m_scale = 0.7f;

            AddCaption(new System.Text.StringBuilder("Global Events Debug"), Color.Yellow.ToVector4());


            MyGuiControlLabel label = new MyGuiControlLabel(this, new Vector2(0.01f, -m_size.Value.Y / 2.0f + 0.07f), null, new System.Text.StringBuilder("(press ALT to share focus)"), Color.Yellow.ToVector4(), MyGuiConstants.LABEL_TEXT_SCALE * 0.7f,
                                                            MyGuiDrawAlignEnum.HORISONTAL_CENTER_AND_VERTICAL_TOP);

            Controls.Add(label);


            m_currentPosition = -m_size.Value / 2.0f + new Vector2(0.12f, 0.15f);

            var globalEventEnumValues = Enum.GetValues(typeof(MyGlobalEventEnum));

            foreach (MyGlobalEventEnum globalEventEnum in globalEventEnumValues)
            {
                var globalEvent = MyGlobalEvents.GetGlobalEventByType(globalEventEnum);
                var button      = AddButton(MyTextsWrapper.Get(globalEvent.Name), OnGlobalEvent);
                button.UserData = globalEventEnum;
            }
        }
示例#3
0
        public StringBuilder GetDescription() //TODO: change this to MyTextsWrapperEnum
        {
            switch (EventType)
            {
            case EventTypeEnum.GlobalEvent:
                var globalEvent = MyGlobalEvents.GetGlobalEventByType((MyGlobalEventEnum)EventTypeID);
                return(MyTextsWrapper.Get(globalEvent.Description));

            case EventTypeEnum.MissionStarted:
            case EventTypeEnum.MissionFinished:
            case EventTypeEnum.SubmissionAvailable:
            case EventTypeEnum.SubmissionFinished:
                //case EventTypeEnum.Story:
                var mission = MyMissions.GetMissionByID((MyMissionID)EventTypeID);
                return(mission.DescriptionTemp);
            }

            return(null);
        }