Ejemplo n.º 1
0
        internal override void Display()
        {
            spriteManager.HandleOverlayInput = true;

            pText t = new pText("Game Name:", 16, new Vector2(30, 100), 0.92f, true, Color.White);

            spriteManager.Add(t);

            gameName                 = new pTextBox(ConfigManager.sUsername + "'s game", 16, new Vector2(150, 100), 450, 0.92f);
            gameName.LengthLimit     = 50;
            gameName.OnCommit       += gameName_OnCommit;
            gameName.ResetTextOnEdit = true;
            spriteManager.Add(gameName.SpriteCollection);

            usePassword = new pCheckbox("Require password to join", new Vector2(30, 130), 0.92f, false);
            usePassword.OnCheckChanged += usePassword_OnCheckChanged;
            spriteManager.Add(usePassword.SpriteCollection);

            t = new pText("Password:"******"", 16, new Vector2(150, 160), 450, 0.92f);
            gamePassword.LengthLimit = 50;
            spriteManager.Add(gamePassword.SpriteCollection);
            passwordSprites.AddRange(gamePassword.SpriteCollection);

            t = new pText("Max Players:", 16, new Vector2(30, 190), 0.92f, true, Color.White);
            spriteManager.Add(t);

            currentVerticalSpace = 250;

            AddOption("Start Game", Color.LimeGreen, onClick, false);
            AddOption("Cancel", Color.LightGray, cancel, false);

            playerCount = new pDropdown(null, "", new Vector2(150, 190), 200, 0.96f);
            playerCount.AddOption("2 players", 2);
            playerCount.AddOption("3 players", 3);
            playerCount.AddOption("4 players", 4);
            playerCount.AddOption("5 players", 5);
            playerCount.AddOption("6 players", 6);
            playerCount.AddOption("7 players", 7);
            playerCount.AddOption("8 players", 8);
            if (bMatch.MAX_PLAYERS > 8)
            {
                playerCount.AddOption(bMatch.MAX_PLAYERS + " players", bMatch.MAX_PLAYERS);
            }
            playerCount.SetSelected(8, true);
            playerCount.SpriteManager = spriteManager;

            spriteManager.Add(playerCount.SpriteCollection);

            base.Display();

            Background.InitialColour = new Color(0, 0, 0, 200);
            passwordSprites.ForEach(s => s.FadeOut(0));
        }
Ejemplo n.º 2
0
        internal OptionCheckbox(string title, string tooltip, bool initialState = false, EventHandler onChange = null)
        {
            Checkbox = new pCheckbox(title, 0.8f, Vector2.Zero, 1, initialState, OptionElement.ELEMENT_SIZE)
            {
                Tooltip = tooltip
            };

            Checkbox.OnCheckChanged += cb_OnCheckChanged;

            if (onChange != null)
            {
                ValueChanged += onChange;
            }

            spriteManager.Add(Checkbox.SpriteCollection);

            addKeyword(title);
            addKeyword(tooltip);

            UpdateLabel(title);
        }
Ejemplo n.º 3
0
        public override void Initialize()
        {
            KeyboardHandler.OnKeyRepeat += GameBase_OnKeyRepeat;

            InputManager.Bind(InputEventType.OnMouseWheelUp, onMouseWheelUp);
            InputManager.Bind(InputEventType.OnMouseWheelDown, onMouseWheelDown);

            spriteManager = new SpriteManager(true);

            backButton = new BackButton(delegate { GameBase.ChangeMode(GameBase.CallbackMode); });
            spriteManager.Add(backButton.SpriteCollection);

            // instructions
            pText instructions =
                new pText(LocalisationManager.GetString(OsuString.OptionsOffsetWizard_Instructions), 16f,
                          new Vector2(GameBase.WindowManager.WidthScaled / 2, 400), new Vector2(500, 0), 0.8f, true, Color.White, false);

            instructions.TextAlignment = TextAlignment.Centre;
            instructions.Origin        = Origins.TopCentre;
            spriteManager.Add(instructions);

            // icon in middle
            middle             = new pSprite(TextureManager.Load(@"options-offset-tick"), Fields.TopLeft, Origins.Centre, Clocks.Game, new Vector2(GameBase.WindowManager.WidthScaled / 2, 240), 0.8f, true, Color.White);
            middle.VectorScale = new Vector2(0.1f, 2);
            spriteManager.Add(middle);

            //offset
            text = new pText(LocalisationManager.GetString(OsuString.OptionsOffsetWizard_UniversalOffset), 30f, new Vector2(50, 20), 0.8f, true, Color.White);
            spriteManager.Add(text);



            text          = new pText(ConfigManager.sOffset.ToString(), 30f, new Vector2(50 + text.MeasureText().X, 20), 0.8f, true, Color.YellowGreen);
            text.TextBold = true;
            spriteManager.Add(text);

            //ticking beat checkbox
            tickonotherbeat = new pCheckbox(LocalisationManager.GetString(OsuString.OptionsOffsetWizard_TickOther), new Vector2(50, 80), 0.8f, false);
            spriteManager.Add(tickonotherbeat.SpriteCollection);

            tickonotherbeat.OnCheckChanged += tickonotherbeat_OnCheckChanged;
            halfticker = new pCheckbox(LocalisationManager.GetString(OsuString.OptionsOffsetWizard_HalfTick), new Vector2(50, 60), 0.8f, false);
            spriteManager.Add(halfticker.SpriteCollection);

            halfticker.OnCheckChanged += halfticker_OnCheckChanged;
            doubleticker = new pCheckbox(LocalisationManager.GetString(OsuString.OptionsOffsetWizard_DoubleTick), new Vector2(150, 60), 0.8f, false);
            spriteManager.Add(doubleticker.SpriteCollection);

            doubleticker.OnCheckChanged += doubleticker_OnCheckChanged;
            tickonotherbeat.Hide();

            //list for moving lines
            lines = new List <pSprite>();

            if (AudioEngine.AudioTrack?.Preview ?? false)
            {
                AudioEngine.LoadAudio(BeatmapManager.Current, false, false);
                AudioEngine.ResetAudioTrack();
                AudioEngine.Play();
            }

            base.Initialize();

            setupBeatmap();
        }
