Пример #1
0
        private void toggleFilters(object sender, EventArgs e)
        {
            pButton but = sender as pButton;

            filtersVisible = !filtersVisible;


            const int ADJUSTMENT_HEADER = FILTER_ADJUSTMENT + 12;

            if (filtersVisible)
            {
                but.SetColour(Color.Red);
                but.Text.Text = LocalisationManager.GetString(OsuString.Lobby_Hide);

                but.SpriteCollection.ForEach(s => s.MoveToRelative(new Vector2(0, FILTER_ADJUSTMENT), 200, EasingTypes.Out));

                //headerText2.MoveToRelative(new Vector2(0, ADJUSTMENT_HEADER), 200, EasingTypes.In);
            }
            else
            {
                but.SetColour(Color.YellowGreen);
                but.Text.Text = LocalisationManager.GetString(OsuString.Lobby_Filters);

                but.SpriteCollection.ForEach(s => s.MoveToRelative(new Vector2(0, -FILTER_ADJUSTMENT), 200, EasingTypes.Out));


                //headerText2.MoveToRelative(new Vector2(0, -ADJUSTMENT_HEADER), 200, EasingTypes.In);
            }
        }
Пример #2
0
        internal SpriteImportDialog()
            : base("Sprite Library", true)
        {
            spriteList = new pScrollableArea(new Rectangle(0, 50, 640, 360), new Vector2(640, 480), false, 0, defaultTargetType);

            if (BeatmapManager.Current.InOszContainer)
            {
                BeatmapManager.Current.Osz2ExtractSafe();
                Folder = BeatmapManager.Current.ExtractionFolder;
            }
            else
            {
                Folder = BeatmapManager.Current.ContainingFolderAbsolute;
            }

            files = new List <string>();

            pButton pb = new pButton("Cancel", new Vector2(40, 440), new Vector2(240, 30), 1, Color.Gray, delegate { Close(); });

            spriteManager.Add(pb.SpriteCollection);

            pb = new pButton("Browse...", new Vector2(360, 440), new Vector2(240, 30), 1, Color.Orange, delegate { BrowseForFile(); });
            spriteManager.Add(pb.SpriteCollection);

            string[] pngFiles = Directory.GetFiles(Folder, "*.png",
                                                   SearchOption.AllDirectories);
            files.AddRange(pngFiles);
            string[] jpgFiles = Directory.GetFiles(Folder, "*.jpg",
                                                   SearchOption.AllDirectories);
            files.AddRange(jpgFiles);
        }
Пример #3
0
        /// <summary>
        /// This is the method that actually does the work.
        /// </summary>
        /// <param name="DA">The DA object is used to retrieve from inputs and store in outputs.</param>
        protected override void SolveInstance(IGH_DataAccess DA)
        {
            string ID   = this.Attributes.InstanceGuid.ToString();
            string name = new GUIDtoAlpha(Convert.ToString(ID + Convert.ToString(this.RunCount)), false).Text;
            int    C    = this.RunCount;

            wObject  WindObject = new wObject();
            pElement Element    = new pElement();
            bool     Active     = Elements.ContainsKey(C);

            var pCtrl = new pButton(name);

            if (Elements.ContainsKey(C))
            {
                Active = true;
            }

            //Check if control already exists
            if (Active)
            {
                if (Elements[C] != null)
                {
                    WindObject = Elements[C];
                    Element    = (pElement)WindObject.Element;
                    pCtrl      = (pButton)Element.ParrotControl;
                }
            }
            else
            {
                Elements.Add(C, WindObject);
            }

            //Set Unique Control Properties
            string Text = "OK";

            if (!DA.GetData(0, ref Text))
            {
                return;
            }

            pCtrl.SetProperties(Text);

            pCtrl.ResetGraphics();

            //Set Parrot Element and Wind Object properties
            if (!Active)
            {
                Element = new pElement(pCtrl.Element, pCtrl, pCtrl.Type, 1);
            }

            Element.Control     = pCtrl;
            WindObject          = new wObject(Element, "Parrot", Element.Type);
            WindObject.GUID     = this.InstanceGuid;
            WindObject.Instance = C;

            Elements[this.RunCount] = WindObject;

            DA.SetData(0, WindObject);
        }
Пример #4
0
        public OptionButton(string title, Color colour, EventHandler onClick = null)
        {
            Size   = new Vector2(ELEMENT_SIZE, 20);
            Button = new pButton(title, new Vector2(0, 0), Size, 1, colour, onClick, false, false, 12);
            spriteManager.Add(Button.SpriteCollection);

            addKeyword(title);
        }
Пример #5
0
        public override void Initialize()
        {
            SpriteManager = new SpriteManager(true);

            SpriteManager.Add(
                new pSprite(TextureManager.Load(@"editor-metronome-bg", SkinSource.Osu), Fields.TopRight,
                            Origins.TopLeft,
                            Clocks.Game, Position, 0, true, Color.White));

            float posX = Position.X - 179,
                  posY = Position.Y + 18;

            beatSquares = new[]
            {
                new pBeatSquare(new Vector2(posX + Padding * 3, posY)),     //Includes padding between each square
                new pBeatSquare(new Vector2(posX + Padding * 2, posY)),
                new pBeatSquare(new Vector2(posX + Padding, posY)),
                new pBeatSquare(new Vector2(posX, posY))
            };

            SpriteManager.Add(beatSquares);

            posX = Position.X - 60;
            posY = Position.Y + Padding;

            pButton tapButton = new pButton(LocalisationManager.GetString(OsuString.EditorModeTiming_TapHere), new Vector2(posX, posY), new Vector2(136, 25), 1, Color.SkyBlue, tapButton_OnClick, true, true, 12);

            tapButton.SoundsEnabled = false;
            tapButton.ToolTip       = LocalisationManager.GetString(OsuString.EditorModeTiming_TapHereTooltip);
            SpriteManager.Add(tapButton.SpriteCollection);

            posX = Position.X - 3;
            posY = Position.Y + 4;

            pButton resetButton = new pButton(LocalisationManager.GetString(OsuString.General_Reset), new Vector2(posX, posY), new Vector2(58, 58), 1, Color.Orange, resetButton_OnClick, true, true, 12);

            SpriteManager.Add(resetButton.SpriteCollection);
        }
Пример #6
0
        public override void Initialize()
        {
            StreamingManager.StopSpectating(false);

            content = new ResourceContentManager(GameBase.Instance.Services, ResourcesStore.ResourceManager);

            spriteManager = new SpriteManager();

            BanchoClient.OnConnect      += BanchoClient_OnConnect;
            KeyboardHandler.OnKeyRepeat += KeyboardHandler_OnKeyRepeat;

            pText headerText =
                new pText("Multiplayer Lobby", 30, new Vector2(0, 0), 0.955F, true, new Color(255, 255, 255, 255));

            spriteManager.Add(headerText);

            pText headerText2 = new pText("Let's play together!", 16, new Vector2(4, 26), 0.955F, true,
                                          new Color(255, 255, 255, 255));

            spriteManager.Add(headerText2);

            pSprite bgf =
                new pSprite(content.Load <Texture2D>("lobby-background"), FieldTypes.Window, OriginTypes.TopLeft,
                            ClockTypes.Game, Vector2.Zero, 0, true, Color.White);

            spriteManager.Add(bgf);

            pAnimation back =
                new pAnimation(SkinManager.LoadAll("menu-back"), FieldTypes.Window,
                               OriginTypes.TopLeft,
                               ClockTypes.Game,
                               new Vector2(0, 480), 0.8F, true, new Color(255, 255, 255, (byte)(255 * 0.6)));

            back.SetFramerateFromSkin();
            back.OriginPosition = new Vector2(0, 146);
            back.OnClick       += back_OnClick;
            back.IsClickable    = true;
            back.HoverEffect    = new Transformation(TransformationType.Fade, 0.6F, 1, 0, 300);
            spriteManager.Add(back);

            pButton pbut = new pButton("New Game", new Vector2(270, 285), new Vector2(350, 30), 0.92f, new Color(99, 139, 228), OnCreateGame);

            spriteManager.Add(pbut.SpriteCollection);

            //pbut = new pButton("Join Game", new Vector2(270, 285), new Vector2(140, 30), 0.92f, new Color(99, 139, 228), OnCreateGame);
            //spriteManager.Add(pbut.SpriteCollection);

            pbut = new pButton("Back to Menu", new Vector2(10, 285), new Vector2(250, 30), 0.92f, new Color(235, 160, 62), back_OnClick);
            spriteManager.Add(pbut.SpriteCollection);

            lobbyUserList =
                new pText("", 12, new Vector2(560, 65), 1, true, Color.White);
            lobbyUserList.TextBold = true;
            spriteManager.Add(lobbyUserList);

            noMatches               = new pText("There are no matches available.\nClick 'New Game' to start a new game!", 20, new Vector2(280, 115), new Vector2(400, 0), 1, true, Color.White, false);
            noMatches.TextBold      = true;
            noMatches.CurrentColour = Color.TransparentWhite;
            noMatches.TextAlignment = Alignment.Centre;
            noMatches.OriginType    = OriginTypes.Centre;
            gameList.spriteManager.Add(noMatches);

            base.Initialize();

            JoinLobby();

            LobbyUpdatePending = true;

            GameBase.LoadComplete();

            if (!ChatEngine.IsVisible)
            {
                if (ChatEngine.IsFullVisible)
                {
                    ChatEngine.ToggleFull();
                }
                ChatEngine.Toggle();
            }
        }
