Ejemplo n.º 1
0
        public MyGuiScreenGameScore()
            : base(Vector2.Zero, null, null)
        {
            m_closeOnEsc = true;
            m_enableBackgroundFade = true;

            m_sbLongPool = new List<StringBuilder>();
            m_sbShortPool = new List<StringBuilder>();
            NullPoolIndexes();

            m_statsListbox = new MyGuiControlListbox(this, new Vector2(0.5f, 0.5f), new Vector2(0.35f, 0.04f), new Vector4(0,0,0,0.5f), null, 0.65f, 4, 20, 4, true, false, false, null, null,
                MyGuiManager.GetScrollbarSlider(), MyGuiManager.GetHorizontalScrollbarSlider(), 0, 0, Color.Transparent.ToVector4(), 0f, 0f, 0f, 0f, 0, 0, -0.01f, -0.01f, -0.02f, 0.02f);
            m_statsListbox.DisplayHighlight = false;
            m_statsListbox.HideToolTip();
            m_statsListbox.SetCustomCollumnsWidths(new List<float>()
            {
                0, 0.1f, 0.1f, 0.1f
            });
            m_statsListbox.ShowScrollBarOnlyWhenNeeded = true;
            Controls.Add(m_statsListbox);

            GetStats();

            MyGuiScreenGamePlay.Static.DrawHud = false;
        }