Ejemplo n.º 4
0
        public override void Initialize()
        {
            int vPosition = yPosition + initial_display;
            int hPosition = 0;

            mousePositionInitial = MouseManager.MousePosition;

            background = new pSprite(GameBase.WhitePixel, Fields.TopLeft, Origins.TopLeft,
                                     Clocks.Game,
                                     new Vector2(0, vPosition), 0.68f, true,
                                     CurrentMapHasBeenPlayed ? new Color(0, 78, 155) : Color.DarkGray);
            background.Scale       = 1.6f;
            background.VectorScale = new Vector2(WIDTH, 3);
            spriteManager.Add(background);

            vPosition += 3;

            background = new pSprite(GameBase.WhitePixel, Fields.TopLeft, Origins.TopLeft,
                                     Clocks.Game,
                                     new Vector2(0, vPosition), 0.68f, true,
                                     new Color(0, 0, 0, 180));
            background.Scale       = 1.6f;
            background.VectorScale = new Vector2(WIDTH, extended_display);
            spriteManager.Add(background);

            spriteManager.Add(new pText("Visual", 24, new Vector2(hPosition, vPosition), Vector2.Zero, 0.99f, true, Color.LightBlue, true)
            {
                TextBold = true
            });

            vPosition += 15;

            spriteManager.Add(new pText("Settings", 22, new Vector2(hPosition + 50, vPosition), Vector2.Zero, 1, true, Color.White, true)
            {
                TextBold = true
            });

            const int padding          = 20;
            const int col_width        = 240;
            bool      mapHasBeenPlayed = CurrentMapHasBeenPlayed;

            if (!CurrentMapHasBeenPlayed)
            {
                spriteManager.Add(new pText(LocalisationManager.GetString(OsuString.FunSpoiler_PlayFirst), 15, new Vector2(GameBase.WindowManager.WidthScaled / 2, vPosition), new Vector2(col_width * 2, 0), 1, true, Color.OrangeRed, true)
                {
                    TextBorder = true,
                    Origin     = Origins.Centre,
                    TextBold   = true,
                    TextAa     = false
                });
            }

            vPosition += 30;

            spriteManager.Add(new pText(LocalisationManager.GetString(OsuString.FunSpoiler_BackgroundDim), 10, new Vector2(hPosition + padding, vPosition), new Vector2(WIDTH, 20), 0.99f, true, Color.White, true)
            {
                TextBold = true,
                TextAa   = false
            });

            spriteManager.Add(new pText(LocalisationManager.GetString(OsuString.FunSpoiler_Toggles), 10, new Vector2(hPosition + padding + col_width, vPosition), new Vector2(WIDTH, 20), 0.99f, true, mapHasBeenPlayed ? Color.White : Color.DarkGray, true)
            {
                TextBold = true,
                TextAa   = false
            });

            vPosition += 20;

            backgroundTransparency = new pSliderBar(spriteManager, 0, mapHasBeenPlayed ? 100 : 60, BeatmapManager.Current.DimLevel ?? ConfigManager.sDimLevel.Value, new Vector2(hPosition + padding, vPosition), col_width - padding * 2);
            backgroundTransparency.OnValueChanged += backgroundTransparency_ValueChanged;

            updateBackgroundTransparencyTooltip();

            checkboxStoryboard                 = new pCheckbox(LocalisationManager.GetString(OsuString.FunSpoiler_Storyboard), 0.8f, new Vector2(hPosition + padding + col_width, vPosition), 0.99f, false);
            checkboxStoryboard.Enabled         = mapHasBeenPlayed || BeatmapManager.Current.EpilepsyWarning;
            checkboxStoryboard.OnCheckChanged += checkboxStoryboard_OnCheckChanged;
            spriteManager.Add(checkboxStoryboard.SpriteCollection);

            checkboxVideo                 = new pCheckbox(LocalisationManager.GetString(OsuString.FunSpoiler_Video), 0.8f, new Vector2(hPosition + padding * 2 + col_width * 2, vPosition), 0.99f, false);
            checkboxVideo.Enabled         = false;
            checkboxVideo.OnCheckChanged += checkboxVideo_OnCheckChanged;
            spriteManager.Add(checkboxVideo.SpriteCollection);

            vPosition += 20;

            checkboxSkin = new pCheckbox(LocalisationManager.GetString(OsuString.FunSpoiler_Skin), 0.8f, new Vector2(hPosition + padding + col_width, vPosition), 0.99f, false);
            checkboxSkin.OnCheckChanged += checkboxSkin_OnCheckChanged;
            checkboxSkin.Enabled         = mapHasBeenPlayed;
            spriteManager.Add(checkboxSkin.SpriteCollection);

            vPosition += 20;

            checkboxHitsounds = new pCheckbox(LocalisationManager.GetString(OsuString.FunSpoiler_Hitsounds), 0.8f, new Vector2(hPosition + padding + col_width, vPosition), 0.99f, false);
            checkboxHitsounds.OnCheckChanged += checkboxHitsounds_OnCheckChanged;
            checkboxHitsounds.Enabled         = mapHasBeenPlayed;
            spriteManager.Add(checkboxHitsounds.SpriteCollection);

            spriteManager.FirstDraw = false;

            base.Initialize();
        }