Пример #7
0
        private void initializeSprites()
        {
            SkinManager.CreateUserSkin();

            GameBase.TransitionManager.ClearBackground(false);

            BeatmapTreeItem.LoadSkinElements();

            treeManager = new BeatmapTreeManager(GameBase.Instance);
            treeManager.SpriteManagerPanels.SetVisibleArea(new RectangleF(0, 0, 1280, 720) / GameBase.WindowManager.Ratio);

            treeManager.OnEndRandom += endRandom;


            pTexture backgroundTex = TextureManager.Load(Path.Combine(Tournament.Tournament.SkinDirectory, @"drawings-background.jpg"), SkinSource.Skin);

            backgroundTex = backgroundTex ?? TextureManager.Load(@"drawings-background", SkinSource.Skin);
            backgroundTex = backgroundTex ?? TextureManager.Load(@"menu-background", SkinSource.Osu);

            pSprite p;

            baseSpriteManager.Add(p = new pSprite(backgroundTex, Fields.TopLeft, Origins.TopLeft, Clocks.Game, Vector2.Zero, 0f, true, Color.White));
            p.Scale = Math.Max(1280f / GameBase.WindowManager.Ratio / p.Width, 720f / GameBase.WindowManager.Ratio / p.Height) * 1.6f;

            int x = GameBase.WindowManager.WidthScaled - 200;
            int y = 380;

            baseSpriteManager.Add((randButton = new pButton(@"Begin random", new Vector2(x, y), new Vector2(80, 15), 1f, Color.YellowGreen, delegate
            {
                if (treeManager.IsRandomActive)
                {
                    RandomMultiple = 1.3f;
                    randButton.Text.Text = @"Begin random";
                }
                else
                {
                    if (!canAddTeam)
                    {
                        return;
                    }

                    if (treeManager.beatmapSetVisibleCount == 0)
                    {
                        return;
                    }

                    startRandom();

                    if (treeManager.beatmapVisibleCount == 1)
                    {
                        endRandom();
                        return;
                    }

                    RandomMultiple = 1f;
                    treeManager.StartRandom();
                    randButton.Text.Text = @"End random";
                }
            })).SpriteCollection);

            y += 16;

            baseSpriteManager.Add(new pButton(@"Quick-add current", new Vector2(x, y), new Vector2(80, 15), 1f, Color.YellowGreen, delegate
            {
                if (treeManager.beatmapSetVisibleCount == 0)
                {
                    return;
                }

                if (treeManager.IsRandomActive)
                {
                    return;
                }
                if (!firstRandom)
                {
                    startRandom();
                }
                else
                {
                    endRandom();
                    firstRandom = false;
                    startRandom();
                }
                firstRandom = true;
            }, true, false, 10).SpriteCollection);

            y += 16;

            baseSpriteManager.Add(new pButton(@"Reload teams", new Vector2(x, y), new Vector2(80, 15), 1f, Color.YellowGreen, delegate
            {
                reload();
            }).SpriteCollection);

            y += 16;

            baseSpriteManager.Add(new pButton(@"Reset", new Vector2(x, y), new Vector2(80, 15), 1f, Color.Red, delegate
            {
                if (TopMostMessageBox.Show("Are you sure you want to reset the teams?", "Reset teams", MessageBoxButtons.OKCancel) == DialogResult.OK)
                {
                    reset();
                }
            }).SpriteCollection);

            y += 16;

            baseSpriteManager.Add(new pButton(@"Exit", new Vector2(x, y), new Vector2(80, 15), 1f, Color.Red, delegate
            {
                GameBase.BeginExit();
            }).SpriteCollection);

            for (int i = 0; i < groupCount; i++)
            {
                groups.Add(new Group(spriteManagerAbove, i));
            }
        }
Пример #8
0
        public override void Initialize()
        {
            MatchSetup.Match = null;

            StreamingManager.StopSpectating(false);

            text_noMatchFound = LocalisationManager.GetString(OsuString.Lobby_NoMatch);
            text_loading      = LocalisationManager.GetString(OsuString.General_Loading);

            spriteManager = new SpriteManager(true);

            spriteManagerFilters = new SpriteManager(true);
            //spriteManagerFilters.Alpha = 0;
            spriteManagerFilters.SetVisibleArea(new RectangleF(0, content_y - filters_height, 640, filters_height));

            BanchoClient.OnConnect      += BanchoClient_OnConnect;
            KeyboardHandler.OnKeyRepeat += KeyboardHandler_OnKeyRepeat;

            pText headerText =
                new pText(LocalisationManager.GetString(OsuString.Lobby_Header), 24, new Vector2(0, 0), 0.955F, true, new Color(255, 255, 255, 255));

            spriteManager.Add(headerText);

            headerText2 = new pText(text_loading, 12, new Vector2(170, 8), 0.955F, true,
                                    new Color(255, 255, 255, 255));
            spriteManager.Add(headerText2);


            //pSprite bgf =
            //    new pSprite(TextureManager.Load(@"lobby-background"), Fields.TopLeft, Origins.TopLeft,
            //                Clocks.Instance, Vector2.Zero, 0, true, Color.White);
            //spriteManager.Add(bgf);

            pSprite p = new pSprite(GameBase.WhitePixel, Fields.TopLeft, Origins.TopLeft, Clocks.Game, new Vector2(0, content_y - filters_height), 0.1f, true, new Color(0, 0, 0, 180));

            p.Scale       = 1.6f;
            p.VectorScale = new Vector2(GameBase.WindowManager.WidthScaled, content_height + filters_height + 30);
            spriteManager.Add(p);

            int button_height = content_y + content_height + 2;

            pButton pbut = new pButton(LocalisationManager.GetString(OsuString.Lobby_NewGame), new Vector2(GameBase.WindowManager.WidthScaled / 2 - 100, button_height), new Vector2(200, 25), 0.92f, new Color(99, 139, 228), OnCreateGame);

            spriteManager.Add(pbut.SpriteCollection);

            pbut = new pButton(LocalisationManager.GetString(OsuString.Lobby_QuickJoin), new Vector2(GameBase.WindowManager.WidthScaled / 2 + 110, button_height), new Vector2(200, 25), 0.92f, Color.YellowGreen, OnQuickJoin);
            spriteManager.Add(pbut.SpriteCollection);

            pbut = new pButton(LocalisationManager.GetString(OsuString.Lobby_BackToMenu), new Vector2(GameBase.WindowManager.WidthScaled / 2 - 310, button_height), new Vector2(200, 25), 0.92f, new Color(235, 160, 62), back_OnClick);
            spriteManager.Add(pbut.SpriteCollection);

            noMatches               = new pText(text_loading, 18, new Vector2(GameBase.WindowManager.WidthScaled / 2, 180), new Vector2(400, 0), 1, true, Color.White, false);
            noMatches.TextBold      = true;
            noMatches.Alpha         = 0;
            noMatches.TextAlignment = TextAlignment.Centre;
            noMatches.Origin        = Origins.Centre;
            spriteManager.Add(noMatches);

            sortingTabs = new pTabCollection(spriteManager, 6, new Vector2(50, 40), 0.98f, false,
                                             Color.Crimson);
            sortingTabs.Add(LocalisationManager.GetString(OsuString.Lobby_All), -1);
            sortingTabs.Add(OsuCommon.PlayModeString(PlayModes.Osu), (int)PlayModes.Osu);
            sortingTabs.Add(OsuCommon.PlayModeString(PlayModes.Taiko), (int)PlayModes.Taiko);
            sortingTabs.Add(OsuCommon.PlayModeString(PlayModes.CatchTheBeat), (int)PlayModes.CatchTheBeat);
            sortingTabs.Add(OsuCommon.PlayModeString(PlayModes.OsuMania), (int)PlayModes.OsuMania);
            sortingTabs.SetSelected(ConfigManager.sLobbyPlayMode.Value, true);
            sortingTabs.OnTabChanged += delegate { ConfigManager.sLobbyPlayMode.Value = (int)sortingTabs.SelectedTab.Tag; LobbyUpdatePending = true; };

            checkExistingMaps = new pCheckbox(LocalisationManager.GetString(OsuString.Lobby_ExistMapOnly), 0.8f, new Vector2(5, 2), 1, ConfigManager.sLobbyShowExistingOnly);
            spriteManagerFilters.Add(checkExistingMaps.SpriteCollection);

            checkExistingMaps.OnCheckChanged +=
                delegate(object sender, bool status)
            {
                ConfigManager.sLobbyShowExistingOnly.Value = status;
                LobbyUpdatePending = true;
            };

            checkFriendsOnly = new pCheckbox(LocalisationManager.GetString(OsuString.Lobby_FriendOnly), 0.8f, new Vector2(5, 19), 1, ConfigManager.sLobbyShowFriendsOnly);
            spriteManagerFilters.Add(checkFriendsOnly.SpriteCollection);

            checkFriendsOnly.OnCheckChanged +=
                delegate(object sender, bool status)
            {
                ConfigManager.sLobbyShowFriendsOnly.Value = status;
                LobbyUpdatePending = true;
            };

            checkInProgress = new pCheckbox(LocalisationManager.GetString(OsuString.Lobby_InProgress), 0.8f, new Vector2(360, 19), 1, ConfigManager.sLobbyShowInProgress);
            spriteManagerFilters.Add(checkInProgress.SpriteCollection);

            checkInProgress.OnCheckChanged +=
                delegate(object sender, bool status)
            {
                ConfigManager.sLobbyShowInProgress.Value = status;
                LobbyUpdatePending = true;
            };

            checkShowFullGames = new pCheckbox(LocalisationManager.GetString(OsuString.Lobby_ShowFull), 0.8f, new Vector2(180, 2), 1, ConfigManager.sLobbyShowFull);
            spriteManagerFilters.Add(checkShowFullGames.SpriteCollection);

            checkShowFullGames.OnCheckChanged += delegate(object sender, bool status)
            {
                ConfigManager.sLobbyShowFull.Value = status;
                LobbyUpdatePending = true;
            };

            checkShowPasswordedGames = new pCheckbox(LocalisationManager.GetString(OsuString.Lobby_ShowLocked), 0.8f, new Vector2(180, 19), 1, ConfigManager.sLobbyShowPassworded);
            spriteManagerFilters.Add(checkShowPasswordedGames.SpriteCollection);

            checkShowPasswordedGames.OnCheckChanged +=
                delegate(object sender, bool status)
            {
                ConfigManager.sLobbyShowPassworded.Value = status;
                LobbyUpdatePending = true;
            };

            pText pt = new pText(LocalisationManager.GetString(OsuString.Lobby_Search), 14, new Vector2(360, 2), 1, true, Color.White);

            spriteManagerFilters.Add(pt);

            filterTextBox             = new pTextBox(string.Empty, 14, new Vector2(360 + pt.MeasureText().X, 2), 134, 1);
            filterTextBox.LengthLimit = 20;
            filterTextBox.OnChange   += delegate
            {
                LobbyUpdatePending = true;

                if (filterTextBox.Text.Length > 0)
                {
                    checkFriendsOnly.Hide();
                    checkShowFullGames.Hide();
                    checkShowPasswordedGames.Hide();
                    checkExistingMaps.Hide();
                    sortingTabs.SetSelected(-1, true);
                }
                else
                {
                    checkFriendsOnly.Show();
                    checkShowFullGames.Show();
                    checkShowPasswordedGames.Show();
                    checkExistingMaps.Show();
                    sortingTabs.SetSelected(ConfigManager.sLobbyPlayMode.Value, true);
                }
            };
            spriteManagerFilters.Add(filterTextBox.SpriteCollection);

            //buttonFilters = new pButton(LocalisationManager.GetString(OsuString.Lobby_Filters), new Vector2(390, 32), new Vector2(100, 20), 1, Color.YellowGreen, toggleFilters);
            //spriteManager.Add(buttonFilters.SpriteCollection);

            base.Initialize();

            if (BeatmapManager.Current == null || string.IsNullOrEmpty(BeatmapManager.Current.ContainingFolder) || !BeatmapManager.Current.BeatmapPresent)
            {
                MusicControl.ChooseRandomSong(true);
            }

            JoinLobby();

            LobbyUpdatePending = true;
        }
