mirror of
https://github.com/ppy/osu.git
synced 2025-02-13 10:33:07 +08:00
Review changes
This commit is contained in:
parent
802a6870c4
commit
6d9e78a3a3
@ -26,12 +26,10 @@ namespace osu.Game.Rulesets.Osu.Mods
|
||||
|
||||
private void applyMod()
|
||||
{
|
||||
if (increaseFirstObjectVisibility)
|
||||
{
|
||||
foreach (var d in drawables.OfType<DrawableOsuHitObject>())
|
||||
{
|
||||
//Don't hide the first object
|
||||
if (d.ChildID == 1) continue;
|
||||
if (d.ChildID == 1 && increaseFirstObjectVisibility) continue;
|
||||
d.ApplyCustomUpdateState += ApplyHiddenState;
|
||||
|
||||
d.HitObject.TimeFadein = d.HitObject.TimePreempt * fade_in_duration_multiplier;
|
||||
@ -39,18 +37,6 @@ namespace osu.Game.Rulesets.Osu.Mods
|
||||
h.TimeFadein = h.TimePreempt * fade_in_duration_multiplier;
|
||||
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
foreach (var d in drawables.OfType<DrawableOsuHitObject>())
|
||||
{
|
||||
d.ApplyCustomUpdateState += ApplyHiddenState;
|
||||
|
||||
d.HitObject.TimeFadein = d.HitObject.TimePreempt * fade_in_duration_multiplier;
|
||||
foreach (var h in d.HitObject.NestedHitObjects.OfType<OsuHitObject>())
|
||||
h.TimeFadein = h.TimePreempt * fade_in_duration_multiplier;
|
||||
}
|
||||
}
|
||||
}
|
||||
protected void ApplyHiddenState(DrawableHitObject drawable, ArmedState state)
|
||||
{
|
||||
@ -103,7 +89,7 @@ namespace osu.Game.Rulesets.Osu.Mods
|
||||
}
|
||||
}
|
||||
|
||||
public void ApplyToConfig(OsuConfigManager config)
|
||||
public void ReadFromConfig(OsuConfigManager config)
|
||||
{
|
||||
increaseFirstObjectVisibility = config.GetBindable<bool>(OsuSetting.IncreaseFirstObjectVisibility);
|
||||
//This starts the process of applying the mod effects. We start it here since this is the last void called.
|
||||
|
@ -40,7 +40,7 @@ namespace osu.Game.Overlays.Settings.Sections.Gameplay
|
||||
},
|
||||
new SettingsCheckbox
|
||||
{
|
||||
LabelText = "Increase the first object's visibility in \"Hidden\" mod",
|
||||
LabelText = "Show approach circle on first \"Hidden\" object",
|
||||
Bindable = config.GetBindable<bool>(OsuSetting.IncreaseFirstObjectVisibility)
|
||||
},
|
||||
};
|
||||
|
@ -7,6 +7,6 @@ namespace osu.Game.Rulesets.Mods
|
||||
{
|
||||
public interface IReadFromConfig
|
||||
{
|
||||
void ApplyToConfig(OsuConfigManager config);
|
||||
void ReadFromConfig(OsuConfigManager config);
|
||||
}
|
||||
}
|
||||
|
@ -67,7 +67,6 @@ namespace osu.Game.Rulesets.UI
|
||||
/// </summary>
|
||||
public readonly CursorContainer Cursor;
|
||||
|
||||
|
||||
protected readonly Ruleset Ruleset;
|
||||
|
||||
private IRulesetConfigManager rulesetConfig;
|
||||
@ -102,7 +101,6 @@ namespace osu.Game.Rulesets.UI
|
||||
dependencies.Cache(rulesetConfig);
|
||||
onScreenDisplay?.BeginTracking(this, rulesetConfig);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public abstract ScoreProcessor CreateScoreProcessor();
|
||||
@ -169,7 +167,6 @@ namespace osu.Game.Rulesets.UI
|
||||
public abstract class RulesetContainer<TObject> : RulesetContainer
|
||||
where TObject : HitObject
|
||||
{
|
||||
|
||||
public event Action<Judgement> OnJudgement;
|
||||
public event Action<Judgement> OnJudgementRemoved;
|
||||
|
||||
@ -198,7 +195,6 @@ namespace osu.Game.Rulesets.UI
|
||||
/// </summary>
|
||||
public readonly bool IsForCurrentRuleset;
|
||||
|
||||
|
||||
public override ScoreProcessor CreateScoreProcessor() => new ScoreProcessor<TObject>(this);
|
||||
|
||||
protected override Container<Drawable> Content => content;
|
||||
@ -208,7 +204,6 @@ namespace osu.Game.Rulesets.UI
|
||||
[BackgroundDependencyLoader]
|
||||
private void load(OsuConfigManager config)
|
||||
{
|
||||
|
||||
KeyBindingInputManager.Add(content = new Container
|
||||
{
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
@ -224,7 +219,6 @@ namespace osu.Game.Rulesets.UI
|
||||
|
||||
// Apply mods
|
||||
applyMods(Mods, config);
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@ -275,9 +269,8 @@ namespace osu.Game.Rulesets.UI
|
||||
|
||||
// Add mods, should always be the last thing applied to give full control to mods
|
||||
// Mods are now added in the load() method because we need the OsuConfigManager
|
||||
// for the IReadFromConfig implementations. Rhis method is still executed after the constructor,
|
||||
// for the IReadFromConfig implementations. This method is still executed after the constructor,
|
||||
// so the mods are still added in last
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -288,6 +281,8 @@ namespace osu.Game.Rulesets.UI
|
||||
/// <param name="mods"></param>
|
||||
private void applyMods(IEnumerable<Mod> mods, OsuConfigManager config)
|
||||
{
|
||||
if (mods == null)
|
||||
return;
|
||||
|
||||
foreach (var mod in mods.OfType<IApplicableToHitObject<TObject>>())
|
||||
foreach (var obj in Beatmap.HitObjects)
|
||||
@ -297,8 +292,7 @@ namespace osu.Game.Rulesets.UI
|
||||
mod.ApplyToRulesetContainer(this);
|
||||
|
||||
foreach (var mod in mods.OfType<IReadFromConfig>())
|
||||
mod.ApplyToConfig(config);
|
||||
|
||||
mod.ReadFromConfig(config);
|
||||
}
|
||||
|
||||
public override void SetReplay(Replay replay)
|
||||
|
Loading…
Reference in New Issue
Block a user