Example #1
0
 public void creditsBackClicked()
 {
     BackCreditsButton.SetActive(false);
     CreditsText.SetActive(false);
     StartButton.SetActive(true);
     CreditsButton.SetActive(true);
     ExitButton.SetActive(true);
     HelpButton.SetActive(true);
 }
Example #2
0
        void AddCreditsWindow(Manager gui)
        {
            CreditsWindow           = new Bevel(gui);
            CreditsWindow.Parent    = MainMenuBackground;
            CreditsWindow.Height    = MainMenuBackground.ClientHeight;
            CreditsWindow.Color     = Color.Black;
            CreditsWindow.Style     = BevelStyle.None;
            CreditsWindow.Visible   = false;
            CreditsWindow.Top       = 0;
            CreditsWindow.StayOnTop = true;
            CreditsWindow.Width     = MainMenuBackground.ClientWidth;

            var i    = 0;
            var NLNL = new string[] { Environment.NewLine + Environment.NewLine };

            foreach (var CreditsText in Cutscenes.Director.GetCreditTexts(false))
            {
                var Top  = 110 + i * 23 + (i > 4 ? 23 : 0);
                var Text = CreditsText.Split(NLNL, StringSplitOptions.RemoveEmptyEntries);
                if (Text.Length == 2)
                {
                    var Label = new Label(gui);
                    Label.Init();
                    Label.Width     = 300;
                    Label.Height    = 100;
                    Label.Alignment = Alignment.TopLeft;
                    Label.TextColor = Color.Black;
                    Label.Parent    = CreditsWindow;
                    Label.Text      = Text[0];
                    Label.Top       = Top;
                    Label.Left      = MainMenuBackground.ClientWidth / 2 - Label.Width / 2;

                    Label = new Label(gui);
                    Label.Init();
                    Label.Width     = 300;
                    Label.Height    = 100;
                    Label.Alignment = Alignment.TopRight;
                    Label.TextColor = new Color(188, 22, 0, 255);
                    Label.Parent    = CreditsWindow;
                    Label.Text      = Text[1];
                    Label.Top       = Top;
                    Label.Left      = MainMenuBackground.ClientWidth / 2 - Label.Width / 2;
                }
                else
                {
                    var Label = new Label(gui);
                    Label.Init();
                    Label.Width     = 300;
                    Label.Height    = 100;
                    Label.Alignment = Alignment.TopCenter;
                    Label.TextColor = Color.Black;
                    Label.Parent    = CreditsWindow;
                    Label.Text      = Text[0];
                    Label.Top       = Top;
                    Label.Left      = MainMenuBackground.ClientWidth / 2 - Label.Width / 2;
                }
                i++;
            }

            var OKButton = new MenuButton(gui, ClickSound, FocusSound, GameSettings);

            OKButton.Init();
            OKButton.Parent = CreditsWindow;
            OKButton.Text   = GlblRes.OK;
            OKButton.Click += (s, e) =>
            {
                CreditsWindow.Hide();
                ShowLogo(true);
            };

            OKButton.Width  = 120;
            OKButton.Height = 24;
            OKButton.Left   = (MainMenuBackground.ClientWidth) - (OKButton.Width) - 6;
            OKButton.Top    = MainMenuBackground.ClientHeight - OKButton.Height - 6 - (30 * 0);
            OKButton.Anchor = Anchors.Top;

            gui.Add(CreditsWindow);
        }
Example #3
0
 public void OnDestroy()
 {
     instance = null;
 }
Example #4
0
 private void OnEnable()
 {
     instance = this;
     InitData();
 }