Пример #9
0
        public override void Initialize()
        {
            s_Header          = new pSprite(TextureManager.Load(OsuTexture.options_header), new Vector2(0, 0));
            s_Header.OnClick += delegate { };
            topMostSpriteManager.Add(s_Header);

            pDrawable background =
                new pSprite(TextureManager.Load(OsuTexture.songselect_background), FieldTypes.StandardSnapCentre, OriginTypes.Centre,
                            ClockTypes.Mode, Vector2.Zero, 0, true, new Color4(56, 56, 56, 255));

            background.AlphaBlend = false;
            spriteManager.Add(background);

            s_ButtonBack = new BackButton(delegate { Director.ChangeMode(OsuMode.MainMenu); }, Director.LastOsuMode == OsuMode.MainMenu);
            smd.AddNonDraggable(s_ButtonBack);

            if (MainMenu.MainMenu.InitializeBgm())
            {
                AudioEngine.Music.Play();
            }

            const int header_x_offset = 60;

            float button_x_offset = GameBase.BaseSize.X / 2;

            int vPos = 70;

            pText text = new pText(LocalisationManager.GetString(OsuString.About), 36, new Vector2(header_x_offset, vPos), 1, true, Color4.White)
            {
                Bold = true, TextShadow = true
            };

            smd.Add(text);

            vPos += 90;

            pButton button = new pButton(LocalisationManager.GetString(OsuString.Credits), new Vector2(button_x_offset, vPos), new Vector2(280, 50), Color4.SkyBlue, delegate { Director.ChangeMode(OsuMode.Credits); });

            smd.Add(button);

            vPos += 70;

            button = new pButton(LocalisationManager.GetString(OsuString.OnlineHelp), new Vector2(button_x_offset, vPos), new Vector2(280, 50), Color4.SkyBlue, delegate { GameBase.Instance.ShowWebView("https://www.osustream.com/help/", "Online Help"); });

            smd.Add(button);

            vPos += 60;

            text = new pText(LocalisationManager.GetString(OsuString.DifficultySettings), 36, new Vector2(header_x_offset, vPos), 1, true, Color4.White)
            {
                Bold = true, TextShadow = true
            };
            smd.Add(text);

            vPos += 90;

            buttonFingerGuides = new pButton(LocalisationManager.GetString(OsuString.UseFingerGuides), new Vector2(button_x_offset, vPos), new Vector2(280, 50), Color4.SkyBlue, delegate { DisplayFingerGuideDialog(); });
            smd.Add(buttonFingerGuides);

            vPos += 70;

            buttonEasyMode = new pButton(LocalisationManager.GetString(OsuString.DefaultToEasyMode), new Vector2(button_x_offset, vPos), new Vector2(280, 50), Color4.SkyBlue, delegate { DisplayEasyModeDialog(); });
            smd.Add(buttonEasyMode);

            vPos += 60;

            text = new pText(LocalisationManager.GetString(OsuString.Audio), 36, new Vector2(header_x_offset, vPos), 1, true, Color4.White)
            {
                Bold = true, TextShadow = true
            };
            smd.Add(text);

            vPos += 80;

            soundEffectSlider = new SliderControl(LocalisationManager.GetString(OsuString.EffectVolume), AudioEngine.Effect.Volume, new Vector2(button_x_offset - 30, vPos),
                                                  delegate(float v)
            {
                AudioEngine.Effect.Volume = v;
                if (Clock.ModeTime / 200 != lastEffectSound)
                {
                    lastEffectSound = Clock.ModeTime / 200;
                    switch (lastEffectSound % 4)
                    {
                    case 0:
                        AudioEngine.PlaySample(OsuSamples.HitNormal);
                        break;

                    case 1:
                    case 3:
                        AudioEngine.PlaySample(OsuSamples.HitWhistle);
                        break;

                    case 2:
                        AudioEngine.PlaySample(OsuSamples.HitFinish);
                        break;
                    }
                }
            });
            smd.Add(soundEffectSlider);

            vPos += 60;

            soundEffectSlider = new SliderControl(LocalisationManager.GetString(OsuString.MusicVolume), AudioEngine.Music.MaxVolume, new Vector2(button_x_offset - 30, vPos),
                                                  delegate(float v) { AudioEngine.Music.MaxVolume = v; });
            smd.Add(soundEffectSlider);

            vPos += 60;

            const int offset_range = 32;

            universalOffsetSlider = new SliderControl(LocalisationManager.GetString(OsuString.UniversalOffset), (float)(Clock.USER_OFFSET + offset_range) / (offset_range * 2), new Vector2(button_x_offset - 30, vPos),
                                                      delegate(float v)
            {
                GameBase.Config.SetValue("offset", (Clock.USER_OFFSET = (int)((v - 0.5f) * offset_range * 2)));
                if (universalOffsetSlider != null)     //will be null on first run.
                {
                    universalOffsetSlider.Text.Text = Clock.USER_OFFSET + "ms";
                }
            });
            smd.Add(universalOffsetSlider);

            vPos += 40;

            text = new pText(LocalisationManager.GetString(OsuString.UniversalOffsetDetails), 24, new Vector2(0, vPos), 1, true, Color4.LightGray)
            {
                TextShadow = true
            };
            text.Field         = FieldTypes.StandardSnapTopCentre;
            text.Origin        = OriginTypes.TopCentre;
            text.TextAlignment = TextAlignment.Centre;
            text.MeasureText(); //force a measure as this is the last sprite to be added to the draggable area (need height to be precalculated)
            text.TextBounds.X = 600;
            smd.Add(text);

            vPos += (int)text.MeasureText().Y + 50;

            UpdateButtons();

            vPos += 50;

            smd.ScrollTo(ScrollPosition);
        }
Пример #10
0
        public OnlineSelection(Game game)
            : base(game)
        {
            if (AudioEngine.AudioState == AudioStates.Playing)
            {
                wasPlayingAudio = true;
                AudioEngine.TogglePause();
            }

            spriteManager   = new SpriteManager(true);
            resultsPane     = new pScrollableArea(new Rectangle(0, 82, GameBase.WindowManager.WidthScaled - 4 - OsuDirect.WIDTH, 350), Vector2.Zero, true);
            spriteManagerFg = new SpriteManager(true);

            searchInfo          = new pText("Type a search to begin.", 11, new Vector2(20, 40), 1, true, Color.YellowGreen);
            searchInfo.TextBold = true;
            spriteManager.Add(searchInfo);

            results = new pText("", 16, new Vector2(20, 80), 1, true, Color.White);
            spriteManager.Add(results);

            searchTextBox           = new pTextBoxOmniscient(18, new Vector2(20, 20), 300, false, 1.1f);
            searchTextBox.OnChange += delegate { nextSearchUpdate = GameBase.Time + 600; };
            spriteManagerFg.Add(searchTextBox.SpriteCollection);

            loadingText = new pSprite(TextureManager.Load(@"searching", SkinSource.Osu), new Vector2(320, 240), 1f, true,
                                      Color.TransparentWhite);
            loadingText.Origin = Origins.Centre;
            loadingText.UpdateTextureAlignment();

            GameBase.spriteManager.Add(loadingText);

            backButton = new BackButton(delegate { GameBase.ChangeMode(OsuModes.Menu); });
            spriteManagerFg.Add(backButton.SpriteCollection);

            int xPos = 330;

            pButton pb = new pButton("Newest Maps", new Vector2(xPos, 20), new Vector2(100, 20), 1, Color.Orange,
                                     delegate
            {
                lastSearch = "Newest";
                searchTextBox.SetToDefault();
                displayModeDropdown.SetSelected(0, false);
            });

            spriteManager.Add(pb.SpriteCollection);

            xPos += 105;

            pb = new pButton("Top Rated", new Vector2(xPos, 20), new Vector2(100, 20), 1, Color.OrangeRed,
                             delegate
            {
                lastSearch = "Top Rated";
                searchTextBox.SetToDefault();
                displayModeDropdown.SetSelected(0, false);
            });
            spriteManager.Add(pb.SpriteCollection);

            xPos += 105;

            pb = new pButton("Most Played", new Vector2(xPos, 20), new Vector2(100, 20), 1, Color.SkyBlue,
                             delegate
            {
                lastSearch = "Most Played";
                searchTextBox.SetToDefault();
                displayModeDropdown.SetSelected(0, false);
            });
            spriteManager.Add(pb.SpriteCollection);


            pText t = new pText("Display:", 11, new Vector2(5, 55), 1, true, Color.White);

            t.TextBold = true;
            spriteManager.Add(t);

            displayExisting = new pCheckbox("Show already downloaded maps", 0.88f, new Vector2(320, 54), 1, false);
            spriteManager.Add(displayExisting.SpriteCollection);

            displayExisting.OnCheckChanged += displayExisting_OnCheckChanged;

            displayModeDropdown = new pDropdown(spriteManagerFg, "", new Vector2(50, 54));
            displayModeDropdown.AddOption("All", 4);
            displayModeDropdown.AddOption("Ranked", 0);
            displayModeDropdown.AddOption("Ranked (Played)", 7);
            displayModeDropdown.AddOption("Qualified", 3);
            displayModeDropdown.AddOption("Pending/Help", 2);
            displayModeDropdown.AddOption("Graveyard", 5);

            displayModeDropdown.SetSelected(4, true);
            displayModeDropdown.OnSelect += pd_OnSelect;

            t          = new pText("Mode:", 11, new Vector2(180, 55), 1, true, Color.White);
            t.TextBold = true;
            spriteManager.Add(t);

            displayOsuModeDropdown = new pDropdown(spriteManagerFg, "", new Vector2(220, 54), 85, 1);
            displayOsuModeDropdown.AddOption(@"All", -1);
            displayOsuModeDropdown.AddOption(@"osu!", 0);
            displayOsuModeDropdown.AddOption(@"Taiko", 1);
            displayOsuModeDropdown.AddOption(@"Catch the Beat", 2);
            displayOsuModeDropdown.AddOption(@"osu!mania", 3);

            displayOsuModeDropdown.SetSelected(-1, true);
            displayOsuModeDropdown.OnSelect += mode_OnSelect;


            KeyboardHandler.OnKeyRepeat += KeyboardHandler_OnKeyRepeat;
        }
