mirror of
https://github.com/ppy/osu.git
synced 2025-02-08 09:42:55 +08:00
See https://github.com/ppy/osu/issues/29720, https://discord.com/channels/188630481301012481/188630652340404224/1334294048541904906. This removes the tooltip due to being zero or negative information, and also changes the description of the setting to not contain the word "mirror", which will hopefully quash the "this is where I would place a mirror to my screen to achieve what I want" interpretation which seems to be a minority interpretation. The first time this was complained about I figured this was probably a one guy issue, but now it's happened twice, and I never want to see this conversation again.
52 lines
1.7 KiB
C#
52 lines
1.7 KiB
C#
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
|
// See the LICENCE file in the repository root for full licence text.
|
|
|
|
using System;
|
|
using osu.Framework.Bindables;
|
|
using osu.Framework.Localisation;
|
|
using osu.Game.Configuration;
|
|
using osu.Game.Rulesets.Mods;
|
|
using osu.Game.Rulesets.Objects;
|
|
using osu.Game.Rulesets.Osu.Objects;
|
|
using osu.Game.Rulesets.Osu.Utils;
|
|
|
|
namespace osu.Game.Rulesets.Osu.Mods
|
|
{
|
|
public class OsuModMirror : ModMirror, IApplicableToHitObject
|
|
{
|
|
public override LocalisableString Description => "Flip objects on the chosen axes.";
|
|
public override Type[] IncompatibleMods => new[] { typeof(ModHardRock) };
|
|
|
|
[SettingSource("Flipped axes")]
|
|
public Bindable<MirrorType> Reflection { get; } = new Bindable<MirrorType>();
|
|
|
|
public void ApplyToHitObject(HitObject hitObject)
|
|
{
|
|
var osuObject = (OsuHitObject)hitObject;
|
|
|
|
switch (Reflection.Value)
|
|
{
|
|
case MirrorType.Horizontal:
|
|
OsuHitObjectGenerationUtils.ReflectHorizontallyAlongPlayfield(osuObject);
|
|
break;
|
|
|
|
case MirrorType.Vertical:
|
|
OsuHitObjectGenerationUtils.ReflectVerticallyAlongPlayfield(osuObject);
|
|
break;
|
|
|
|
case MirrorType.Both:
|
|
OsuHitObjectGenerationUtils.ReflectHorizontallyAlongPlayfield(osuObject);
|
|
OsuHitObjectGenerationUtils.ReflectVerticallyAlongPlayfield(osuObject);
|
|
break;
|
|
}
|
|
}
|
|
|
|
public enum MirrorType
|
|
{
|
|
Horizontal,
|
|
Vertical,
|
|
Both
|
|
}
|
|
}
|
|
}
|