mirror of
https://github.com/ppy/osu.git
synced 2025-02-21 13:42:55 +08:00
Merge branch 'master' into use-transform-managment-for-mania-ruleset
This commit is contained in:
commit
ba969d2d7d
@ -58,14 +58,12 @@ namespace osu.Game.Rulesets.Catch.Objects.Drawable
|
|||||||
ApplyResult(r => r.Type = CheckPosition.Invoke(HitObject) ? HitResult.Perfect : HitResult.Miss);
|
ApplyResult(r => r.Type = CheckPosition.Invoke(HitObject) ? HitResult.Perfect : HitResult.Miss);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override bool UseTransformStateManagement => false;
|
protected sealed override double InitialLifetimeOffset => HitObject.TimePreempt;
|
||||||
|
|
||||||
protected override void UpdateState(ArmedState state)
|
protected override void UpdateInitialTransforms() => this.FadeIn(200);
|
||||||
|
|
||||||
|
protected override void UpdateStateTransforms(ArmedState state)
|
||||||
{
|
{
|
||||||
// TODO: update to use new state management.
|
|
||||||
using (BeginAbsoluteSequence(HitObject.StartTime - HitObject.TimePreempt))
|
|
||||||
this.FadeIn(200);
|
|
||||||
|
|
||||||
var endTime = (HitObject as IHasEndTime)?.EndTime ?? HitObject.StartTime;
|
var endTime = (HitObject as IHasEndTime)?.EndTime ?? HitObject.StartTime;
|
||||||
|
|
||||||
using (BeginAbsoluteSequence(endTime, true))
|
using (BeginAbsoluteSequence(endTime, true))
|
||||||
|
@ -53,7 +53,7 @@ namespace osu.Game.Rulesets.Catch.UI
|
|||||||
if (lastPlateableFruit == null)
|
if (lastPlateableFruit == null)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// this is required to make this run after the last caught fruit runs UpdateState at least once.
|
// this is required to make this run after the last caught fruit runs updateState() at least once.
|
||||||
// TODO: find a better alternative
|
// TODO: find a better alternative
|
||||||
if (lastPlateableFruit.IsLoaded)
|
if (lastPlateableFruit.IsLoaded)
|
||||||
action();
|
action();
|
||||||
|
@ -220,14 +220,23 @@ namespace osu.Game.Screens.Select.Carousel
|
|||||||
|
|
||||||
public class FilterableGroupedDifficultyIcon : GroupedDifficultyIcon
|
public class FilterableGroupedDifficultyIcon : GroupedDifficultyIcon
|
||||||
{
|
{
|
||||||
|
private readonly List<CarouselBeatmap> items;
|
||||||
|
|
||||||
public FilterableGroupedDifficultyIcon(List<CarouselBeatmap> items, RulesetInfo ruleset)
|
public FilterableGroupedDifficultyIcon(List<CarouselBeatmap> items, RulesetInfo ruleset)
|
||||||
: base(items.Select(i => i.Beatmap).ToList(), ruleset, Color4.White)
|
: base(items.Select(i => i.Beatmap).ToList(), ruleset, Color4.White)
|
||||||
{
|
{
|
||||||
items.ForEach(item => item.Filtered.ValueChanged += _ =>
|
this.items = items;
|
||||||
{
|
|
||||||
// for now, fade the whole group based on the ratio of hidden items.
|
foreach (var item in items)
|
||||||
this.FadeTo(1 - 0.9f * ((float)items.Count(i => i.Filtered.Value) / items.Count), 100);
|
item.Filtered.BindValueChanged(_ => Scheduler.AddOnce(updateFilteredDisplay));
|
||||||
});
|
|
||||||
|
updateFilteredDisplay();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void updateFilteredDisplay()
|
||||||
|
{
|
||||||
|
// for now, fade the whole group based on the ratio of hidden items.
|
||||||
|
this.FadeTo(1 - 0.9f * ((float)items.Count(i => i.Filtered.Value) / items.Count), 100);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user