Пример #11
0
        private void ShowResponseDialog(OnlineBeatmap beatmap)
        {
            if (RespondingBeatmap != null)
            {
                HideResponseDialog();
            }

            if ((GameBase.TournamentManager || (ConfigManager.sAutomaticDownload && (MatchSetup.Match != null || StreamingManager.CurrentlySpectating != null))) &&
                !beatmap.exists && !beatmap.HasAttachedDownload)
            {
                beatmap.Download(ConfigManager.sAutomaticDownloadNoVideo);
                return;
            }

            if (GameBase.Tournament)
            {
                return;
            }

            background.FlashColour(Color.Gray, 500);

            if (ResponseSprites != null)
            {
                ResponseSprites.ForEach(s =>
                {
                    s.FadeOut(100);
                    s.AlwaysDraw = false;
                });
            }

            if (thumbRequest != null)
            {
                thumbRequest.Abort();
            }
            if (previewRequest != null)
            {
                previewRequest.Abort();
            }

            RespondingBeatmap = beatmap;
            ResponseSprites   = new List <pSprite>();

            float y = 24;

            pText pt = new pText(beatmap.artist, 12, new Vector2(background.Position.X, YPOS + y), 1, true, Color.Orchid);

            pt.Field    = Fields.TopRight;
            pt.TextBold = true;
            ResponseSprites.Add(pt);

            y += 12;

            pt       = new pText(beatmap.title, 12, new Vector2(background.Position.X, YPOS + y), 1, true, Color.White);
            pt.Field = Fields.TopRight;

            pt.TextBold = true;
            ResponseSprites.Add(pt);

            y += 12;

            pt       = new pText("by " + beatmap.creator, 12, new Vector2(background.Position.X, YPOS + y), 1, true, Color.White);
            pt.Field = Fields.TopRight;
            ResponseSprites.Add(pt);

            y += 14;

            previewThumbnail = new pSprite(null, Fields.TopRight, Origins.Centre, Clocks.Game, new Vector2(background.Position.X - (WIDTH / 2), YPOS + y + (WIDTH * 0.8f / 2)), 1, true, Color.TransparentWhite);
            previewThumbnail.IsDisposable = true;
            previewThumbnail.Scale        = 0.7f;
            y += 100;

            thumbRequest           = new pWebRequest(General.STATIC_WEB_ROOT_BEATMAP + @"/thumb/" + beatmap.setId + @"l.jpg");
            thumbRequest.Finished += delegate(pWebRequest r, Exception e)
            {
                byte[] data = r.ResponseData;

                if (e != null || data.Length == 0)
                {
                    return;
                }

                GameBase.Scheduler.Add(delegate
                {
                    previewThumbnail.Texture = pTexture.FromBytes(data);
                    SkinManager.RegisterUnrecoverableTexture(previewThumbnail.Texture);

                    fadeInThumbnail();
                });
            };

            thumbRequest.Perform();

            if (!disallowAudioPreview)
            {
                previewRequest           = new pWebRequest(string.Format(@"{0}/preview/{1}.mp3", General.STATIC_WEB_ROOT_BEATMAP, beatmap.setId));
                previewRequest.Finished += delegate(pWebRequest r, Exception e)
                {
                    byte[] data = r.ResponseData;

                    if (e != null || data.Length == 0)
                    {
                        return;
                    }

                    GameBase.Scheduler.Add(delegate
                    {
                        if (RespondingBeatmap != beatmap)
                        {
                            return;
                        }

                        WasPlayingAudio = AudioEngine.AudioState == AudioStates.Playing;
                        if (WasPlayingAudio && GameBase.Mode != OsuModes.OnlineSelection && GameBase.Mode != OsuModes.Play)
                        {
                            AudioEngine.AllowRandomSong = false;
                            AudioEngine.TogglePause();
                        }

                        sampleTrack = AudioEngine.PlaySampleAsTrack(data);
                        sampleTrack.Play();

                        fadeInThumbnail();
                    });
                };

                previewRequest.Perform();
            }

            bool hasMap = BeatmapManager.GetBeatmapBySetId(beatmap.setId) != null;

            pButton pbut = null;

            float buttonHeight;

            if (hasMap && !beatmap.HasAttachedDownload && beatmap.hasVideo)
            {
                buttonHeight = 16.25f;
            }
            else if (hasMap || (!beatmap.HasAttachedDownload && beatmap.hasVideo))
            {
                buttonHeight = 20f;
            }
            else
            {
                buttonHeight = 25f;
            }


            if (hasMap)
            {
                pbut = new pButton("Go to map",
                                   new Vector2(background.Position.X, YPOS + y), new Vector2(WIDTH, buttonHeight),
                                   0.92f, Color.SkyBlue,
                                   delegate
                {
                    if (MatchSetup.Match != null || Player.Instance != null)
                    {
                        return;
                    }

                    Beatmap b = BeatmapManager.GetBeatmapBySetId(beatmap.setId);

                    BeatmapManager.Current = b;
                    GameBase.ChangeMode(OsuModes.SelectPlay, true);

                    HideResponseDialog();
                }, false, true);
                ResponseSprites.AddRange(pbut.SpriteCollection);

                y += buttonHeight + 2;
            }

            pbut = new pButton(beatmap.HasAttachedDownload ? "Cancel DL" : "Download",
                               new Vector2(background.Position.X, YPOS + y), new Vector2(WIDTH, buttonHeight),
                               0.92f, Color.Bisque,
                               delegate
            {
                beatmap.Download();
                HideResponseDialog();
            }, false, true);
            ResponseSprites.AddRange(pbut.SpriteCollection);

            y += buttonHeight + 2;

            if (!beatmap.HasAttachedDownload && beatmap.hasVideo)
            {
                pbut = new pButton("DL NoVideo", new Vector2(background.Position.X, YPOS + y),
                                   new Vector2(WIDTH, buttonHeight), 0.92f, Color.BlueViolet,
                                   delegate
                {
                    beatmap.Download(true);
                    HideResponseDialog();
                }, false, true);
                ResponseSprites.AddRange(pbut.SpriteCollection);

                y += buttonHeight + 2;
            }

            pbut = new pButton("Cancel", new Vector2(background.Position.X, YPOS + y), new Vector2(WIDTH, buttonHeight), 0.92f, Color.Gray,
                               delegate { HideResponseDialog(); }, false, true);
            ResponseSprites.AddRange(pbut.SpriteCollection);

            y += buttonHeight + 2;

            if (beatmap.postid > 0)
            {
                pbut = new pButton("View Post", new Vector2(background.Position.X, YPOS + y),
                                   new Vector2(WIDTH, buttonHeight), 0.92f, Color.YellowGreen,
                                   delegate { GameBase.ProcessStart(String.Format(Urls.FORUM_POST, beatmap.postid)); }, false, true);
                ResponseSprites.AddRange(pbut.SpriteCollection);
            }
            else
            {
                pbut = new pButton("View Thread", new Vector2(background.Position.X, YPOS + y),
                                   new Vector2(WIDTH, buttonHeight), 0.92f, Color.YellowGreen,
                                   delegate { GameBase.ProcessStart(String.Format(Urls.FORUM_TOPIC, beatmap.threadid)); }, false, true);
                ResponseSprites.AddRange(pbut.SpriteCollection);
            }


            y += buttonHeight + 2;

            pbut = new pButton("View Listing", new Vector2(background.Position.X, YPOS + y),
                               new Vector2(WIDTH, buttonHeight), 0.92f, Color.OrangeRed,
                               delegate { GameBase.ProcessStart(String.Format(Urls.BEATMAP_SET_LISTING, beatmap.setId)); }, false, true);
            ResponseSprites.AddRange(pbut.SpriteCollection);


            //The panel isn't yet visible so we are fine to animate as per-usual.
            ResponseSprites.ForEach(s => s.FadeInFromZero(100));
            ResponseSprites.Add(previewThumbnail);

            spriteManager.Add(ResponseSprites);
        }