Ejemplo n.º 5
0
        protected override void InitializeSprites()
        {
            Metronome = new Metronome(GameBase.Instance, editor);
            tapWindow = Metronome.TapWindow;

            //Beat Sync EditorControl

            spriteManagerCentre.Add(
                new pSprite(TextureManager.Load(@"editor-timing-window-bg", SkinSource.Osu), Fields.TopLeft, Origins.TopLeft,
                            Clocks.Game, new Vector2(120, 85), 0, true, Color.White,
                            EditorModes.Timing));

            int timingOffset       = 120;
            int timingOffsetChange = 30;

            //BPM Control
            spriteManagerCentre.Add(
                new pSprite(TextureManager.Load(@"editor-beat-selector-back", SkinSource.Osu), Fields.TopLeft,
                            Origins.TopLeft,
                            Clocks.Game, new Vector2(258, timingOffset), 0.2F, true,
                            Color.White,
                            EditorModes.Timing));


            pSprite p =
                new pSprite(TextureManager.Load(@"editor-beat-selector-buttonleft", SkinSource.Osu), Fields.TopLeft,
                            Origins.Centre,
                            Clocks.Game, new Vector2(270, timingOffset + 10), 0.9f, true,
                            Color.White, EditorModes.Timing);

            p.HandleInput = true;
            p.HoverEffect = new Transformation(Color.White, Color.Orange, 0, 140);
            p.ClickEffect = new Transformation(TransformationType.Scale, 1.2F, 1, 0, 200);
            p.ToolTip     =
                LocalisationManager.GetString(OsuString.Editor_Timing_DecreaseBPM) + "\n" +
                LocalisationManager.GetString(OsuString.EditorModeTiming_HoldShiftForLargerChanges) + "\n" +
                LocalisationManager.GetString(OsuString.EditorModeTiming_HoldCtrlForSmallerChanges);
            p.OnClick += bpmDown_OnClick;
            spriteManagerCentre.Add(p);

            p =
                new pSprite(TextureManager.Load(@"editor-beat-selector-buttonright", SkinSource.Osu), Fields.TopLeft,
                            Origins.Centre,
                            Clocks.Game, new Vector2(382, timingOffset + 10), 0.9f, true,
                            Color.White, EditorModes.Timing);
            p.HandleInput = true;
            p.ClickEffect = new Transformation(TransformationType.Scale, 1.2F, 1, 0, 200);
            p.HoverEffect = new Transformation(Color.White, Color.Orange, 0, 140);
            p.ToolTip     =
                LocalisationManager.GetString(OsuString.Editor_Timing_IncreaseBPM) + "\n" +
                LocalisationManager.GetString(OsuString.EditorModeTiming_HoldShiftForLargerChanges) + "\n" +
                LocalisationManager.GetString(OsuString.EditorModeTiming_HoldCtrlForSmallerChanges);
            p.OnClick += bpmUp_OnClick;
            spriteManagerCentre.Add(p);


            beatBpmDisplay =
                new pText(string.Empty, 14, new Vector2(324, timingOffset + 10), 0.9f, true, Color.White);
            beatBpmDisplay.Tag         = EditorModes.Timing;
            beatBpmDisplay.Origin      = Origins.Centre;
            beatBpmDisplay.HandleInput = true;
            beatBpmDisplay.HoverEffect = new Transformation(Color.White, Color.YellowGreen, 0, 200);
            beatBpmDisplay.OnClick    += delegate { ShowTimingWindow(TimingFocus.BPM, false); };
            beatBpmDisplay.ToolTip     = LocalisationManager.GetString(OsuString.EditorModeTiming_ClickToFineTuneTooltip);
            spriteManagerCentre.Add(beatBpmDisplay);

            pText pt = new pText(@"BPM:", 14, new Vector2(155, timingOffset + 3), 0.9f, true, Color.White);

            pt.TextAlignment = TextAlignment.Right;
            pt.TextBounds    = new Vector2(100, 20);
            pt.Tag           = EditorModes.Timing;
            spriteManagerCentre.Add(pt);

            timingOffset += timingOffsetChange;

            timingText =
                new pText(LocalisationManager.GetString(OsuString.EditorModeTiming_TimingMenuNote), 14,
                          new Vector2(145, timingOffset), 0.9f, true, Color.White);
            timingText.Tag = EditorModes.Timing;
            spriteManagerCentre.Add(timingText);

            timingOffset += (int)(timingOffsetChange * 1.2);

            //Offset Control
            spriteManagerCentre.Add(
                new pSprite(TextureManager.Load(@"editor-beat-selector-back", SkinSource.Osu), Fields.TopLeft,
                            Origins.TopLeft,
                            Clocks.Game, new Vector2(258, timingOffset), 0.2F, true,
                            Color.White,
                            EditorModes.Timing));

            p =
                new pSprite(TextureManager.Load(@"editor-beat-selector-buttonleft", SkinSource.Osu), Fields.TopLeft,
                            Origins.Centre,
                            Clocks.Game, new Vector2(270, timingOffset + 10), 0.9f, true,
                            Color.White, EditorModes.Timing);
            p.HandleInput = true;
            p.ClickEffect = new Transformation(TransformationType.Scale, 1.2F, 1, 0, 200);
            p.OnClick    += offsetLeft_OnClick;
            p.HoverEffect = new Transformation(Color.White, Color.Orange, 0, 140);
            p.ToolTip     =
                LocalisationManager.GetString(OsuString.General_DecreaseOffset) + "\n" +
                LocalisationManager.GetString(OsuString.EditorModeTiming_HoldShiftForLargerChanges) + "\n" +
                LocalisationManager.GetString(OsuString.EditorModeTiming_HoldCtrlForSmallerChanges);
            spriteManagerCentre.Add(p);

            p =
                new pSprite(TextureManager.Load(@"editor-beat-selector-buttonright", SkinSource.Osu), Fields.TopLeft,
                            Origins.Centre,
                            Clocks.Game, new Vector2(382, timingOffset + 10), 0.9f, true,
                            Color.White, EditorModes.Timing);
            p.HandleInput = true;
            p.ClickEffect = new Transformation(TransformationType.Scale, 1.2F, 1, 0, 200);
            p.HoverEffect = new Transformation(Color.White, Color.Orange, 0, 140);
            p.ToolTip     =
                LocalisationManager.GetString(OsuString.General_IncreaseOffset) + "\n" +
                LocalisationManager.GetString(OsuString.EditorModeTiming_HoldShiftForLargerChanges) + "\n" +
                LocalisationManager.GetString(OsuString.EditorModeTiming_HoldCtrlForSmallerChanges);
            p.OnClick += offsetRight_OnClick;
            spriteManagerCentre.Add(p);

            beatOffsetDisplay =
                new pText(string.Empty, 14, new Vector2(324, timingOffset + 10), 0.9f, true, Color.White);
            beatOffsetDisplay.Tag         = EditorModes.Timing;
            beatOffsetDisplay.Origin      = Origins.Centre;
            beatOffsetDisplay.HandleInput = true;
            beatOffsetDisplay.HoverEffect = new Transformation(Color.White, Color.YellowGreen, 0, 200);
            beatOffsetDisplay.OnClick    += delegate { ShowTimingWindow(TimingFocus.Offset, false); };
            beatOffsetDisplay.ToolTip     = LocalisationManager.GetString(OsuString.EditorModeTiming_ClickToFineTuneTooltip);
            spriteManagerCentre.Add(beatOffsetDisplay);

            pt = new pText(LocalisationManager.GetString(OsuString.General_Offset) + @":", 14, new Vector2(155, timingOffset + 3), 0.9f, true, Color.White);
            pt.TextAlignment = TextAlignment.Right;
            pt.TextBounds    = new Vector2(100, 20);
            pt.Tag           = EditorModes.Timing;
            spriteManagerCentre.Add(pt);

            p =
                new pSprite(TextureManager.Load(@"editor-timing-manual", SkinSource.Osu), Fields.TopLeft,
                            Origins.Centre,
                            Clocks.Game, new Vector2(455, 146), 0.9f, true,
                            Color.White, EditorModes.Timing);
            p.HandleInput = true;
            p.HoverEffect = new Transformation(TransformationType.Scale, 1, 1.1F, 0, 200);
            p.OnClick    += delegate { ShowTimingWindow(); };
            p.ToolTip     = LocalisationManager.GetString(OsuString.EditorModeTiming_TimingSetupTooltip);
            spriteManagerCentre.Add(p);

            timingOffset += timingOffsetChange;

            checkboxOffsetMove =
                new pCheckbox(LocalisationManager.GetString(OsuString.EditorModeTiming_MoveAlreadyPlacedNotes), new Vector2(145, timingOffset),
                              0.9f, true);
            checkboxOffsetMove.Tooltip =
                LocalisationManager.GetString(OsuString.EditorModeTiming_MoveAlreadyPlacedTooltip);
            foreach (pSprite ps in checkboxOffsetMove.SpriteCollection)
            {
                ps.Tag = EditorModes.Timing;
            }

            spriteManagerCentre.Add(checkboxOffsetMove.SpriteCollection);

            timingOffset += 60;

            //Slider Velocity Control
            pt =
                new pText(LocalisationManager.GetString(OsuString.Editor_Timing_SliderVelocity) + @":", 14, new Vector2(155, timingOffset + 3), 0.9f, true, Color.White);
            pt.TextAlignment = TextAlignment.Right;
            pt.TextBounds    = new Vector2(100, 20);
            pt.Tag           = EditorModes.Timing;
            spriteManagerCentre.Add(pt);

            spriteManagerCentre.Add(
                new pSprite(TextureManager.Load(@"editor-beat-selector-back", SkinSource.Osu), Fields.TopLeft,
                            Origins.TopLeft,
                            Clocks.Game, new Vector2(258, timingOffset), 0.2F, true,
                            Color.White,
                            EditorModes.Timing));

            p =
                new pSprite(TextureManager.Load(@"editor-beat-selector-buttonleft", SkinSource.Osu), Fields.TopLeft,
                            Origins.Centre,
                            Clocks.Game, new Vector2(270, timingOffset + 10), 0.9f, true,
                            Color.White, EditorModes.Timing);
            p.HandleInput = true;
            p.HoverEffect = new Transformation(Color.White, Color.Orange, 0, 140);
            p.ClickEffect = new Transformation(TransformationType.Scale, 1.2F, 1, 0, 200);
            p.OnClick    += sliderVelocityLeft_OnClick;
            spriteManagerCentre.Add(p);

            p =
                new pSprite(TextureManager.Load(@"editor-beat-selector-buttonright", SkinSource.Osu), Fields.TopLeft,
                            Origins.Centre,
                            Clocks.Game, new Vector2(382, timingOffset + 10), 0.9f, true,
                            Color.White, EditorModes.Timing);
            p.HandleInput = true;
            p.HoverEffect = new Transformation(Color.White, Color.Orange, 0, 140);
            p.ClickEffect = new Transformation(TransformationType.Scale, 1.2F, 1, 0, 200);
            p.OnClick    += sliderVelocityRight_OnClick;
            spriteManagerCentre.Add(p);

            sliderVelocityDisplay =
                new pText(string.Empty, 14, new Vector2(324, timingOffset + 10), 0.9f, true, Color.White);
            sliderVelocityDisplay.Tag    = EditorModes.Timing;
            sliderVelocityDisplay.Origin = Origins.Centre;
            spriteManagerCentre.Add(sliderVelocityDisplay);

            timingOffset += timingOffsetChange;

            //Slider Tick Spacing
            pt =
                new pText(LocalisationManager.GetString(OsuString.Editor_Timing_SliderTickRate) + @":", 14, new Vector2(155, timingOffset + 3), 0.9f, true,
                          Color.White);
            pt.TextAlignment = TextAlignment.Right;
            pt.TextBounds    = new Vector2(100, 20);
            pt.Tag           = EditorModes.Timing;
            spriteManagerCentre.Add(pt);

            spriteManagerCentre.Add(
                new pSprite(TextureManager.Load(@"editor-beat-selector-back", SkinSource.Osu), Fields.TopLeft,
                            Origins.TopLeft,
                            Clocks.Game, new Vector2(258, timingOffset), 0.2F, true,
                            Color.White,
                            EditorModes.Timing));

            p =
                new pSprite(TextureManager.Load(@"editor-beat-selector-buttonleft", SkinSource.Osu), Fields.TopLeft,
                            Origins.Centre,
                            Clocks.Game, new Vector2(270, timingOffset + 10), 0.9f, true,
                            Color.White, EditorModes.Timing);
            p.HoverEffect = new Transformation(Color.White, Color.Orange, 0, 140);
            p.HandleInput = true;
            p.ClickEffect = new Transformation(TransformationType.Scale, 1.2F, 1, 0, 200);
            p.OnClick    += sliderTickLeft_OnClick;
            spriteManagerCentre.Add(p);

            p =
                new pSprite(TextureManager.Load(@"editor-beat-selector-buttonright", SkinSource.Osu), Fields.TopLeft,
                            Origins.Centre,
                            Clocks.Game, new Vector2(382, timingOffset + 10), 0.9f, true,
                            Color.White, EditorModes.Timing);
            p.HandleInput = true;
            p.HoverEffect = new Transformation(Color.White, Color.Orange, 0, 140);
            p.ClickEffect = new Transformation(TransformationType.Scale, 1.2F, 1, 0, 200);
            p.OnClick    += sliderTickRight_OnClick;
            spriteManagerCentre.Add(p);

            sliderTickDisplay =
                new pText(string.Empty, 14, new Vector2(324, timingOffset + 10), 0.9f, true, Color.White);
            sliderTickDisplay.Tag    = EditorModes.Timing;
            sliderTickDisplay.Origin = Origins.Centre;
            spriteManagerCentre.Add(sliderTickDisplay);

            beatDisplay =
                new pText(string.Empty, 13, new Vector2(200, 20), 1, true, Color.White);
            beatDisplay.Field  = Fields.TopRight;
            beatDisplay.Origin = Origins.TopRight;
            beatDisplay.Tag    = EditorModes.Timing;
            spriteManager.Add(beatDisplay);
        }