Ejemplo n.º 2
0
        public MyGuiScreenJoinGame(MyGuiScreenBase closeAfterSuccessfulEnter, MyGameTypes gameTypeFilter)
            : base(new Vector2(0.5f, 0.5f), MyGuiConstants.SCREEN_BACKGROUND_COLOR, new Vector2(0.95f, 0.8f))
        {
            m_size = new Vector2(0.95f, 0.85f);
            m_serverDisconnectedHandler = new ConnectionHandler(Static_ServerDisconnected);

            m_gameTypeFilter = gameTypeFilter;
            m_backgroundTexture = MyTextureManager.GetTexture<MyTexture2D>("Textures\\GUI\\BackgroundScreen\\VideoBackground", flags: TextureFlags.IgnoreQuality);

            m_closeAfterSuccessfulEnter = closeAfterSuccessfulEnter;
            m_enableBackgroundFade = true;
            m_games = new List<MyGameExtendedInfo>();
            AddCaption(MyTextsWrapperEnum.JoinGame, new Vector2(0, 0.0075f));

            Vector2 menuPositionOrigin = new Vector2(-0.31f, -m_size.Value.Y / 2.0f + 0.15f);
            Vector2 buttonDelta = new Vector2(0.22f, 0);
            const MyGuiControlButtonTextAlignment menuButtonTextAlignement = MyGuiControlButtonTextAlignment.CENTERED;

            Controls.Add(new MyGuiControlLabel(this, menuPositionOrigin, null, MyTextsWrapperEnum.SearchGameToJoin, MyGuiConstants.BUTTON_TEXT_COLOR, MyGuiConstants.BUTTON_TEXT_SCALE, MyGuiDrawAlignEnum.HORISONTAL_CENTER_AND_VERTICAL_CENTER));

            m_searchTextbox = new MyGuiControlTextbox(this, menuPositionOrigin + buttonDelta, MyGuiControlPreDefinedSize.LARGE, "", 40, MyGuiConstants.BUTTON_TEXT_COLOR, MyGuiConstants.BUTTON_TEXT_SCALE, MyGuiControlTextboxType.NORMAL);
            m_searchTextbox.TextChanged += OnSearchTextChanged;
            Controls.Add(m_searchTextbox);

            menuPositionOrigin += new Vector2(0.395f, 0);

            var refreshButton = new MyGuiControlButton(
                this,
                menuPositionOrigin + buttonDelta,
                MyGuiConstants.BACK_BUTTON_SIZE,
                MyGuiConstants.BUTTON_BACKGROUND_COLOR,
                MyTextsWrapperEnum.Refresh,
                MyGuiConstants.BUTTON_TEXT_COLOR,
                MyGuiConstants.BUTTON_TEXT_SCALE,
                OnRefreshButtonClick,
                menuButtonTextAlignement,
                true,
                MyGuiDrawAlignEnum.HORISONTAL_CENTER_AND_VERTICAL_CENTER,
                true);
            Controls.Add(refreshButton);

            menuPositionOrigin.Y += 0.052f;
            menuPositionOrigin.X = -0.33f;

            var storyLabel = new MyGuiControlLabel(this, menuPositionOrigin, null, MyTextsWrapperEnum.Story, Vector4.One, 1.0f, MyGuiDrawAlignEnum.HORISONTAL_LEFT_AND_VERTICAL_CENTER);
            Controls.Add(storyLabel);

            menuPositionOrigin.X = -0.35f;
            m_storyCheck = new MyGuiControlCheckbox(this, menuPositionOrigin, true, Vector4.One, null);
            m_storyCheck.OnCheck = CheckChanged;
            Controls.Add(m_storyCheck);

            menuPositionOrigin.X = -0.2f;
            var deathLabel = new MyGuiControlLabel(this, menuPositionOrigin, null, MyTextsWrapperEnum.Deathmatch, Vector4.One, 1.0f, MyGuiDrawAlignEnum.HORISONTAL_LEFT_AND_VERTICAL_CENTER);
            Controls.Add(deathLabel);

            menuPositionOrigin.X = -0.22f;
            m_deathCheck = new MyGuiControlCheckbox(this, menuPositionOrigin, true, Vector4.One, null);
            m_deathCheck.OnCheck = CheckChanged;
            Controls.Add(m_deathCheck);

            //var storyButton = new MyGuiControlButton(this, menuPositionOrigin, null, Vector4.One, MyTextsWrapperEnum.Story, Vector4.One, 1.0f, 

            menuPositionOrigin.Y += 0.25f;
            menuPositionOrigin.X = 0;
            m_gameList = new MyGuiControlListbox(this,
                menuPositionOrigin,
                new Vector2(0.22f, 0.04f),
                MyGuiConstants.LISTBOX_BACKGROUND_COLOR,
                MyTextsWrapper.Get(MyTextsWrapperEnum.JoinGame),
                MyGuiConstants.LABEL_TEXT_SCALE,
                HeaderCount, 10, HeaderCount,
                true, true, false,
                null, null, MyGuiManager.GetScrollbarSlider(), MyGuiManager.GetHorizontalScrollbarSlider(), 2, 1, MyGuiConstants.LISTBOX_BACKGROUND_COLOR_BLUE, 0f, 0f, 0f, 0f, 0, 0, -0.01f, -0.01f, -0.02f, 0.02f);
            m_gameList.ItemSelect += OnGamesItemSelect;
            m_gameList.DisplayHighlight = true;
            m_gameList.MultipleSelection = true;
            m_gameList.ItemDoubleClick += GameListOnItemDoubleClick;
            m_gameList.HighlightHeadline = true;
            m_gameList.EnableAllRowHighlightWhileMouseOver(true, true);
            m_gameList.SetCustomCollumnsWidths(new List<float>()
            {
                0.15f, 0.30f, 0.15f, 0.10f
            });
            Controls.Add(m_gameList);

            buttonDelta = new Vector2(0.1f, m_size.Value.Y / 2.0f - MyGuiConstants.MESSAGE_BOX_BORDER_AREA_Y - MyGuiConstants.MESSAGE_BOX_BUTTON_SIZE.Y / 2.0f - 0.06f);
            Controls.Add(new MyGuiControlButton(this, new Vector2(-buttonDelta.X, buttonDelta.Y), MyGuiConstants.MESSAGE_BOX_BUTTON_SIZE,
                MyGuiConstants.BUTTON_BACKGROUND_COLOR, MyTextsWrapperEnum.Ok, MyGuiConstants.BUTTON_TEXT_COLOR, MyGuiConstants.BUTTON_TEXT_SCALE,
                OnOkClick, MyGuiControlButtonTextAlignment.CENTERED, true, MyGuiDrawAlignEnum.HORISONTAL_CENTER_AND_VERTICAL_CENTER, true));
            Controls.Add(new MyGuiControlButton(this, new Vector2(+buttonDelta.X, buttonDelta.Y), MyGuiConstants.MESSAGE_BOX_BUTTON_SIZE,
                MyGuiConstants.BUTTON_BACKGROUND_COLOR, MyTextsWrapperEnum.Cancel, MyGuiConstants.BUTTON_TEXT_COLOR, MyGuiConstants.BUTTON_TEXT_SCALE,
                OnCancelClick, MyGuiControlButtonTextAlignment.CENTERED, true, MyGuiDrawAlignEnum.HORISONTAL_CENTER_AND_VERTICAL_CENTER, true));

            AddHeaders();
        }