Пример #12
0
        public override void Initialize()
        {
            content = new ResourceContentManager(GameBase.Instance.Services, ResourcesStore.ResourceManager);

            KeyboardHandler.OnKeyPressed += KeyboardHandler_OnKeyPressed;


            if (SongSelection.ForceRefresh)
            {
                BeatmapManager.CheckNewFiles();
                BeatmapManager.ProcessBeatmaps();
                BeatmapManager.GetOnlineBeatmapInfo();
                SongSelection.ForceRefresh = false;
            }

            if (Lobby.Status == LobbyStatus.Play)
            {
                Lobby.Status = LobbyStatus.Setup;
            }

            spriteManager = new SpriteManager();

            pText headerText =
                new pText("Match Setup", 30, new Vector2(0, 0), 0.955F, true, new Color(255, 255, 255, 255));

            headerText.TextShadow = true;
            spriteManager.Add(headerText);

            headerText2 = new pText("You are " + (IsHost ? "the host" : "a player"), 16, new Vector2(4, 26),
                                    0.955F, true, new Color(255, 255, 255, 255));
            spriteManager.Add(headerText2);

            pSprite bg =
                new pSprite(content.Load <Texture2D>("matchsetup-background"), FieldTypes.Window, OriginTypes.TopLeft,
                            ClockTypes.Game, Vector2.Zero, 0, true, Color.White);

            spriteManager.Add(bg);

            buttonStart = new pButton("Ready!", new Vector2(270, 285), new Vector2(350, 30),
                                      0.92f, new Color(99, 139, 228), OnReady);
            spriteManager.Add(buttonStart.SpriteCollection);

            pButton pbut = new pButton("Leave Match", new Vector2(10, 285), new Vector2(250, 30), 0.92f,
                                       new Color(235, 160, 62), OnLeaveGame);

            spriteManager.Add(pbut.SpriteCollection);

            buttonBeatmap = new pButton("Change...", new Vector2(384, 112), new Vector2(80, 18), 0.90f,
                                        Color.YellowGreen, OnSelectBeatmap);
            spriteManager.Add(buttonBeatmap.SpriteCollection);
            buttonMods = new pButton("Change...", new Vector2(352, 210), new Vector2(80, 18), 0.90f,
                                     Color.YellowGreen, OnSelectMods);
            spriteManager.Add(buttonMods.SpriteCollection);

/*            spriteManager.Add(new pText("Current Players:", 18, new Vector2(10, 60), 1, true, Color.White));
 *          spriteManager.Add(new pText("Game Name:", 18, new Vector2(300, 60), 1, true, Color.White));
 *          spriteManager.Add(new pText("Now Playing:", 18, new Vector2(300, 110), 1, true, Color.White));
 *          spriteManager.Add(new pText("Active Mods:", 18, new Vector2(300, 210), 1, true, Color.White));*/

            for (int i = 0; i < 8; i++)
            {
                /*spriteManager.Add(new pText((i + 1).ToString(), 18, new Vector2(10, 85 + i*25), 1, true, Color.White));*/

                slotText[i] = new pText("", 18, new Vector2(57, 85 + i * 25), 1, true, Color.White);
                spriteManager.Add(slotText[i]);

                slotTextInfo[i] = new pText("", 10, new Vector2(210, 85 + i * 25), new Vector2(77, 0), 1, true,
                                            Color.White, false);
                slotTextInfo[i].TextAlignment = Alignment.Right;
                spriteManager.Add(slotTextInfo[i]);

                pSprite status = new pSprite(GameBase.WhitePixel, FieldTypes.Window,
                                             OriginTypes.TopLeft, ClockTypes.Game, new Vector2(50, 85 + i * 25), 0.974F,
                                             true,
                                             new Color(255, 255, 255, 255));
                status.UseVectorScale = true;
                status.IsClickable    = true;
                status.VectorScale    = new Vector2(5, 20);
                status.CurrentScale   = 1.6f;
                spriteManager.Add(status);

                slotStatus[i] = status;

                pSprite slot = new pSprite(GameBase.WhitePixel, FieldTypes.Window,
                                           OriginTypes.TopLeft, ClockTypes.Game, new Vector2(57, 85 + i * 25), 0.974F,
                                           true,
                                           new Color(255, 255, 255, 50));
                slot.UseVectorScale = true;
                slot.IsClickable    = true;
                slot.VectorScale    = new Vector2(230, 20);
                slot.CurrentScale   = 1.6f;
                slot.ToolTip        = "Move to this slot.";
                slot.HoverEffect    = new Transformation(TransformationType.Fade, 0.2f, 0.4f, 0, 60);
                slot.OnClick       += clickSlot;
                slot.TagNumeric     = i;
                slotBackground[i]   = slot;
                spriteManager.Add(slot);

                pSprite lockToggle = new pSprite(content.Load <Texture2D>("lobby-unlock"),
                                                 new Vector2(36, 95 + i * 25), 1, true, Color.LightGray);
                slotLock[i]            = lockToggle;
                lockToggle.OnClick    += lockToggle_OnClick;
                lockToggle.OriginType  = OriginTypes.Centre;
                lockToggle.HoverEffect = new Transformation(TransformationType.Rotation, 0, 0.1f, 0, 100);
                lockToggle.ClickEffect = new Transformation(TransformationType.Scale, 2, 1, 0, 200);
                lockToggle.ToolTip     = "Lock this slot";
                lockToggle.TagNumeric  = i;
                spriteManager.Add(lockToggle);
            }

            if (IsHost)
            {
                changeBeatmap();
            }

            detailsGameName             = new pTextBox(Match.gameName, 16, new Vector2(310, 85), new Vector2(320, 18), 1);
            detailsGameName.OnCommit   += detailsGameName_OnCommit;
            detailsGameName.ReadOnly    = true;
            detailsGameName.LengthLimit = 50;
            spriteManager.Add(detailsGameName.SpriteCollection);

            UpdatePending     = true;
            SongChangePending = true;
            ModChangePending  = true;
            HostChangePending = true;

            if (IsHost && HostChangePending)
            {
                HostChangePending = false;
                SetHost();
            }

            ModManager.ModStatus = Match.activeMods;

            base.Initialize();


            GameBase.LoadComplete();

            if (!ChatEngine.IsVisible)
            {
                ChatEngine.Toggle();
            }

            Transformation t = new Transformation(TransformationType.Scale, 1, 1.2F, 0, 100);

            t.Easing = EasingTypes.In;
            Transformation t2 = new Transformation(TransformationType.Scale, 1.1F, 1.2F, 0, 100);

            t2.Easing = EasingTypes.In;
            pSprite p =
                new pSprite(content.Load <Texture2D>("editor-button-pause"), FieldTypes.Window, OriginTypes.Centre,
                            ClockTypes.Game, new Vector2(460, 15), 0.96F, true, Color.White, "b");

            p.IsClickable    = true;
            p.ClickEffect    = t2;
            p.HoverEffect    = t;
            p.CatchUniversal = true;
            p.OnClick       += pause;
            spriteManager.Add(p);
        }
Пример #13
0
        protected virtual void InitializeSpecifics()
        {
            pText pt =
                new pText(BeatmapManager.Current.DisplayTitle, 22, new Vector2(0, 0), Vector2.Zero, 0.991F, true,
                          Color.White, false);

            pt.ViewOffsetImmune = true;
            spriteManagerWideScrolling.Add(pt);

            pt =
                new pText("Beatmap by " + BeatmapManager.Current.Creator, 16, new Vector2(1, 20), Vector2.Zero, 0.991F,
                          true, Color.White, false);
            pt.ViewOffsetImmune = true;
            spriteManagerWideScrolling.Add(pt);

            pt = new pText(string.Format("Played by {0} on {1}.", score.PlayerName, score.Date.ToLocalTime()), 16, new Vector2(1, 34), Vector2.Zero,
                           0.991F, true, Color.White, false);
            pt.ViewOffsetImmune = true;
            spriteManagerWideScrolling.Add(pt);

            float buttonPosition = 360;

            if (!ReplayMode)
            {
                if (SkinManager.UseNewLayout)
                {
                    b_retry = new pSprite(TextureManager.Load(@"pause-retry"), Fields.TopRight,
                                          Origins.CentreRight,
                                          Clocks.Game,
                                          new Vector2(0, buttonPosition), 0.94F, true,
                                          new Color(255, 255, 255, 178));
                }
                else
                {
                    b_retry =
                        new pSprite(TextureManager.Load(@"ranking-retry"), Fields.TopRight,
                                    Origins.CentreRight,
                                    Clocks.Game,
                                    new Vector2(0, buttonPosition), 0.94F, true,
                                    new Color(255, 255, 255, 178));
                }
                b_retry.OnClick    += retry_OnClick;
                b_retry.HandleInput = true;
                b_retry.HoverEffect = new Transformation(TransformationType.Fade, 0.7F, 1, 0, 200);
                spriteManagerWideScrolling.Add(b_retry);

                buttonPosition += 60;
            }

            if ((score.Replay != null && score.Replay.Count > 0) ||
                score.ReplayCompressed != null ||
                score.LocalReplayPresent ||
                score.HasOnlineReplay)
            {
                if (!GameBase.Tournament)
                {
                    if (SkinManager.UseNewLayout)
                    {
                        b_replay =
                            new pSprite(TextureManager.Load(@"pause-replay"), Fields.TopRight,
                                        Origins.CentreRight,
                                        Clocks.Game,
                                        new Vector2(0, buttonPosition), 0.94F, true,
                                        new Color(255, 255, 255, 178));
                    }
                    else
                    {
                        b_replay =
                            new pSprite(TextureManager.Load(@"ranking-replay"), Fields.TopRight,
                                        Origins.CentreRight,
                                        Clocks.Game,
                                        new Vector2(0, buttonPosition), 0.94F, true,
                                        new Color(255, 255, 255, 178));
                    }


                    b_replay.OnClick    += replay_OnClick;
                    b_replay.HandleInput = true;
                    b_replay.HoverEffect = new Transformation(TransformationType.Fade, 0.7F, 1, 0, 200);
                    spriteManagerWideScrolling.Add(b_replay);

                    buttonPosition += 60;
                }
            }

            if (rankingDialog != null)
            {
                onlineRankingButton = new pButton("▼ Online Ranking ▼", new Vector2(GameBase.WindowManager.WidthScaled / 2 - 100, GameBase.WindowManager.HeightScaled - 26), new Vector2(200, 30), 0.95f, Color.BlueViolet, delegate { scrollableArea.ScrollToPosition(GameBase.WindowManager.HeightScaled * 0.875f, -0.99f); }, true, false, null, false);
                spriteManagerWideAbove.Add(onlineRankingButton.SpriteCollection);
            }
        }
