|
| 1 | +using Microsoft.Xna.Framework; |
| 2 | +using System; |
| 3 | +using TomShane.Neoforce.Controls; |
| 4 | +using GlblRes = global::SessionSeven.Properties.Resources; |
| 5 | + |
| 6 | +namespace SessionSeven |
| 7 | +{ |
| 8 | + public partial class Menu |
| 9 | + { |
| 10 | + private Bevel CreditsWindow; |
| 11 | + |
| 12 | + void AddCreditsWindow(Manager gui) |
| 13 | + { |
| 14 | + CreditsWindow = new Bevel(gui); |
| 15 | + CreditsWindow.Parent = MainMenuBackground; |
| 16 | + CreditsWindow.Height = MainMenuBackground.ClientHeight; |
| 17 | + CreditsWindow.Color = Color.Black; |
| 18 | + CreditsWindow.Style = BevelStyle.None; |
| 19 | + CreditsWindow.Visible = false; |
| 20 | + CreditsWindow.Top = 0; |
| 21 | + CreditsWindow.StayOnTop = true; |
| 22 | + CreditsWindow.Width = MainMenuBackground.ClientWidth; |
| 23 | + |
| 24 | + int i = 0; |
| 25 | + |
| 26 | + foreach (var CreditsText in Cutscenes.Director.GetCreditTexts()) |
| 27 | + { |
| 28 | + var Top = 110 + i * 23 + (i > 3 ? 23 : 0); |
| 29 | + var Text = CreditsText.Split(new string[] { System.Environment.NewLine + System.Environment.NewLine }, StringSplitOptions.RemoveEmptyEntries); |
| 30 | + if (Text.Length == 2) |
| 31 | + { |
| 32 | + var Label = new Label(gui); |
| 33 | + Label.Init(); |
| 34 | + Label.Width = 250; |
| 35 | + Label.Alignment = Alignment.MiddleLeft; |
| 36 | + Label.TextColor = Color.Black; |
| 37 | + Label.Parent = CreditsWindow; |
| 38 | + Label.Text = Text[0]; |
| 39 | + Label.Top = Top; |
| 40 | + Label.Left = MainMenuBackground.ClientWidth / 2 - Label.Width / 2; |
| 41 | + |
| 42 | + Label = new Label(gui); |
| 43 | + Label.Init(); |
| 44 | + Label.Width = 250; |
| 45 | + Label.Alignment = Alignment.MiddleRight; |
| 46 | + Label.TextColor = new Color(188, 22, 0, 255); |
| 47 | + Label.Parent = CreditsWindow; |
| 48 | + Label.Text = Text[1]; |
| 49 | + Label.Top = Top; |
| 50 | + Label.Left = MainMenuBackground.ClientWidth / 2 - Label.Width / 2; |
| 51 | + } |
| 52 | + else |
| 53 | + { |
| 54 | + var Label = new Label(gui); |
| 55 | + Label.Init(); |
| 56 | + Label.Width = 300; |
| 57 | + Label.Alignment = Alignment.MiddleCenter; |
| 58 | + Label.TextColor = Color.Black; |
| 59 | + Label.Parent = CreditsWindow; |
| 60 | + Label.Text = Text[0]; |
| 61 | + Label.Top = Top; |
| 62 | + Label.Left = MainMenuBackground.ClientWidth / 2 - Label.Width / 2; |
| 63 | + } |
| 64 | + i++; |
| 65 | + } |
| 66 | + |
| 67 | + var OKButton = new MenuButton(gui, ClickSound, FocusSound); |
| 68 | + OKButton.Init(); |
| 69 | + OKButton.Parent = CreditsWindow; |
| 70 | + OKButton.Text = GlblRes.OK; |
| 71 | + OKButton.Click += (s, e) => |
| 72 | + { |
| 73 | + CreditsWindow.Hide(); |
| 74 | + ShowLogo(true); |
| 75 | + }; |
| 76 | + |
| 77 | + OKButton.Width = 120; |
| 78 | + OKButton.Height = 24; |
| 79 | + OKButton.Left = (MainMenuBackground.ClientWidth) - (OKButton.Width) - 6; |
| 80 | + OKButton.Top = MainMenuBackground.ClientHeight - OKButton.Height - 6 - (30 * 0); |
| 81 | + OKButton.Anchor = Anchors.Top; |
| 82 | + |
| 83 | + gui.Add(CreditsWindow); |
| 84 | + } |
| 85 | + } |
| 86 | +} |
0 commit comments