コード例 #1
0
        public ModSelection(ModSelectionType ms)
            : base(
                "Mods provide different ways to enjoy gameplay.  Some have an effect on the score you can achieve during ranked play.  Others are just for fun.", true)
        {
            this.selectionType = ms;

            Transformation hoverEffect = new Transformation(TransformationType.Scale, 1, 1.2F, 0, 120);

            int spacing = 60;
            int col1    = 238;
            int col2    = 323;
            int col3    = 408;
            int col4    = 493;

            modMultiplier =
                new pText("", 30, new Vector2(320, currentVerticalSpace - 20), Vector2.Zero, 0.94F, true, Color.White, true);
            SpriteCollection.Add(modMultiplier);
            modMultiplier.OriginType = OriginTypes.Centre;

            currentVerticalSpace += modMultiplier.MeasureText().Y + 35;

            pText pt =
                new pText("Difficulty Reduction", 24, new Vector2(20, currentVerticalSpace - 13), Vector2.Zero, 0.94F, true, Color.LimeGreen, true);

            SpriteCollection.Add(pt);

            if (selectionType == ModSelectionType.ServerSide || selectionType == ModSelectionType.All)
            {
                modEasy =
                    new pSprite(SkinManager.Load("selection-mod-easy"), FieldTypes.Window,
                                OriginTypes.Centre,
                                ClockTypes.Game,
                                new Vector2(col1, currentVerticalSpace), 0.94F, true,
                                Color.TransparentWhite, Mods.Easy);
                modEasy.OnClick += modIcon_OnClick;
                modEasy.ToolTip  =
                    "Reduces overall difficulty - larger circles, more forgiving\nHP drain, less accuracy required.";
                modEasy.IsClickable = true;
                modEasy.HoverEffect = hoverEffect;
                SpriteCollection.Add(modEasy);

                modNoFail =
                    new pSprite(SkinManager.Load("selection-mod-nofail"), FieldTypes.Window,
                                OriginTypes.Centre,
                                ClockTypes.Game,
                                new Vector2(col2, currentVerticalSpace), 0.94F, true,
                                Color.TransparentWhite, Mods.NoFail);
                modNoFail.OnClick    += modIcon_OnClick;
                modNoFail.IsClickable = true;
                modNoFail.ToolTip     = "You can't fail.  No matter what.";
                modNoFail.HoverEffect = hoverEffect;
                SpriteCollection.Add(modNoFail);

                modHalfTime =
                    new pSprite(SkinManager.Load("selection-mod-halftime"), FieldTypes.Window,
                                OriginTypes.Centre,
                                ClockTypes.Game,
                                new Vector2(col3, currentVerticalSpace), 0.94F, true,
                                Color.TransparentWhite, Mods.HalfTime);
                modHalfTime.OnClick    += modIcon_OnClick;
                modHalfTime.IsClickable = true;
                modHalfTime.ToolTip     = "Less zoom";
                modHalfTime.HoverEffect = hoverEffect;
                SpriteCollection.Add(modHalfTime);
            }

            currentVerticalSpace += spacing;

            pt =
                new pText("Difficulty Increase", 24, new Vector2(20, currentVerticalSpace - 13), Vector2.Zero, 0.94F, true, Color.OrangeRed, true);
            SpriteCollection.Add(pt);

            if (selectionType == ModSelectionType.ServerSide || selectionType == ModSelectionType.All)
            {
                modHardRock =
                    new pSprite(SkinManager.Load("selection-mod-hardrock"), FieldTypes.Window,
                                OriginTypes.Centre,
                                ClockTypes.Game,
                                new Vector2(col1, currentVerticalSpace), 0.94F, true,
                                Color.TransparentWhite, Mods.HardRock);
                modHardRock.OnClick    += modIcon_OnClick;
                modHardRock.ToolTip     = "Everything just got a bit harder..";
                modHardRock.IsClickable = true;
                modHardRock.HoverEffect = hoverEffect;
                SpriteCollection.Add(modHardRock);

                modSuddenDeath =
                    new pSprite(SkinManager.Load("selection-mod-suddendeath"), FieldTypes.Window,
                                OriginTypes.Centre,
                                ClockTypes.Game,
                                new Vector2(col2, currentVerticalSpace), 0.94F, true,
                                Color.TransparentWhite, Mods.SuddenDeath);
                modSuddenDeath.OnClick    += modIcon_OnClick;
                modSuddenDeath.ToolTip     = "Miss a note and fail.";
                modSuddenDeath.IsClickable = true;
                modSuddenDeath.HoverEffect = hoverEffect;
                SpriteCollection.Add(modSuddenDeath);

                modDoubleTime =
                    new pSprite(SkinManager.Load("selection-mod-doubletime"), FieldTypes.Window,
                                OriginTypes.Centre,
                                ClockTypes.Game,
                                new Vector2(col3, currentVerticalSpace), 0.94F, true,
                                Color.TransparentWhite, Mods.DoubleTime);
                modDoubleTime.OnClick    += modIcon_OnClick;
                modDoubleTime.ToolTip     = "Zoooooooooom";
                modDoubleTime.IsClickable = true;
                modDoubleTime.HoverEffect = hoverEffect;
                SpriteCollection.Add(modDoubleTime);

                modHidden =
                    new pSprite(SkinManager.Load("selection-mod-hidden"), FieldTypes.Window,
                                OriginTypes.Centre,
                                ClockTypes.Game,
                                new Vector2(col4, currentVerticalSpace), 0.94F, true,
                                Color.TransparentWhite, Mods.Hidden);
                modHidden.OnClick    += modIcon_OnClick;
                modHidden.ToolTip     = "Play with no approach circles and fading notes for a slight\nscore advantage.";
                modHidden.IsClickable = true;
                modHidden.HoverEffect = hoverEffect;
                SpriteCollection.Add(modHidden);
            }


            currentVerticalSpace += spacing;

            pt =
                new pText("Special", 24, new Vector2(20, currentVerticalSpace - 13), Vector2.Zero, 0.94F, true, Color.White, true);
            SpriteCollection.Add(pt);

            if (selectionType == ModSelectionType.ClientSide || selectionType == ModSelectionType.All)
            {
                modNoVideo =
                    new pSprite(SkinManager.Load("selection-mod-novideo"), FieldTypes.Window,
                                OriginTypes.Centre,
                                ClockTypes.Game,
                                new Vector2(col1, currentVerticalSpace), 0.94F, true,
                                Color.TransparentWhite, Mods.NoVideo);
                modNoVideo.OnClick    += modIcon_OnClick;
                modNoVideo.ToolTip     = "A handy mod to disable video temporarily when required.";
                modNoVideo.IsClickable = true;
                modNoVideo.HoverEffect = hoverEffect;
                SpriteCollection.Add(modNoVideo);
            }

            if (selectionType == ModSelectionType.ServerSide || selectionType == ModSelectionType.All)
            {
                modRelax =
                    new pSprite(SkinManager.Load("selection-mod-relax"), FieldTypes.Window,
                                OriginTypes.Centre,
                                ClockTypes.Game,
                                new Vector2(col2, currentVerticalSpace), 0.94F, true,
                                Color.TransparentWhite, Mods.Relax);
                modRelax.OnClick    += modIcon_OnClick;
                modRelax.ToolTip     = "You don't need to click.  No scoring at all.\nTake a break from the heat of things.\n***THIS IS AN UNRANKED MODE***";
                modRelax.IsClickable = true;
                modRelax.HoverEffect = hoverEffect;
                SpriteCollection.Add(modRelax);

                modTaiko =
                    new pSprite(SkinManager.Load("selection-mod-taiko"), FieldTypes.Window,
                                OriginTypes.Centre,
                                ClockTypes.Game,
                                new Vector2(col3, currentVerticalSpace), 0.94F, true,
                                Color.TransparentWhite, Mods.Taiko);
                modTaiko.OnClick    += modIcon_OnClick;
                modTaiko.ToolTip     = "Drums take over the osu!\n***THIS IS AN UNRANKED MODE***";
                modTaiko.IsClickable = true;
                modTaiko.HoverEffect = hoverEffect;
                SpriteCollection.Add(modTaiko);
            }

            currentVerticalSpace += spacing;

            AddOption("Reset All Mods", Color.OrangeRed, clearAll, false);

            AddOption("Close", Color.Gray, closeWindow);



            Display();

            SetMods();
        }