Пример #14
0
        private void Reload(bool loadNewSkin)
        {
            spriteManager.Clear();



            if (loadNewSkin)
            {
                SkinManager.LoadSkin(true);
                AudioEngine.CurrentSampleSet = SampleSet.None;
                if (BeatmapManager.Current != null)
                {
                    HitObjectManager.LoadFile();
                }
            }

            pAnimation back = new pAnimation(SkinManager.LoadAll("menu-back"), FieldTypes.Window, OriginTypes.TopLeft, ClockTypes.Game, new Vector2(0, 480), 0.8F, true, new Color(255, 255, 255, (byte)(255 * 0.6)));

            back.SetFramerateFromSkin();
            back.OriginPosition = new Vector2(0, 146);
            back.OnClick       += back_OnClick;
            back.IsClickable    = true;
            back.HoverEffect    = new Transformation(TransformationType.Fade, 0.6F, 1, 0, 300);
            spriteManager.Add(back);

            pButton pbutton = new pButton("Get more skins", new Vector2(440, 400), new Vector2(200, 30), 1, Color.White, delegate { GameBase.ChangeMode(Modes.UpdateSkin); });

            pbutton.Text.StartColour = Color.Black;
            spriteManager.AddRange(pbutton.SpriteCollection);

            pbutton = new pButton("Random Beatmap", new Vector2(440, 440), new Vector2(200, 30), 1, Color.White, newSong);
            pbutton.Text.StartColour = Color.Black;
            spriteManager.AddRange(pbutton.SpriteCollection);

            int verticalSpacing = 0;

            pText   pt;
            pSprite pb;

            spriteManager.Add(new pText("Available Skins:", 20, new Vector2(460, 20), Vector2.Zero, 1, true, Color.White, true));

            for (int i = page * skinsPerPage; i < (page + 1) * skinsPerPage; i++)
            {
                if (i < Skins.Count)
                {
                    Skin skin = Skins[i];
                    if (skin.RawName == ConfigManager.sSkin)
                    {
                        pt =
                            new pText(SkinManager.Current.SkinName, 15, new Vector2(444, 50 + verticalSpacing),
                                      new Vector2(200, 0), 0.9f,
                                      true, Color.White, false);
                        pt.Tag              = skin.RawName;
                        pt.TextAlignment    = Alignment.LeftFixed;
                        pt.BackgroundColour = Color.Black;
                        pt.BorderWidth      = 2;
                        pt.BorderColour     = Color.LimeGreen;
                        pt.OnClick         += pt_OnClick;
                        spriteManager.Add(pt);
                    }
                    else
                    {
                        pt =
                            new pText(skin.SkinName, 15, new Vector2(480, 50 + verticalSpacing), new Vector2(200, 0),
                                      0.9f,
                                      true, Color.White, false);
                        pt.Tag              = skin.RawName;
                        pt.IsClickable      = true;
                        pt.TextAlignment    = Alignment.LeftFixed;
                        pt.BackgroundColour = Color.Black;
                        pt.BorderWidth      = 2;
                        pt.BorderColour     = Color.OrangeRed;
                        pt.HoverEffect      =
                            new Transformation(pt.StartPosition, pt.StartPosition - new Vector2(36, 0), 0, 200);
                        pt.HoverEffect.Easing = EasingTypes.In;
                        pt.OnClick           += pt_OnClick;

                        spriteManager.Add(pt);
                    }
                }
                verticalSpacing += 20;
            }

            if (page > 0)
            {
                pt =
                    new pText("<< Previous Page", 15, new Vector2(480, 50 + verticalSpacing), new Vector2(200, 0), 0.9f,
                              true, Color.White, false);
                pt.IsClickable        = true;
                pt.TextAlignment      = Alignment.LeftFixed;
                pt.BackgroundColour   = Color.Black;
                pt.BorderWidth        = 2;
                pt.BorderColour       = Color.Orange;
                pt.HoverEffect        = new Transformation(pt.StartPosition, pt.StartPosition - new Vector2(36, 0), 0, 200);
                pt.HoverEffect.Easing = EasingTypes.In;
                pt.OnClick           += prevPage;
                spriteManager.Add(pt);
            }


            verticalSpacing += 20;

            if (Skins.Count > (page + 1) * skinsPerPage)
            {
                pt =
                    new pText(">> Next Page", 15, new Vector2(480, 50 + verticalSpacing), new Vector2(200, 0), 0.9f,
                              true, Color.White, false);
                pt.IsClickable        = true;
                pt.TextAlignment      = Alignment.LeftFixed;
                pt.BackgroundColour   = Color.Black;
                pt.BorderWidth        = 2;
                pt.BorderColour       = Color.Orange;
                pt.HoverEffect        = new Transformation(pt.StartPosition, pt.StartPosition - new Vector2(36, 0), 0, 200);
                pt.HoverEffect.Easing = EasingTypes.In;
                pt.OnClick           += nextPage;
                verticalSpacing      += 20;
                spriteManager.Add(pt);
            }
            verticalSpacing += 60;

            pCheckbox skinSamples = new pCheckbox("Use skin's sound samples", new Vector2(445, verticalSpacing), 0.9f, ConfigManager.sSkinSamples);

            skinSamples.Tooltip         = "If this is selected, the default osu!sounds will be used for hit samples";
            skinSamples.OnCheckChanged += skinSamples_OnCheckChanged;
            spriteManager.AddRange(skinSamples.SpriteCollection);

            verticalSpacing += 20;

            pCheckbox useTaikoSkin = new pCheckbox("Use Taiko skin for Taiko Mod", new Vector2(445, verticalSpacing), 0.9f, ConfigManager.sUseTaikoSkin);

            useTaikoSkin.Tooltip         = "If this is selected and the Taiko skin is present,\nit will automatically be used when playing Taiko Mod.";
            useTaikoSkin.OnCheckChanged += useTaikoSkin_OnCheckChanged;
            spriteManager.AddRange(useTaikoSkin.SpriteCollection);

            pAnimation pa =
                new pAnimation(SkinManager.LoadAll("scorebar-colour"), FieldTypes.Window, OriginTypes.TopLeft, ClockTypes.Game, new Vector2(3, 10), 0.95F, true, Color.White, null);

            pa.frameSkip = 60 / pa.TextureCount;
            pa.DrawWidth = 460;
            spriteManager.Add(pa);
            pb =
                new pSprite(SkinManager.Load("scorebar-ki"), OriginTypes.Centre, new Vector2(287, 16), 0.97F, true, Color.White);
            spriteManager.Add(pb);
            pb =
                new pSprite(SkinManager.Load("scorebar-kidanger"), OriginTypes.Centre,
                            new Vector2(160, 16), 0.98F, true, Color.White);
            spriteManager.Add(pb);
            pb =
                new pSprite(SkinManager.Load("scorebar-kidanger2"), OriginTypes.Centre, new Vector2(100, 16), 0.99F, true, Color.White);
            spriteManager.Add(pb);

            pb = new pSprite(SkinManager.Load("scorebar-bg"), Vector2.Zero, 0.9F, true, Color.White);
            spriteManager.Add(pb);


            pSprite detailsBack = new pSprite(GameBase.WhitePixel, new Vector2(440, 0), 0.2F, true, new Color(0, 0, 0, 160));

            detailsBack.VectorScale    = new Vector2(320, 768);
            detailsBack.UseVectorScale = true;
            spriteManager.Add(detailsBack);

            currentSkin =
                new pText(SkinManager.Current.SkinName + " by " + SkinManager.Current.SkinAuthor, 24, new Vector2(0, 30), Vector2.Zero,
                          1, true, Color.White, true);
            currentSkin.TextBold = true;
            currentSkin.FadeInFromZero(1500);
            spriteManager.Add(currentSkin);
        }
