mirror of
https://github.com/ppy/osu.git
synced 2025-01-26 16:12:54 +08:00
Re-implement config value.
This commit is contained in:
parent
0a1376c2db
commit
6dbc75283c
@ -17,6 +17,8 @@ namespace osu.Game.Configuration
|
||||
Set(OsuConfig.Username, string.Empty);
|
||||
Set(OsuConfig.Token, string.Empty);
|
||||
|
||||
Set(OsuConfig.Ruleset, 0, 0, int.MaxValue);
|
||||
|
||||
Set(OsuConfig.AudioDevice, string.Empty);
|
||||
Set(OsuConfig.SavePassword, false);
|
||||
Set(OsuConfig.SaveUsername, true);
|
||||
|
@ -4,6 +4,7 @@
|
||||
using System;
|
||||
using System.Collections.Concurrent;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
namespace osu.Game.Modes
|
||||
{
|
||||
@ -31,6 +32,8 @@ namespace osu.Game.Modes
|
||||
return ruleset;
|
||||
}
|
||||
|
||||
public static int GetId(Ruleset ruleset) => available_rulesets.First(kvp => kvp.Value == ruleset).Key;
|
||||
|
||||
public static IEnumerable<Ruleset> AllRulesets => available_rulesets.Values;
|
||||
}
|
||||
}
|
||||
|
@ -58,7 +58,8 @@ namespace osu.Game
|
||||
|
||||
private VolumeControl volume;
|
||||
|
||||
public Bindable<Ruleset> Ruleset;
|
||||
private Bindable<int> configRuleset;
|
||||
public Bindable<Ruleset> Ruleset = new Bindable<Ruleset>();
|
||||
|
||||
private readonly string[] args;
|
||||
|
||||
@ -88,8 +89,9 @@ namespace osu.Game
|
||||
|
||||
Dependencies.Cache(this);
|
||||
|
||||
// Todo: I don't think this'll work, need BindableRuleset
|
||||
Ruleset = new Bindable<Ruleset>();
|
||||
configRuleset = LocalConfig.GetBindable<int>(OsuConfig.Ruleset);
|
||||
Ruleset.Value = RulesetCollection.GetRuleset(configRuleset.Value);
|
||||
Ruleset.ValueChanged += r => configRuleset.Value = RulesetCollection.GetId(r);
|
||||
}
|
||||
|
||||
private ScheduledDelegate scoreLoad;
|
||||
|
Loading…
Reference in New Issue
Block a user