Example #5
0
 public override void Initialize()
 {
     base.Initialize();
     this.GraphicsDevice              = ServiceHelper.Get <IGraphicsDeviceService>().GraphicsDevice;
     this.GraphicsDevice.DeviceReset += new EventHandler <EventArgs>(this.LoadCredits);
     this.SpriteBatch = new SpriteBatch(this.GraphicsDevice);
     this.gtr         = new GlyphTextRenderer(ServiceHelper.Game);
     this.OnClose     = (Action)(() =>
     {
         if (this.started)
         {
             ServiceHelper.Get <ISoundManager>().PlayNewSong((string)null, 0.5f);
             ServiceHelper.Get <ISoundManager>().UnshelfSong();
             ServiceHelper.Get <ISoundManager>().MusicVolumeFactor = this.wasFactor;
         }
         if (this.maskRT != null)
         {
             this.maskRT.Dispose();
             this.maskRT = (RenderTarget2D)null;
         }
         this.started = false;
     });
     this.scroller = new List <CreditsEntry>()
     {
         new CreditsEntry()
         {
             Size = new Vector2(512f, 512f)
         },
         new CreditsEntry()
         {
             Text    = CreditsText.GetString("PolytronProduction"),
             IsTitle = true
         },
         new CreditsEntry()
         {
             Text       = CreditsText.GetString("Design"),
             IsSubtitle = true
         },
         new CreditsEntry()
         {
             Text = CreditsText.GetString("ArtLevelDesignCredits")
         },
         new CreditsEntry()
         {
             Text       = CreditsText.GetString("Programming"),
             IsSubtitle = true
         },
         new CreditsEntry()
         {
             Text = CreditsText.GetString("ProgrammingCredits")
         },
         new CreditsEntry()
         {
             Text       = CreditsText.GetString("Producer"),
             IsSubtitle = true
         },
         new CreditsEntry()
         {
             Text = CreditsText.GetString("ProducerCredits")
         },
         new CreditsEntry()
         {
             Text       = CreditsText.GetString("Music"),
             IsSubtitle = true
         },
         new CreditsEntry()
         {
             Text = CreditsText.GetString("MusicCredits")
         },
         new CreditsEntry()
         {
             Text       = CreditsText.GetString("SoundEffects"),
             IsSubtitle = true
         },
         new CreditsEntry()
         {
             Text = CreditsText.GetString("SoundEffectsCredits")
         },
         new CreditsEntry()
         {
             Text       = CreditsText.GetString("Animation"),
             IsSubtitle = true
         },
         new CreditsEntry()
         {
             Text = CreditsText.GetString("AnimationCredits")
         },
         new CreditsEntry()
         {
             Text       = CreditsText.GetString("PcQaTeam"),
             IsSubtitle = true
         },
         new CreditsEntry()
         {
             Text = CreditsText.GetString("PcQaTeamCredits")
         },
         new CreditsEntry()
         {
             Text       = CreditsText.GetString("SupportedBy"),
             IsSubtitle = true
         },
         new CreditsEntry()
         {
             Text = CreditsText.GetString("SupportedByCredits")
         },
         new CreditsEntry()
         {
             Text       = CreditsText.GetString("PhilSpecialThanks"),
             IsSubtitle = true
         },
         new CreditsEntry()
         {
             Text = CreditsText.GetString("PhilSpecialThanksCredits")
         },
         new CreditsEntry()
         {
             Text       = CreditsText.GetString("RenoSpecialThanks"),
             IsSubtitle = true
         },
         new CreditsEntry()
         {
             Text = CreditsText.GetString("RenoSpecialThanksCredits")
         },
         new CreditsEntry()
         {
             Text       = CreditsText.GetString("XblaSpecialThanks"),
             IsSubtitle = true
         },
         new CreditsEntry()
         {
             Text = CreditsText.GetString("XblaSpecialThanksCredits")
         },
         new CreditsEntry()
         {
             Text       = CreditsText.GetString("ThirdParty"),
             IsSubtitle = true
         },
         new CreditsEntry()
         {
             Text = CreditsText.GetString("ThirdPartyCredits")
         },
         new CreditsEntry()
         {
             Text       = CreditsText.GetString("LicenseInfo"),
             IsSubtitle = true
         },
         new CreditsEntry()
         {
             Text    = CreditsText.GetString("PolytronFooter"),
             IsTitle = true
         }
     };
     this.LoadCredits();
     foreach (CreditsEntry creditsEntry in this.scroller)
     {
         if (creditsEntry.Text != null)
         {
             creditsEntry.Text = creditsEntry.Text.ToUpper(CultureInfo.InvariantCulture);
             creditsEntry.Size = !creditsEntry.IsTitle ? this.FontManager.Small.MeasureString(creditsEntry.Text) * this.FontManager.SmallFactor : this.FontManager.Big.MeasureString(creditsEntry.Text) * this.FontManager.BigFactor;
         }
     }
 }
Example #6
0
    public void Initialize(float lineY, string text, CreditsText ctext)
    {
        this.lineY = lineY;
        this.text  = text;
        this.ctext = ctext;
        base.gameObject.SetActive(value: false);
        isSpawned = false;
        Bounds  bounds = default(Bounds);
        float   num    = 1f;
        Vector3 a      = new Vector3(1f, 0f, 0f);
        Vector3 a2     = new Vector3(0f, 0f, -1f);
        Vector3 zero   = Vector3.zero;

        for (int i = 0; i < text.Length; i++)
        {
            char c = text[i];
            if (c == '[' && text[i + 1] == 'H' && text[i + 3] == ']')
            {
                switch (text[i + 2])
                {
                case '1':
                    num = 2f;
                    break;

                case '2':
                    num = 1.5f;
                    break;

                case '3':
                    num = 0.7f;
                    break;

                case '4':
                    num = 0.5f;
                    break;
                }
                zero += a2 * lineHeight * (num - 1f);
                i    += 3;
                continue;
            }
            switch (c)
            {
            case ' ':
                zero += a * space * num;
                break;

            case '\n':
                zero.x = 0f;
                zero  += a2 * lineHeight;
                num    = 1f;
                break;

            default:
            {
                Character character = default(Character);
                character.c        = c;
                character.spawnPos = zero;
                character.size     = num;
                Character item = character;
                zero += a * (ctext.GetLetterWidth(c) + 0.1f) * num;
                characters.Add(item);
                letters.Add(null);
                break;
            }

            case '\r':
                break;
            }
            bounds.Encapsulate(zero);
        }
        centerOffset = -bounds.center;
        bitsRequired = CalculateMaxDeltaSizeInBits();
    }