mirror of
https://github.com/osukey/osukey.git
synced 2025-08-03 14:46:38 +09:00
Give HitRenderer a reference to Ruleset
Used to get correct bindings for a mode (ActionMappingInputManager).
This commit is contained in:
@ -17,12 +17,20 @@ namespace osu.Game.Input
|
||||
public class ActionMappingInputManager<T> : PassThroughInputManager
|
||||
where T : struct
|
||||
{
|
||||
private readonly RulesetInfo ruleset;
|
||||
|
||||
protected ActionMappingInputManager(RulesetInfo ruleset = null)
|
||||
{
|
||||
this.ruleset = ruleset;
|
||||
}
|
||||
|
||||
protected IDictionary<Key, T> Mappings { get; set; }
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
private void load(BindingStore bindings)
|
||||
{
|
||||
foreach (var b in bindings.Query<Binding>())
|
||||
var rulesetId = ruleset?.ID;
|
||||
foreach (var b in bindings.Query<Binding>(b => b.RulesetID == rulesetId))
|
||||
Mappings[b.Key] = (T)(object)b.Action;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user