Ejemplo n.º 6
0
        public RankingDialog(Ranking ranking)
            : base("", true)
        {
            score = ranking.score;

            int recordingStartTime = GameBase.Time;

            highScorePosition = ScoreManager.InsertScore(score, true, true);

            if (ConfigManager.sUsername.Length > 0)
            {
                string url = "http://osu.ppy.sh/rating/ingame-rate.php?u=" + ConfigManager.sUsername + "&p=" +
                             ConfigManager.sPassword + "&c=" + BeatmapManager.Current.BeatmapChecksum;
                StringNetRequest request = new StringNetRequest(url);
                request.onFinish += checkRatingAvailable;
                NetManager.AddRequest(request);
            }

            vspacing = 20;
            if (highScorePosition > -1)
            {
                pSprite p =
                    new pText("You achieved the #" + highScorePosition + " local score!", 22, new Vector2(320, vspacing),
                              1F,
                              true, Color.YellowGreen);
                p.OriginType = OriginTypes.Centre;
                Transformation t =
                    new Transformation(TransformationType.Fade, 0, 1, recordingStartTime + 300, recordingStartTime + 400);
                p.Transformations.Add(t);
                SpriteCollection.Add(p);

                vspacing += 25;

                p =
                    new pText("Please enter your name:", 18, new Vector2(320, vspacing), 1F, true,
                              Color.TransparentWhite);
                p.OriginType = OriginTypes.Centre;
                t            =
                    new Transformation(TransformationType.Fade, 0, 1, recordingStartTime + 300, recordingStartTime + 400);
                p.Transformations.Add(t);
                SpriteCollection.Add(p);

                vspacing += 18;

                p =
                    new pSprite(GameBase.WhitePixel, FieldTypes.Window, OriginTypes.TopLeft, ClockTypes.Game,
                                new Vector2(120, vspacing), 0.94F, true, new Color(80, 80, 80, 150));
                p.UseVectorScale = true;
                p.VectorScale    = new Vector2(640, 40);
                SpriteCollection.Add(p);

                recordingEntry =
                    new pText(ConfigManager.sUsername, 22, new Vector2(120, vspacing), new Vector2(400, 40), 0.95f, true,
                              Color.TransparentWhite, false);
                recordingEntry.TextAlignment = Alignment.Centre;
                SpriteCollection.Add(recordingEntry);

                vspacing += 30;

                saveReplay =
                    new pCheckbox(null, "Save local replay", new Vector2(140, vspacing), 0.95f,
                                  ConfigManager.sSaveReplay);
                SpriteCollection.AddRange(saveReplay.SpriteCollection);

                exportReplay = new pCheckbox(null, "Export replay as .osr", new Vector2(400, vspacing), 0.95f, false);
                SpriteCollection.AddRange(exportReplay.SpriteCollection);

                vspacing += 30;
            }
            else
            {
                pSprite p =
                    new pText("You failed to rank on the local charts!  Better luck next time.", 22,
                              new Vector2(320, vspacing),
                              1F,
                              true, Color.OrangeRed);
                p.OriginType = OriginTypes.Centre;
                SpriteCollection.Add(p);

                vspacing += 80;
            }

            OnlineRetrival = BeatmapManager.Current.submissionStatus == SubmissionStatus.Ranked &&
                             ConfigManager.sUsername.Length > 0;
            if (OnlineRetrival)
            {
                onlineRanking =
                    new pText("Retrieving online ranking statistics...", 22, new Vector2(0, vspacing),
                              new Vector2(640, 80), 1, true, Color.TransparentWhite,
                              false);
                onlineRanking.TextAlignment = Alignment.Centre;
                SpriteCollection.Add(onlineRanking);

                vspacing += 40;

                onlineRanking2 =
                    new pText("", 22, new Vector2(0, vspacing),
                              new Vector2(640, 80), 1, true, Color.TransparentWhite,
                              false);
                onlineRanking2.TextAlignment = Alignment.Centre;
                SpriteCollection.Add(onlineRanking2);

                if (score.submitting)
                {
                    score.SubmissionComplete += score_SubmissionComplete;
                }
                else
                {
                    score_SubmissionComplete(score);
                }

                vspacing += 40;
                GameBase.User.DrawAt(new Vector2(240, vspacing), false, 0);
                GameBase.User.Sprites[0].IsClickable = false;
                SpriteCollection.AddRange(GameBase.User.Sprites);
                vspacing += 65;
            }

            ratingText =
                new pText("Checking rating status...", 22, new Vector2(0, 340), new Vector2(640, 80), 0.98F, true,
                          Color.TransparentWhite, false);
            ratingText.TextAlignment = Alignment.Centre;
            SpriteCollection.Add(ratingText);

            pText pt =
                new pText("Close", 20, new Vector2(320, 440), Vector2.Zero, 0.96F, true, Color.Black, false);

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

            pSprite pb =
                new pSprite(SkinManager.Load("menu-button-background"), FieldTypes.Window,
                            OriginTypes.Centre,
                            ClockTypes.Game,
                            new Vector2(320, 440), 0.95F, true, Color.White);

            pb.OnClick      += closeWindow;
            pb.CurrentScale  = 0.7F;
            pb.CurrentColour = new Color(0, 0, 0, 178);
            pb.IsClickable   = true;
            pb.HoverEffect   = new Transformation(Color.White, Color.PeachPuff, 0, 50);
            SpriteCollection.Add(pb);

            int offset = 55;

            for (int i = 0; i < 10; i++)
            {
                star[i] =
                    new pSprite(ranking.content.Load <Texture2D>("star"), FieldTypes.Window, OriginTypes.Centre,
                                ClockTypes.Game, new Vector2(160 + 32 * i, ratingText.CurrentPosition.Y + offset),
                                0.97F, true, Color.Black);
                star[i].TagNumeric = i + 1;

                SpriteCollection.Add(star[i]);
            }
        }