Пример #15
0
        internal Options(Game game) : base(game)
        {
            KeyboardHandler.OnKeyPressed += GameBase_OnKeyPressed;

            spriteManager         = new SpriteManager();
            spriteManagerAudio    = new SpriteManager();
            spriteManagerGraphics = new SpriteManager();
            spriteManagerInput    = new SpriteManager();
            spriteManagerOnline   = new SpriteManager();

            int vertSpacing = 30;

            startOffset = ConfigManager.sOffset;

            int t = ConfigManager.sComboFireHeight;

            ConfigManager.sComboFireHeight = 10;
            fireRender = new FireRenderer();
            ConfigManager.sComboFireHeight = t;

            SkinManager.LoadSkin();

            pSprite detailsBack =
                new pSprite(GameBase.WhitePixel, FieldTypes.Window,
                            OriginTypes.TopLeft,
                            ClockTypes.Game,
                            new Vector2(0, 0), 0.7F, true, Color.Black);

            detailsBack.VectorScale    = new Vector2(1024, 83);
            detailsBack.UseVectorScale = true;
            spriteManager.Add(detailsBack);

            pText version = new pText("osu! " + General.BUILD_NAME, 10, new Vector2(640, 0), 0.99f, true, Color.White);

            version.OriginType         = OriginTypes.TopRight;
            version.TextRenderSpecific = false;
            version.TextAa             = false;
            spriteManager.Add(version);

            pTabCollection ptab = new pTabCollection(spriteManager, 10, new Vector2(230, 52), 0.9f, true);

            ptab.TabColour = Color.Tomato;
            ptab.Add("Graphics", spriteManagerGraphics);
            ptab.Add("Audio", spriteManagerAudio);
            ptab.Add("Input", spriteManagerInput);
            ptab.Add("Online", spriteManagerOnline);

            ptab.OnTabChanged += pt_OnTabChanged;

            ptab.SetSelected(spriteManagerGraphics);

            pAnimation back =
                new pAnimation(SkinManager.LoadAll("menu-back"), FieldTypes.Window,
                               OriginTypes.TopLeft,
                               ClockTypes.Game,
                               new Vector2(0, 480), 0.8F, true, new Color(255, 255, 255, (byte)(255 * 0.6)));

            back.SetFramerateFromSkin();
            back.OriginPosition = new Vector2(0, 146);
            back.OnClick       += back_OnClick;
            back.IsClickable    = true;
            back.HoverEffect    = new Transformation(TransformationType.Fade, 0.6F, 1, 0, 300);
            spriteManager.Add(back);

            pText headerText =
                new pText("Options", 30, new Vector2(0, 0), 0.955F, true, new Color(255, 255, 255, 255));

            spriteManager.Add(headerText);

            pText headerText2 = new pText("Change the way osu! behaves", 16, new Vector2(4, 26), 0.955F, true,
                                          new Color(255, 255, 255, 255));

            spriteManager.Add(headerText2);

            pSprite bg =
                new pSprite(SkinManager.Load("playfield"), FieldTypes.Window, OriginTypes.TopLeft,
                            ClockTypes.Game, Vector2.Zero, 0, true, new Color(44, 82, 108));

            spriteManager.Add(bg);

            //Graphics-related

            int vertCurrent = topHeight;

            pText pt =
                new pText("Resolution", 24, new Vector2(160, vertCurrent), Vector2.Zero, 1, true, Color.White, true);

            pt.OriginType = OriginTypes.Centre;
            spriteManagerGraphics.Add(pt);

            vertCurrent += vertSpacing;

            pc640 = new pCheckbox(spriteManagerGraphics, "640x480", new Vector2(10, vertCurrent), 0.8F, false);
            pc640.OnCheckChanged += delegate
            {
                GameBase.SetScreenSize(640, 480);
                UpdateResolutionCheckboxes();
            };

            pc1024 = new pCheckbox(spriteManagerGraphics, "1024x768", new Vector2(160, vertCurrent), 0.8F, false);
            pc1024.OnCheckChanged += delegate
            {
                GameBase.SetScreenSize(1024, 768);
                UpdateResolutionCheckboxes();
            };

            vertCurrent += vertSpacing;


            pc800 = new pCheckbox(spriteManagerGraphics, "800x600", new Vector2(10, vertCurrent), 0.8F, false);
            pc800.OnCheckChanged += delegate
            {
                GameBase.SetScreenSize(800, 600);
                UpdateResolutionCheckboxes();
            };

            pCheckbox pc = new pCheckbox(spriteManagerGraphics, "Fullscreen Mode", new Vector2(160, vertCurrent), 0.8F,
                                         ConfigManager.sFullscreen);

            pc.OnCheckChanged += fullscreen_OnCheckChanged;

            UpdateResolutionCheckboxes();


            vertCurrent += vertSpacing + 40;

            pt =
                new pText("Detail Settings", 24, new Vector2(320, vertCurrent), Vector2.Zero, 1, true, Color.White,
                          true);
            pt.OriginType = OriginTypes.Centre;
            spriteManagerGraphics.Add(pt);

            vertCurrent += vertSpacing;

            pc = new pCheckbox(spriteManagerGraphics, "Limit Framerate", new Vector2(10, vertCurrent), 0.8F,
                               ConfigManager.sFrameSync);
            pc.Tooltip =
                "Limits all internal calculations to 60fps.\nThis will help fix lag problems - try toggling it if you experience lag!";
            pc.OnCheckChanged += frameSync_OnClick;

            pc = new pCheckbox(spriteManagerGraphics, "Snaking Sliders", new Vector2(160, vertCurrent), 0.8F,
                               ConfigManager.sSnakingSliders);
            pc.Tooltip =
                "Sliders gradually snake out from their starting point.\nThis should run fine unless you have an ancient machine.";
            pc.OnCheckChanged += snakingSliders_OnClick;

            vertCurrent += vertSpacing;

            pc = new pCheckbox(spriteManagerGraphics, "Background Video", new Vector2(10, vertCurrent), 0.8F,
                               ConfigManager.sVideo);
            pc.Tooltip =
                "Enable full-window video playback.\nThis requires ffdshow (available from the osu! site).\nNote that if your ffdshow doesn't have a red system-tray icon, it is outdated and will not work correctly";
            pc.OnCheckChanged += video_OnClick;

            pc = new pCheckbox(spriteManagerGraphics, "Shader Effects", new Vector2(160, vertCurrent), 0.8F,
                               ConfigManager.sBloom);
            pc.Tooltip =
                "Enables application of a softening and other shader special effects in gameplay.\nThis requires Pixel Shader 2.0 support, and a relatively powerful PC.\nIf your card is unsupported, this will be automatically disabled.";
            pc.OnCheckChanged += bloom_OnClick;

            vertCurrent += vertSpacing;

            pc = new pCheckbox(spriteManagerGraphics, "Show Combo Fire", new Vector2(10, vertCurrent), 0.8F,
                               ConfigManager.sComboFire);
            pc.Tooltip =
                "When you achieve a combo of 30 or greater, fire will burn from the bottom of the screen.\nThis requires Pixel Shader 2.0 support.\nIf your card is unsupported, this will be automatically disabled.";
            pc.OnCheckChanged += comboFire_OnClick;

            comboFireHeight = new pSliderBar(spriteManagerGraphics, 0, 10, ConfigManager.sComboFireHeight,
                                             new Vector2(150, vertCurrent + 10), 120);
            comboFireHeight.SpriteCollection[1].ToolTip = "Adjust the maximum height of combo fire.";
            comboFireHeight.Visible = ConfigManager.sComboFire;

            vertCurrent = topHeight;

            vertSpacing = 35;

            vertCurrent += vertSpacing;

            pSprite pb =
                new pText("Skin", 24, new Vector2(480, vertCurrent - 16), Vector2.Zero, 1, true, Color.White, true);

            pb.OriginType = OriginTypes.Centre;
            spriteManagerGraphics.Add(pb);

            pb =
                new pSprite(SkinManager.Load("hit300g"), FieldTypes.Window,
                            OriginTypes.Centre,
                            ClockTypes.Game,
                            new Vector2(400, vertCurrent - 16), 0.3F, true, Color.White);
            pb.CurrentScale = 0.8F;
            spriteManagerGraphics.Add(pb);

            pb =
                new pSprite(SkinManager.Load("hit100k"), FieldTypes.Window,
                            OriginTypes.Centre,
                            ClockTypes.Game,
                            new Vector2(560, vertCurrent - 16), 0.3F, true, Color.White);
            pb.CurrentScale = 0.8F;
            spriteManagerGraphics.Add(pb);

            vertCurrent += vertSpacing;

            skinText =
                new pText(SkinManager.Current.SkinName + " by " + SkinManager.Current.SkinAuthor, 20,
                          new Vector2(480, vertCurrent), Vector2.Zero, 1, true, Color.Black, false);
            skinText.OriginType = OriginTypes.Centre;
            spriteManagerGraphics.Add(skinText);

            pb =
                new pSprite(SkinManager.Load("menu-button-background"), FieldTypes.Window,
                            OriginTypes.Centre,
                            ClockTypes.Game,
                            new Vector2(480, vertCurrent), 0.8F, true, Color.White);
            pb.OnClick      += changeSkin_OnClick;
            pb.CurrentScale  = 0.7F;
            pb.CurrentColour = new Color(0, 0, 0, 178);
            pb.IsClickable   = true;
            pb.HoverEffect   = new Transformation(TransformationType.Fade, 0.7F, 1, 0, 200);
            spriteManagerGraphics.Add(pb);

            //Audio
            vertCurrent = topHeight;

            pb =
                new pText("Volume", 24, new Vector2(320, vertCurrent), Vector2.Zero, 1, true, Color.White, true);
            pb.OriginType = OriginTypes.Centre;
            spriteManagerAudio.Add(pb);

            vertCurrent += vertSpacing - 8;

            vertSpacing = 25;

            pb =
                new pText("Master", 20, new Vector2(230, vertCurrent), Vector2.Zero, 1, true, Color.White, true);
            pb.OriginType = OriginTypes.Centre;
            spriteManagerAudio.Add(pb);

            masterVolume =
                new pSliderBar(spriteManagerAudio, 0, 100, AudioEngine.VolumeUniversal, new Vector2(280, vertCurrent), 180);

            vertCurrent += vertSpacing;

            pb =
                new pText("Music", 20, new Vector2(230, vertCurrent), Vector2.Zero, 1, true, Color.White, true);
            pb.OriginType = OriginTypes.Centre;
            spriteManagerAudio.Add(pb);

            musicVolume =
                new pSliderBar(spriteManagerAudio, 0, 100, AudioEngine.VolumeMusic, new Vector2(280, vertCurrent), 180);

            vertCurrent += vertSpacing;

            pb            = new pText("Effect", 20, new Vector2(230, vertCurrent), Vector2.Zero, 1, true, Color.White, true);
            pb.OriginType = OriginTypes.Centre;
            spriteManagerAudio.Add(pb);
            vertSpacing = 35;

            effectVolume =
                new pSliderBar(spriteManagerAudio, 0, 100, AudioEngine.VolumeEffect, new Vector2(280, vertCurrent), 180);

            vertCurrent += vertSpacing * 3;

            pb =
                new pText("Universal Audio Offset", 20, new Vector2(320, vertCurrent), Vector2.Zero, 1, true,
                          Color.White, true);
            pb.OriginType = OriginTypes.Centre;
            spriteManagerAudio.Add(pb);

            vertCurrent += 25;

            pb =
                new pText(
                    "Use left/right arrows to adjust until you can no longer hear the two\nseparate sounds.  This is not perfect, but will be improved soon.",
                    12, new Vector2(320, vertCurrent), Vector2.Zero, 1, true, Color.White, true);
            pb.OriginType = OriginTypes.Centre;
            spriteManagerAudio.Add(pb);

            vertCurrent += vertSpacing;

            audioOffset =
                new pSliderBar(spriteManagerAudio, -300, 300, ConfigManager.sOffset, new Vector2(180, vertCurrent), 200);

            audioOffsetText =
                new pText("", 20, new Vector2(440, vertCurrent), Vector2.Zero, 1, true, Color.White, true);
            audioOffsetText.OriginType = OriginTypes.Centre;
            spriteManagerAudio.Add(audioOffsetText);

            //Input
            vertCurrent = topHeight;

            pb =
                new pText("Mouse Sensitivity", 24, new Vector2(480, vertCurrent), Vector2.Zero, 1, true, Color.White,
                          true);
            pb.OriginType = OriginTypes.Centre;
            spriteManagerInput.Add(pb);

            vertCurrent += vertSpacing;

            pb = new pText("The default rate is the same as your desktop mouse speed.", 14,
                           new Vector2(480, vertCurrent), Vector2.Zero, 1, true, Color.White, true);
            pb.OriginType = OriginTypes.Centre;
            spriteManagerInput.Add(pb);

            vertCurrent += vertSpacing;

            mouseSpeed =
                new pSliderBar(spriteManagerInput, 0.5, 4, ConfigManager.sMouseSpeed, new Vector2(370, vertCurrent), 200);

            mouseSpeedText =
                new pText("", 20, new Vector2(600, vertCurrent), Vector2.Zero, 1, true, Color.White, true);
            mouseSpeedText.OriginType = OriginTypes.Centre;
            spriteManagerInput.Add(mouseSpeedText);

            vertCurrent = topHeight;

            pt =
                new pText("Toggles", 24, new Vector2(160, vertCurrent), Vector2.Zero, 1, true, Color.White, true);
            pt.OriginType = OriginTypes.Centre;
            spriteManagerInput.Add(pt);
            vertCurrent += vertSpacing;

            pc = new pCheckbox(spriteManagerInput, "Disable mouse wheel in play mode", new Vector2(10, vertCurrent), 0.8F,
                               ConfigManager.sMouseDisableWheel);
            pc.Tooltip =
                "During play, you can use the mouse wheel to adjust the volume and pause the game.\nThis will disable that functionality";
            pc.OnCheckChanged += disableMouseWheel_OnClick;

            vertCurrent += vertSpacing;

            pc = new pCheckbox(spriteManagerInput, "Disable mouse buttons in play mode", new Vector2(10, vertCurrent), 0.8F,
                               ConfigManager.sMouseDisableButtons);
            pc.Tooltip =
                "This option will disable all mouse buttons.\nSpecifically for people who use Z/X/Ctrl/Space to click.";
            pc.OnCheckChanged += disableMouseButtons_OnClick;

            vertCurrent += vertSpacing;

            pc = new pCheckbox(spriteManagerInput, "Force TabletPC support", new Vector2(10, vertCurrent), 0.8F,
                               ConfigManager.sTablet);
            pc.Tooltip =
                "osu! attempts to auto-detect if you are running on a tablet PC.\nThis sometimes fails depending on the operating sytem.\nEnable this if you are running a TabletPC or using a tablet and your clicks aren't handled correctly.";
            pc.OnCheckChanged += tablet_OnClick;

            vertCurrent += vertSpacing;

            pt =
                new pText("Key Bindings", 24, new Vector2(320, vertCurrent), Vector2.Zero, 1, true, Color.White, true);
            pt.OriginType = OriginTypes.Centre;
            spriteManagerInput.Add(pt);
            vertCurrent += vertSpacing - 10;

            pt1 = new pText(ConfigManager.sKeyboardBind1.ToString(), 24, new Vector2(330, vertCurrent), Vector2.Zero, 1, true, Color.White, true);
            pButton pbutton = new pButton("Main 1 (Taiko Inner-Left)", new Vector2(20, vertCurrent), new Vector2(260, 30), 0.9f, Color.DarkOrange, delegate { GameBase.ShowDialog(new OptionsBindKey(delegate(object sender, EventArgs e) { ConfigManager.sKeyboardBind1 = (Keys)sender; InputManager.CheckBindings(); UpdateBindings(); }, "Binding: Main 1 (Taiko Centre-Left)")); });

            spriteManagerInput.AddRange(pbutton.SpriteCollection);
            spriteManagerInput.Add(pt1);
            vertCurrent += vertSpacing;

            pt2     = new pText(ConfigManager.sKeyboardBind3.ToString(), 24, new Vector2(330, vertCurrent), Vector2.Zero, 1, true, Color.White, true);
            pbutton = new pButton("Main 2 (Taiko Inner-Right)", new Vector2(20, vertCurrent), new Vector2(260, 30), 0.9f, Color.DarkOrange, delegate { GameBase.ShowDialog(new OptionsBindKey(delegate(object sender, EventArgs e) { ConfigManager.sKeyboardBind3 = (Keys)sender; InputManager.CheckBindings(); UpdateBindings(); }, "Binding: Main 2 (Taiko Inner-Right)")); });
            spriteManagerInput.AddRange(pbutton.SpriteCollection);
            spriteManagerInput.Add(pt2);
            vertCurrent += vertSpacing;

            pt3     = new pText(ConfigManager.sKeyboardBind2.ToString(), 24, new Vector2(330, vertCurrent), Vector2.Zero, 1, true, Color.White, true);
            pbutton = new pButton("Alt 1 (Taiko Outer-Left)", new Vector2(20, vertCurrent), new Vector2(260, 30), 0.9f, Color.DarkOrange, delegate { GameBase.ShowDialog(new OptionsBindKey(delegate(object sender, EventArgs e) { ConfigManager.sKeyboardBind2 = (Keys)sender; InputManager.CheckBindings(); UpdateBindings(); }, "Binding: Alt 1 (Taiko Outer-Left)")); });
            spriteManagerInput.AddRange(pbutton.SpriteCollection);
            spriteManagerInput.Add(pt3);
            vertCurrent += vertSpacing;

            pt4     = new pText(ConfigManager.sKeyboardBind4.ToString(), 24, new Vector2(330, vertCurrent), Vector2.Zero, 1, true, Color.White, true);
            pbutton = new pButton("Alt 2 (Taiko Outer-Right)", new Vector2(20, vertCurrent), new Vector2(260, 30), 0.9f, Color.DarkOrange, delegate { GameBase.ShowDialog(new OptionsBindKey(delegate(object sender, EventArgs e) { ConfigManager.sKeyboardBind4 = (Keys)sender; InputManager.CheckBindings(); UpdateBindings(); }, "Binding: Alt 2 (Taiko Outer-Right)")); });
            spriteManagerInput.AddRange(pbutton.SpriteCollection);
            spriteManagerInput.Add(pt4);



            //Online
            vertCurrent = topHeight;

            pb =
                new pText("Toggles", 24, new Vector2(160, vertCurrent), Vector2.Zero, 1, true, Color.White, true);
            pb.OriginType = OriginTypes.Centre;
            spriteManagerOnline.Add(pb);

            vertCurrent += vertSpacing;

            pCheckbox pc1 = new pCheckbox(spriteManagerOnline, "Show chat ticker", new Vector2(10, vertCurrent), 0.8F,
                                          ConfigManager.sTicker);

            pc1.Tooltip         = "Popup new chat messages in a one-line display at the bottom of the screen\nwhen the chat console is not visible";
            pc1.OnCheckChanged += delegate { ChatEngine.ticker_OnClick(null, null); pc1.SetStatusQuietly(ConfigManager.sTicker); };

            vertCurrent += vertSpacing;

            pCheckbox pc2 = new pCheckbox(spriteManagerOnline, "Automatically hide chat", new Vector2(10, vertCurrent), 0.8F,
                                          ConfigManager.sAutoChatHide);

            pc2.Tooltip         = "When enabled, chat will automatically hide itself during gameplay.\nIt will be visible during breaks and intro/outro time.";
            pc2.OnCheckChanged += delegate { ChatEngine.hideMode_OnClick(null, null); pc2.SetStatusQuietly(ConfigManager.sAutoChatHide); };

            vertCurrent += vertSpacing;

            pCheckbox pc3 = new pCheckbox(spriteManagerOnline, "Popup notification when someone says your name", new Vector2(10, vertCurrent), 0.8F,
                                          ConfigManager.sChatHighlightName);

            pc3.Tooltip         = "A message will flash at the bottom of your screen (even during gameplay)\nwhen someone mentions yourname in chat.";
            pc3.OnCheckChanged += delegate { ConfigManager.sChatHighlightName = !ConfigManager.sChatHighlightName; pc3.SetStatusQuietly(ConfigManager.sChatHighlightName); };

            vertCurrent += vertSpacing;

            pCheckbox pc4 = new pCheckbox(spriteManagerOnline, "Share your city location with others", new Vector2(10, vertCurrent), 0.8F,
                                          ConfigManager.sDisplayCityLocation);

            pc4.Tooltip         = "By default, other users will only be able to see your country.  Enabling this adds your city to the\npublicly visible location.  This is usually quite accurate.";
            pc4.OnCheckChanged += delegate { ConfigManager.sDisplayCityLocation = !ConfigManager.sDisplayCityLocation; pc4.SetStatusQuietly(ConfigManager.sDisplayCityLocation); };

            vertCurrent = topHeight;

            pb =
                new pText("Active User", 24, new Vector2(480, vertCurrent), Vector2.Zero, 1, true, Color.White, true);
            pb.OriginType = OriginTypes.Centre;
            spriteManagerOnline.Add(pb);

            vertCurrent += vertSpacing;

            pb =
                new pSprite(SkinManager.Load("menu-button-background"), FieldTypes.Window,
                            OriginTypes.Centre,
                            ClockTypes.Game,
                            new Vector2(480, vertCurrent), 0.8F, true, Color.White);
            pb.OnClick      += provideLogin_OnClick;
            pb.CurrentScale  = 0.7F;
            pb.CurrentColour = new Color(0, 0, 0, 178);
            pb.IsClickable   = true;
            pb.HoverEffect   = new Transformation(TransformationType.Fade, 0.7F, 1, 0, 200);
            spriteManagerOnline.Add(pb);

            account =
                new pText("Click to login!", 20, new Vector2(480, vertCurrent), Vector2.Zero, 1, true, Color.Black,
                          false);
            account.OriginType = OriginTypes.Centre;
            spriteManagerOnline.Add(account);

            updateAccount();


            GameBase.LoadComplete();
        }