-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into audio-adjustment-breakage-alt
- Loading branch information
Showing
82 changed files
with
1,760 additions
and
3,674 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
// 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 NUnit.Framework; | ||
using osu.Game.Rulesets.Mods; | ||
using osu.Game.Rulesets.Osu.Mods; | ||
|
||
namespace osu.Game.Tests.Mods | ||
{ | ||
public class ModSettingsTest | ||
{ | ||
[Test] | ||
public void TestModSettingsUnboundWhenCopied() | ||
{ | ||
var original = new OsuModDoubleTime(); | ||
var copy = (OsuModDoubleTime)original.DeepClone(); | ||
|
||
original.SpeedChange.Value = 2; | ||
|
||
Assert.That(original.SpeedChange.Value, Is.EqualTo(2.0)); | ||
Assert.That(copy.SpeedChange.Value, Is.EqualTo(1.5)); | ||
} | ||
|
||
[Test] | ||
public void TestMultiModSettingsUnboundWhenCopied() | ||
{ | ||
var original = new MultiMod(new OsuModDoubleTime()); | ||
var copy = (MultiMod)original.DeepClone(); | ||
|
||
((OsuModDoubleTime)original.Mods[0]).SpeedChange.Value = 2; | ||
|
||
Assert.That(((OsuModDoubleTime)original.Mods[0]).SpeedChange.Value, Is.EqualTo(2.0)); | ||
Assert.That(((OsuModDoubleTime)copy.Mods[0]).SpeedChange.Value, Is.EqualTo(1.5)); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
// 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 System.Collections.Generic; | ||
using osu.Framework.Bindables; | ||
using osu.Game.Beatmaps; | ||
using osu.Game.Configuration; | ||
using osu.Game.Rulesets; | ||
using osu.Game.Rulesets.Difficulty; | ||
using osu.Game.Rulesets.Mods; | ||
using osu.Game.Rulesets.UI; | ||
|
||
namespace osu.Game.Tests.Mods | ||
{ | ||
public class TestCustomisableModRuleset : Ruleset | ||
{ | ||
public static RulesetInfo CreateTestRulesetInfo() => new TestCustomisableModRuleset().RulesetInfo; | ||
|
||
public override IEnumerable<Mod> GetModsFor(ModType type) | ||
{ | ||
if (type == ModType.Conversion) | ||
{ | ||
return new Mod[] | ||
{ | ||
new TestModCustomisable1(), | ||
new TestModCustomisable2() | ||
}; | ||
} | ||
|
||
return Array.Empty<Mod>(); | ||
} | ||
|
||
public override DrawableRuleset CreateDrawableRulesetWith(IBeatmap beatmap, IReadOnlyList<Mod> mods = null) => throw new NotImplementedException(); | ||
|
||
public override IBeatmapConverter CreateBeatmapConverter(IBeatmap beatmap) => throw new NotImplementedException(); | ||
|
||
public override DifficultyCalculator CreateDifficultyCalculator(IWorkingBeatmap beatmap) => throw new NotImplementedException(); | ||
|
||
public override string Description { get; } = "test"; | ||
public override string ShortName { get; } = "tst"; | ||
|
||
public class TestModCustomisable1 : TestModCustomisable | ||
{ | ||
public override string Name => "Customisable Mod 1"; | ||
|
||
public override string Acronym => "CM1"; | ||
} | ||
|
||
public class TestModCustomisable2 : TestModCustomisable | ||
{ | ||
public override string Name => "Customisable Mod 2"; | ||
|
||
public override string Acronym => "CM2"; | ||
|
||
public override bool RequiresConfiguration => true; | ||
} | ||
|
||
public abstract class TestModCustomisable : Mod, IApplicableMod | ||
{ | ||
public override double ScoreMultiplier => 1.0; | ||
|
||
public override string Description => "This is a customisable test mod."; | ||
|
||
public override ModType Type => ModType.Conversion; | ||
|
||
[SettingSource("Sample float", "Change something for a mod")] | ||
public BindableFloat SliderBindable { get; } = new BindableFloat | ||
{ | ||
MinValue = 0, | ||
MaxValue = 10, | ||
Default = 5, | ||
Value = 7 | ||
}; | ||
|
||
[SettingSource("Sample bool", "Clicking this changes a setting")] | ||
public BindableBool TickBindable { get; } = new BindableBool(); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.