mirror of
https://github.com/osukey/osukey.git
synced 2025-08-04 07:06:35 +09:00
Fix incorrect initial migration
Also adds variant to settings
This commit is contained in:
@ -17,12 +17,12 @@ namespace osu.Game.Configuration
|
||||
|
||||
private readonly RulesetInfo ruleset;
|
||||
|
||||
protected DatabasedConfigManager(SettingsStore settings, RulesetInfo ruleset = null)
|
||||
protected DatabasedConfigManager(SettingsStore settings, RulesetInfo ruleset = null, int variant = 0)
|
||||
{
|
||||
this.settings = settings;
|
||||
this.ruleset = ruleset;
|
||||
|
||||
databasedSettings = settings.Query(ruleset?.ID);
|
||||
databasedSettings = settings.Query(ruleset?.ID, variant);
|
||||
|
||||
InitialiseDefaults();
|
||||
}
|
||||
|
@ -14,6 +14,8 @@ namespace osu.Game.Configuration
|
||||
|
||||
public int? RulesetID { get; set; }
|
||||
|
||||
public int? Variant { get; set; }
|
||||
|
||||
[Column("Key")]
|
||||
public int IntKey
|
||||
{
|
||||
|
@ -23,8 +23,8 @@ namespace osu.Game.Configuration
|
||||
/// <param name="rulesetId">The ruleset's internal ID.</param>
|
||||
/// <param name="variant">An optional variant.</param>
|
||||
/// <returns></returns>
|
||||
public List<DatabasedSetting> Query(int? rulesetId = null) =>
|
||||
GetContext().DatabasedSetting.Where(b => b.RulesetID == rulesetId).ToList();
|
||||
public List<DatabasedSetting> Query(int? rulesetId = null, int? variant = null) =>
|
||||
GetContext().DatabasedSetting.Where(b => b.RulesetID == rulesetId && b.Variant == variant).ToList();
|
||||
|
||||
public void Update(DatabasedSetting setting)
|
||||
{
|
||||
|
Reference in New Issue
Block a user