Ejemplo n.º 7
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;
        }
        internal OptionsManiaBindingWizard()
            : base(LocalisationManager.GetString(OsuString.Options_TabSkin_CustonKey), false)
        {
            SkinManager.CreateUserSkin();

            spriteManager.HandleOverlayInput = true;
            BackButton back = new BackButton(delegate { Close(); }, false, true);

            spriteManager.Add(back.SpriteCollection);

            int horizontal  = 225 + (int)GameBase.WindowManager.OffsetXScaled;
            int vertCurrent = 80;
            int vertSpacing = 35;

            dKeyConfig = new pDropdown(spriteManager, String.Empty, new Vector2(horizontal + 10, vertCurrent), 75, 1);

            for (int i = 1; i <= StageMania.MAX_COLUMNS; incrementKeyConfig(ref i))
            {
                dKeyConfig.AddOption(getKeyOptionText(i, i >= 10), i);
            }

            dKeyConfig.OnSelect += (obj, ev) =>
            {
                currentKeyConfig = (int)obj;

                cBindAlternateKeys.SetStatusQuietly(false);

                LoadKeys(true);
            };

            cSplitLayout = new pCheckbox(LocalisationManager.GetString(OsuString.Options_TabSkin_SplitLayout), new Vector2(horizontal + 105, vertCurrent), 0.8F, false);
            cSplitLayout.OnCheckChanged += (obj, bl) =>
            {
                LoadKeys();
            };
            spriteManager.Add(cSplitLayout.SpriteCollection);

            vertCurrent = 300;

            dSpecialStyle = new pDropdown(spriteManager, string.Empty, new Vector2(horizontal - 65, vertCurrent), 150, 0.8f, false);
            dSpecialStyle.AddOption(LocalisationManager.GetString(OsuString.Options_ManiaSpecial_Normal), 0);
            dSpecialStyle.AddOption(LocalisationManager.GetString(OsuString.Options_ManiaSpecial_Left), 1);
            dSpecialStyle.AddOption(LocalisationManager.GetString(OsuString.Options_ManiaSpecial_Right), 2);
            dSpecialStyle.OnSelect += (obj, ev) =>
            {
                switch ((int)obj)
                {
                case 1:
                    stage.Skin.SpecialStyle = ManiaSpecialStyle.Left;
                    break;

                case 2:
                    stage.Skin.SpecialStyle = ManiaSpecialStyle.Right;
                    break;

                default:
                    stage.Skin.SpecialStyle = ManiaSpecialStyle.None;
                    break;
                }
                SkinManager.SaveSkin();

                LoadKeys();
            };

            cBindAlternateKeys = new pCheckbox(LocalisationManager.GetString(OsuString.Options_TabSkin_BindAlternateSpecialKeys), new Vector2(horizontal + 105, vertCurrent), 0.8F, false);
            cBindAlternateKeys.OnCheckChanged += (obj, bl) =>
            {
                LoadKeys();
            };
            spriteManager.Add(cBindAlternateKeys.SpriteCollection);

            vertCurrent += vertSpacing;

            cUpsideDown = new pCheckbox(LocalisationManager.GetString(OsuString.Options_TabSkin_UpsiedDown), new Vector2(horizontal, vertCurrent), 0.8F, false);
            cUpsideDown.OnCheckChanged += (obj, bl) =>
            {
                stage.Skin.UpsideDown = bl;
                SkinManager.SaveSkin();
            };
            spriteManager.Add(cUpsideDown.SpriteCollection);

            vertCurrent += vertSpacing;

            cJudgementLine = new pCheckbox(LocalisationManager.GetString(OsuString.Options_TabSkin_ShowJudgement), new Vector2(horizontal, vertCurrent), 0.8F, false);
            cJudgementLine.OnCheckChanged += (obj, bl) =>
            {
                stage.Skin.JudgementLine = bl;
                SkinManager.SaveSkin();
            };

            spriteManager.Add(cJudgementLine.SpriteCollection);

            dKeyConfig.SetSelected(currentKeyConfig, false);
        }
