mirror of
https://github.com/ppy/osu.git
synced 2025-03-28 09:37:23 +08:00
Remove bindable-disabling logic and don't tie immediately to CreateRuleset()
This commit is contained in:
parent
bbad70c3f0
commit
c72592c52c
@ -72,22 +72,7 @@ namespace osu.Game.Tests.Visual
|
|||||||
Beatmap.SetDefault();
|
Beatmap.SetDefault();
|
||||||
|
|
||||||
Ruleset = Dependencies.Ruleset;
|
Ruleset = Dependencies.Ruleset;
|
||||||
|
Ruleset.SetDefault();
|
||||||
var definedRuleset = CreateRuleset()?.RulesetInfo;
|
|
||||||
|
|
||||||
if (definedRuleset != null)
|
|
||||||
{
|
|
||||||
// re-enable the bindable in case it was disabled.
|
|
||||||
// happens when restarting current test scene.
|
|
||||||
Ruleset.Disabled = false;
|
|
||||||
|
|
||||||
// Set global ruleset bindable to the ruleset defined
|
|
||||||
// for this test scene and disallow changing it.
|
|
||||||
Ruleset.Value = definedRuleset;
|
|
||||||
Ruleset.Disabled = true;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
Ruleset.SetDefault();
|
|
||||||
|
|
||||||
SelectedMods = Dependencies.Mods;
|
SelectedMods = Dependencies.Mods;
|
||||||
SelectedMods.SetDefault();
|
SelectedMods.SetDefault();
|
||||||
@ -145,7 +130,7 @@ namespace osu.Game.Tests.Visual
|
|||||||
/// Creates the ruleset to be used for this test scene.
|
/// Creates the ruleset to be used for this test scene.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <remarks>
|
/// <remarks>
|
||||||
/// When testing against ruleset-specific components, this method must be overriden to their ruleset.
|
/// When testing against ruleset-specific components, this method must be overriden to their corresponding ruleset.
|
||||||
/// </remarks>
|
/// </remarks>
|
||||||
[CanBeNull]
|
[CanBeNull]
|
||||||
protected virtual Ruleset CreateRuleset() => null;
|
protected virtual Ruleset CreateRuleset() => null;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user