示例#1
0
        private void DrawWarning(SpriteBatch batch, SpriteFont font, GlyphTextRenderer tr, float alpha, string locString)
        {
            float scale = this.FontManager.SmallFactor * SettingsManager.GetViewScale(batch.GraphicsDevice);
            float num   = (float)batch.GraphicsDevice.Viewport.Height / 2f;

            tr.DrawCenteredString(batch, font, StaticText.GetString(locString), new Color(1f, 1f, 1f, alpha), new Vector2(0.0f, num * 1.5f), scale);
        }
示例#2
0
        public override void PostDraw(SpriteBatch batch, SpriteFont font, GlyphTextRenderer tr, float alpha)
        {
            if (this.leaderboard == null)
            {
                this.InitLeaderboards();
            }
            float viewScale = SettingsManager.GetViewScale(batch.GraphicsDevice);

            if (!this.leaderboard.InError)
            {
                tr.DrawString(batch, font, string.Format(StaticText.GetString("LeaderboardEntriesCount").ToUpper(CultureInfo.InvariantCulture), (object)this.leaderboard.TotalEntries), new Vector2(125f, 620f) * viewScale, new Color(1f, 1f, 1f, alpha), (Culture.IsCJK ? 0.2f : 1.5f) * viewScale);
            }
            float num1 = this.leaderboard.InError || this.leaderboard.Reading ? 0.0f : (this.leaderboard.CanPageUp ? 1f : 0.1f);
            float num2 = this.leaderboard.InError || this.leaderboard.Reading ? 0.0f : (this.leaderboard.CanPageDown ? 1f : 0.1f);
            float num3 = Culture.IsCJK ? -15f : 0.0f;

            if (this.Items.Count > 1)
            {
                int num4 = ServiceHelper.Game.GraphicsDevice.Viewport.Width / 2 - (int)viewScale * 20;
                int y    = ServiceHelper.Game.GraphicsDevice.Viewport.Height / 2;
                this.leftArrowRect  = new Rectangle?(new Rectangle((int)((double)num4 - (double)num4 * 5.0 / 7.0 + (double)num3 - (double)viewScale * 10.0), y, (int)(40.0 * (double)viewScale), (int)(25.0 * (double)viewScale)));
                this.rightArrowRect = new Rectangle?(new Rectangle((int)((double)num4 + (double)num4 * 5.0 / 7.0 + (double)num3), y, (int)(40.0 * (double)viewScale), (int)(25.0 * (double)viewScale)));
                tr.DrawString(batch, font, "{LA}", new Vector2((float)this.leftArrowRect.Value.Left + 15f * viewScale, (float)this.leftArrowRect.Value.Top), new Color(1f, 1f, 1f, num1 * alpha), (Culture.IsCJK ? 0.2f : 1f) * viewScale);
                tr.DrawString(batch, font, "{RA}", new Vector2((float)this.rightArrowRect.Value.Left + 15f * viewScale, (float)this.rightArrowRect.Value.Top), new Color(1f, 1f, 1f, num2 * alpha), (Culture.IsCJK ? 0.2f : 1f) * viewScale);
            }
            else
            {
                LeaderboardsMenuLevel leaderboardsMenuLevel1 = this;
                LeaderboardsMenuLevel leaderboardsMenuLevel2 = this;
                LeaderboardsMenuLevel leaderboardsMenuLevel3 = this;
                Rectangle?            nullable1 = new Rectangle?();
                Rectangle?            nullable2 = nullable1;
                leaderboardsMenuLevel3.rightArrowRect = nullable2;
                Rectangle?nullable3;
                Rectangle?nullable4 = nullable3 = nullable1;
                leaderboardsMenuLevel2.rightArrowRect = nullable3;
                Rectangle?nullable5 = nullable4;
                leaderboardsMenuLevel1.leftArrowRect = nullable5;
            }
            if (!this.leaderboard.CanPageUp)
            {
                this.leftArrowRect = new Rectangle?();
            }
            if (!this.leaderboard.CanPageDown)
            {
                this.rightArrowRect = new Rectangle?();
            }
            if (!this.leaderboard.ChangingPage)
            {
                return;
            }
            tr.DrawCenteredString(batch, font, StaticText.GetString("LoadingLeaderboard"), new Color(1f, 1f, 1f, alpha), new Vector2(0.0f, 205f) * viewScale, (Culture.IsCJK ? 2f : 1f) * viewScale);
        }