Ejemplo n.º 9
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;
        }
Ejemplo n.º 10
0
        private void InitializeCommentSystem()
        {
            commentBackgroundTop = new pSprite(TextureManager.Load(@"commentbox", SkinSource.Osu), Fields.TopRight,
                                               Origins.TopRight,
                                               Clocks.Game,
                                               new Vector2(70, buttonComments.Position.Y - 24), 0.95f, true, Color.TransparentWhite, "play");
            commentBackgroundTop.DrawHeight = 52;
            commentBoxSprites.Add(commentBackgroundTop);
            spriteManager.Add(commentBackgroundTop);

            commentBackgroundMiddle = new pSprite(TextureManager.Load(@"commentbox", SkinSource.Osu), Fields.TopRight,
                                                  Origins.TopRight,
                                                  Clocks.Game,
                                                  new Vector2(70, buttonComments.Position.Y - 24), 0.95f, true, Color.TransparentWhite, "play");
            commentBackgroundMiddle.DrawHeight  = 1;
            commentBackgroundMiddle.DrawTop     = 52;
            commentBackgroundMiddle.VectorScale = new Vector2(1, 0);
            commentBackgroundMiddle.Position.Y += 52 * 0.625f;
            commentBoxSprites.Add(commentBackgroundMiddle);
            spriteManager.Add(commentBackgroundMiddle);

            commentBackgroundBottom = new pSprite(TextureManager.Load(@"commentbox", SkinSource.Osu), Fields.TopRight,
                                                  Origins.TopRight,
                                                  Clocks.Game,
                                                  new Vector2(70, buttonComments.Position.Y - 24 + 52 * 0.625f), 0.95f, true, Color.TransparentWhite, "play");
            commentBackgroundBottom.DrawHeight = 49;
            commentBackgroundBottom.DrawTop    = 53;
            commentBoxSprites.Add(commentBackgroundBottom);
            spriteManager.Add(commentBackgroundBottom);

            float     width   = commentBackgroundTop.DrawWidth * 0.625f;
            const int padding = 6;

            commentInputTextbox = new pTextBox(DEFAULT_MESSAGE, 12, new Vector2(commentBackgroundTop.CurrentPositionActual.X - width + padding, commentBackgroundTop.Position.Y + 17 + padding), width - padding * 4, 1);

            commentInputTextbox.BackgroundUnfocused = new Color(51, 197, 234, 150);
            commentInputTextbox.Box.Alpha           = 0;
            commentInputTextbox.Box.BorderWidth     = 0;
            commentInputTextbox.OnGotFocus         += textBox_OnGotFocus;
            commentInputTextbox.CommitOnLeave       = false;
            commentInputTextbox.OnCommit           += textBox_OnCommit;
            commentInputTextbox.LengthLimit         = 80;
            commentInputTextbox.OnChange           += new pTextBox.OnCommitHandler(commentInputTextbox_OnChange);
            commentBoxSprites.AddRange(commentInputTextbox.SpriteCollection);
            spriteManager.Add(commentInputTextbox.SpriteCollection);

            cMap = new pCheckbox("Difficulty", 0.7f, new Vector2(commentBackgroundTop.CurrentPositionActual.X - 250, commentBackgroundTop.CurrentPositionActual.Y + 5), 1, false);
            spriteManager.Add(cMap.SpriteCollection);

            cMap.OnCheckChanged += new CheckboxCallbackDelegate(choice_OnCheckChanged);
            cMap.Hide(true);
            cMap.Tooltip = "Comment on this particular difficulty";
            commentBoxSprites.AddRange(cMap.SpriteCollection);
            spriteManager.Add(cMap.SpriteCollection);

            cSong = new pCheckbox("Song", 0.7f, new Vector2(commentBackgroundTop.CurrentPositionActual.X - 170, commentBackgroundTop.CurrentPositionActual.Y + 5), 1, false);
            spriteManager.Add(cSong.SpriteCollection);

            cSong.OnCheckChanged += new CheckboxCallbackDelegate(choice_OnCheckChanged);
            cSong.Tooltip         = "Comment on this collection of beatmaps or the song";
            cSong.Hide(true);
            commentBoxSprites.AddRange(cSong.SpriteCollection);
            spriteManager.Add(cSong.SpriteCollection);

            cReplay = new pCheckbox("Player", 0.7f, new Vector2(commentBackgroundTop.CurrentPositionActual.X - 90, commentBackgroundTop.CurrentPositionActual.Y + 5), 1, false);
            spriteManager.Add(cReplay.SpriteCollection);

            cReplay.Tooltip         = "Comment on the current replay (the specific person playing)";
            cReplay.OnCheckChanged += new CheckboxCallbackDelegate(choice_OnCheckChanged);
            cReplay.Hide(true);

            if (InputManager.ReplayScore.IsOnline)
            {
                commentBoxSprites.AddRange(cReplay.SpriteCollection);
                spriteManager.Add(cReplay.SpriteCollection);
            }

            originalCheckboxPosition = new Vector2(commentBackgroundBottom.CurrentPositionActual.X - 250, commentBackgroundBottom.CurrentPositionActual.Y + 5);
            showCommentsCheckbox     = new pCheckbox("Show Comments", 0.7f, originalCheckboxPosition, 1, ConfigManager.sShowReplayComments);
            spriteManager.Add(showCommentsCheckbox.SpriteCollection);

            showCommentsCheckbox.OnCheckChanged += showComments_OnCheckChanged;
            showCommentsCheckbox.Hide(true);
            commentBoxSprites.AddRange(showCommentsCheckbox.SpriteCollection);
            spriteManager.Add(showCommentsCheckbox.SpriteCollection);

            commentColourPicker             = new pSprite(GameBase.WhitePixel, Fields.TopLeft, Origins.TopLeft, Clocks.Game, originalCheckboxPosition + new Vector2(124, 1), 0.96f, true, Color.TransparentWhite);
            commentColourPicker.Alpha       = 0;
            commentColourPicker.VectorScale = new Vector2(20, 20);
            commentColourPicker.HandleInput = true;
            commentColourPicker.OnClick    += (obj, ev) =>
            {
                if (GameBase.IsFullscreen)
                {
                    NotificationManager.ShowMessage("Exit fullscreen mode to use the colour pick feature.", Color.Red, 2000);
                    return;
                }

                if (!Player.Paused && !InputManager.ReplayStreaming)
                {
                    AudioEngine.TogglePause();
                    Player.Paused   = true;
                    commitStartTime = AudioEngine.Time;
                }

                ColorDialog cd = new ColorDialog();
                if (cd.ShowDialog(GameBase.Form) == DialogResult.OK)
                {
                    commentColourPicker.InitialColour = new Color(cd.Color.R, cd.Color.G, cd.Color.B);
                }
                if (!InputManager.ReplayStreaming)
                {
                    AudioEngine.TogglePause();
                    Player.Paused = false;
                }
            };

            if (GameBase.User != null && (GameBase.User.Permission & Permissions.Supporter) > 0)
            {
                commentBoxSprites.Add(commentColourPicker);
                spriteManager.Add(commentColourPicker);
                pText pt = new pText("Colour", 15 * 0.7f, originalCheckboxPosition + new Vector2(94, 2), 0.96f, true, Color.TransparentWhite);
                commentBoxSprites.Add(pt);
                spriteManager.Add(pt);
            }
            if (ConfigManager.sShowReplayComments)
            {
                RequestComments();
            }
        }
Ejemplo n.º 11
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);
        }
Ejemplo n.º 12
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();
        }