mirror of
https://github.com/osukey/osukey.git
synced 2025-08-04 23:24:04 +09:00
Retrieve the mania key action through DI
This commit is contained in:
@ -69,7 +69,7 @@ namespace osu.Game.Rulesets.Mania.Tests
|
||||
var obj = new Note { Column = i, StartTime = Time.Current + 2000 };
|
||||
obj.ApplyDefaults(new ControlPointInfo(), new BeatmapDifficulty());
|
||||
|
||||
columns[i].Add(new DrawableNote(obj, columns[i].Action));
|
||||
columns[i].Add(new DrawableNote(obj));
|
||||
}
|
||||
}
|
||||
|
||||
@ -80,7 +80,7 @@ namespace osu.Game.Rulesets.Mania.Tests
|
||||
var obj = new HoldNote { Column = i, StartTime = Time.Current + 2000, Duration = 500 };
|
||||
obj.ApplyDefaults(new ControlPointInfo(), new BeatmapDifficulty());
|
||||
|
||||
columns[i].Add(new DrawableHoldNote(obj, columns[i].Action));
|
||||
columns[i].Add(new DrawableHoldNote(obj));
|
||||
}
|
||||
}
|
||||
|
||||
@ -92,7 +92,7 @@ namespace osu.Game.Rulesets.Mania.Tests
|
||||
Origin = Anchor.Centre,
|
||||
Height = 0.85f,
|
||||
AccentColour = Color4.OrangeRed,
|
||||
Action = action,
|
||||
Action = { Value = action },
|
||||
VisibleTimeRange = { Value = 2000 }
|
||||
};
|
||||
|
||||
|
@ -6,6 +6,7 @@ using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using NUnit.Framework;
|
||||
using osu.Framework.Allocation;
|
||||
using osu.Framework.Configuration;
|
||||
using osu.Framework.Extensions.Color4Extensions;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Containers;
|
||||
@ -63,7 +64,7 @@ namespace osu.Game.Rulesets.Mania.Tests
|
||||
AutoSizeAxes = Axes.Both,
|
||||
Child = new NoteContainer(direction, $"note, scrolling {direction.ToString().ToLower()}")
|
||||
{
|
||||
Child = new DrawableNote(note, ManiaAction.Key1) { AccentColour = Color4.OrangeRed }
|
||||
Child = new DrawableNote(note) { AccentColour = Color4.OrangeRed }
|
||||
}
|
||||
};
|
||||
}
|
||||
@ -78,7 +79,7 @@ namespace osu.Game.Rulesets.Mania.Tests
|
||||
AutoSizeAxes = Axes.Both,
|
||||
Child = new NoteContainer(direction, $"hold note, scrolling {direction.ToString().ToLower()}")
|
||||
{
|
||||
Child = new DrawableHoldNote(note, ManiaAction.Key1)
|
||||
Child = new DrawableHoldNote(note)
|
||||
{
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
AccentColour = Color4.OrangeRed,
|
||||
@ -136,6 +137,13 @@ namespace osu.Game.Rulesets.Mania.Tests
|
||||
};
|
||||
}
|
||||
|
||||
protected override IReadOnlyDependencyContainer CreateLocalDependencies(IReadOnlyDependencyContainer parent)
|
||||
{
|
||||
var dependencies = new DependencyContainer(base.CreateLocalDependencies(parent));
|
||||
dependencies.CacheAs<IBindable<ManiaAction>>(new Bindable<ManiaAction>());
|
||||
return dependencies;
|
||||
}
|
||||
|
||||
protected override void Update()
|
||||
{
|
||||
base.Update();
|
||||
|
@ -65,7 +65,7 @@ namespace osu.Game.Rulesets.Mania.Tests
|
||||
var obj = new Note { Column = i, StartTime = Time.Current + 2000 };
|
||||
obj.ApplyDefaults(new ControlPointInfo(), new BeatmapDifficulty());
|
||||
|
||||
stage.Add(new DrawableNote(obj, stage.Columns[i].Action));
|
||||
stage.Add(new DrawableNote(obj));
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -79,7 +79,7 @@ namespace osu.Game.Rulesets.Mania.Tests
|
||||
var obj = new HoldNote { Column = i, StartTime = Time.Current + 2000, Duration = 500 };
|
||||
obj.ApplyDefaults(new ControlPointInfo(), new BeatmapDifficulty());
|
||||
|
||||
stage.Add(new DrawableHoldNote(obj, stage.Columns[i].Action));
|
||||
stage.Add(new DrawableHoldNote(obj));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user