示例#3
0
        public override void PostDraw(SpriteBatch batch, SpriteFont font, GlyphTextRenderer tr, float alpha)
        {
            float   smallFactor = this.FontManager.SmallFactor;
            float   num1        = (float)batch.GraphicsDevice.Viewport.Height / 2f;
            Vector2 position    = FezMath.Round(new Vector2((float)(batch.GraphicsDevice.Viewport.Width - this.ControlsImage.Width) / 2f, num1 - (float)this.ControlsImage.Height / 2f));
            float   viewScale   = SettingsManager.GetViewScale(batch.GraphicsDevice);
            int     num2        = batch.GraphicsDevice.Viewport.Width / 2;
            int     num3        = batch.GraphicsDevice.Viewport.Height / 2;
            int     num4        = num2 - 464;
            int     num5        = num2 + 464;

            if (this.SelectedIndex == this.Items.Count - 3)
            {
                batch.Draw(this.ControlsImage, position, new Color(1f, 1f, 1f, alpha));
                if (Culture.IsCJK)
                {
                    smallFactor /= viewScale;
                }
                tr.DrawShadowedText(batch, font, StaticText.GetString("Map_Title").ToUpper(CultureInfo.InvariantCulture), new Vector2((float)num4, num1 - 222f), new Color(1f, 1f, 1f, alpha), smallFactor);
                tr.DrawShadowedText(batch, font, StaticText.GetString("ControlsRotateLeft").ToUpper(CultureInfo.InvariantCulture), new Vector2((float)num4, num1 - 170f), new Color(1f, 1f, 1f, alpha), smallFactor);
                tr.DrawShadowedText(batch, font, StaticText.GetString("ControlsMove").ToUpper(CultureInfo.InvariantCulture), new Vector2((float)num4, num1 - 15f), new Color(1f, 1f, 1f, alpha), smallFactor);
                this.DrawLeftAligned(tr, batch, font, StaticText.GetString("ControlsPause").ToUpper(CultureInfo.InvariantCulture), alpha, new Vector2((float)num5, num1 - 222f), smallFactor);
                this.DrawLeftAligned(tr, batch, font, StaticText.GetString("ControlsRotateRight").ToUpper(CultureInfo.InvariantCulture), alpha, new Vector2((float)num5, num1 - 170f), smallFactor);
                this.DrawLeftAligned(tr, batch, font, StaticText.GetString("ControlsAction").ToUpper(CultureInfo.InvariantCulture), alpha, new Vector2((float)num5, num1 - 114f), smallFactor);
                this.DrawLeftAligned(tr, batch, font, StaticText.GetString("ControlsInventory").ToUpper(CultureInfo.InvariantCulture), alpha, new Vector2((float)num5, num1 - 81f), smallFactor);
                this.DrawLeftAligned(tr, batch, font, StaticText.GetString("ControlsTalk").ToUpper(CultureInfo.InvariantCulture), alpha, new Vector2((float)num5, num1 - 40f), smallFactor);
                this.DrawLeftAligned(tr, batch, font, StaticText.GetString("ControlsJump").ToUpper(CultureInfo.InvariantCulture), alpha, new Vector2((float)num5, num1 + 3f), smallFactor);
                this.DrawLeftAligned(tr, batch, font, StaticText.GetString("ControlsLook").ToUpper(CultureInfo.InvariantCulture), alpha, new Vector2((float)num5, num1 + 72f), smallFactor);
                if (Culture.IsCJK)
                {
                    float num6 = smallFactor * viewScale;
                }
            }
            float num7 = this.Items[this.chosen].Size.X + 70f;

            if (Culture.IsCJK)
            {
                num7 *= 0.5f;
            }
            if (this.SelectedIndex >= this.Items.Count - 3)
            {
                float num6 = 25f;
                float num8;
                if (!Culture.IsCJK)
                {
                    num8 = num6 * viewScale;
                }
                else
                {
                    num7 = num7 * 0.4f + 25f;
                    num8 = 5f * viewScale;
                    if (Culture.Language == Language.Chinese)
                    {
                        num8 = (float)(10.0 + 25.0 * (double)viewScale);
                    }
                }
                int     num9   = ServiceHelper.Game.GraphicsDevice.Viewport.Width / 2;
                Vector2 offset = new Vector2((float)(-(double)num7 + 25.0 * (double)viewScale - 40.0 * ((double)viewScale - 1.0)), (float)num3 + 180f * viewScale + num8);
                if (!this.noArrows)
                {
                    tr.DrawCenteredString(batch, this.FontManager.Big, "{LA}", new Color(1f, 1f, 1f, alpha), offset, (Culture.IsCJK ? 0.2f : 1f) * viewScale);
                    this.leftSliderRect = new Rectangle?(new Rectangle((int)((double)offset.X + (double)num9 - 25.0 * (double)viewScale), (int)offset.Y, (int)(40.0 * (double)viewScale), (int)(25.0 * (double)viewScale)));
                }
                else
                {
                    this.leftSliderRect = new Rectangle?();
                }
                offset = new Vector2(num7 + (float)(40.0 * ((double)viewScale - 1.0)), (float)num3 + 180f * viewScale + num8);
                if (!this.noArrows)
                {
                    tr.DrawCenteredString(batch, this.FontManager.Big, "{RA}", new Color(1f, 1f, 1f, alpha), offset, (Culture.IsCJK ? 0.2f : 1f) * viewScale);
                    this.rightSliderRect = new Rectangle?(new Rectangle((int)((double)offset.X + (double)num9 - 30.0 * (double)viewScale), (int)offset.Y, (int)(40.0 * (double)viewScale), (int)(25.0 * (double)viewScale)));
                }
                else
                {
                    this.rightSliderRect = new Rectangle?();
                }
            }
            else
            {
                ControlsMenuLevel controlsMenuLevel1 = this;
                ControlsMenuLevel controlsMenuLevel2 = this;
                ControlsMenuLevel controlsMenuLevel3 = this;
                Rectangle?        nullable1          = new Rectangle?();
                Rectangle?        nullable2          = nullable1;
                controlsMenuLevel3.rightSliderRect = nullable2;
                Rectangle?nullable3;
                Rectangle?nullable4 = nullable3 = nullable1;
                controlsMenuLevel2.rightSliderRect = nullable3;
                Rectangle?nullable5 = nullable4;
                controlsMenuLevel1.leftSliderRect = nullable5;
            }
        }