private void load() { Beatmap.Value = new TestWorkingBeatmap(new Beatmap { HitObjects = new List <HitObject> { new HitCircle { Position = new Vector2(256, 192), Scale = 0.5f }, new HitCircle { Position = new Vector2(344, 148), Scale = 0.5f }, new Slider { Position = new Vector2(128, 256), Path = new SliderPath(PathType.Linear, new[] { Vector2.Zero, new Vector2(216, 0), }), Scale = 0.5f, } }, }); var clock = new DecoupleableInterpolatingFramedClock { IsCoupled = false }; Dependencies.CacheAs <IAdjustableClock>(clock); Dependencies.CacheAs <IFrameBasedClock>(clock); Child = composer = new OsuHitObjectComposer(new OsuRuleset()); }
private void load(HitObjectComposer composer) { this.composer = composer; maskContainer = new MaskContainer(); var maskSelection = composer.CreateMaskSelection(); maskContainer.MaskSelected += maskSelection.HandleSelected; maskContainer.MaskDeselected += maskSelection.HandleDeselected; maskContainer.MaskSelectionRequested += maskSelection.HandleSelectionRequested; maskContainer.MaskDragRequested += maskSelection.HandleDrag; maskSelection.DeselectAll = maskContainer.DeselectAll; var dragLayer = new DragLayer(maskContainer.Select); dragLayer.DragEnd += () => maskSelection.UpdateVisibility(); InternalChildren = new[] { dragLayer, maskSelection, maskContainer, dragLayer.CreateProxy() }; foreach (var obj in composer.HitObjects) { addMask(obj); } }
public ComposeBlueprintContainer(HitObjectComposer composer) : base(composer) { placementBlueprintContainer = new Container <PlacementBlueprint> { RelativeSizeAxes = Axes.Both }; }
private void load(HitObjectComposer composer) { if (composer != null) { // best effort to get the drawable representation for grabbing colour and what not. drawableHitObject = composer.HitObjects.FirstOrDefault(d => d.HitObject == HitObject); } }
public HitObjectMaskLayer(HitObjectComposer composer) { this.composer = composer; RelativeSizeAxes = Axes.Both; InternalChild = overlayContainer = new Container <HitObjectMask> { RelativeSizeAxes = Axes.Both }; }
public TimelineBlueprintContainer(HitObjectComposer composer) : base(composer) { RelativeSizeAxes = Axes.Both; Anchor = Anchor.Centre; Origin = Anchor.Centre; Height = 0.6f; }
public HitObjectMaskLayer(Playfield playfield, HitObjectComposer composer) { // we need the playfield as HitObjects may not be initialised until its BDL. this.playfield = playfield; this.composer = composer; RelativeSizeAxes = Axes.Both; }
protected override IReadOnlyDependencyContainer CreateChildDependencies(IReadOnlyDependencyContainer parent) { var dependencies = new DependencyContainer(base.CreateChildDependencies(parent)); ruleset = parent.Get <IBindable <WorkingBeatmap> >().Value.BeatmapInfo.Ruleset?.CreateInstance(); composer = ruleset?.CreateHitObjectComposer(); // make the composer available to the timeline and other components in this screen. dependencies.CacheAs(composer); return(dependencies); }
public KaraokeBlueprintContainer(HitObjectComposer composer) : base(composer) { bindableEditMode.BindValueChanged(e => { if (e.NewValue == EditMode.LyricEditor) { Hide(); } else { Show(); } }, true); }
public TimelineBlueprintContainer(HitObjectComposer composer) : base(composer) { RelativeSizeAxes = Axes.Both; Anchor = Anchor.Centre; Origin = Anchor.Centre; Height = 0.4f; AddInternal(new Box { Colour = Color4.Black, RelativeSizeAxes = Axes.Both, Alpha = 0.1f, }); }
protected override Drawable CreateMainContent() { var ruleset = Beatmap.Value.BeatmapInfo.Ruleset?.CreateInstance(); composer = ruleset?.CreateHitObjectComposer(); if (ruleset == null || composer == null) { return(new ScreenWhiteBox.UnderConstructionMessage(ruleset == null ? "This beatmap" : $"{ruleset.Description}'s composer")); } var beatmapSkinProvider = new BeatmapSkinProvidingContainer(Beatmap.Value.Skin); // the beatmapSkinProvider is used as the fallback source here to allow the ruleset-specific skin implementation // full access to all skin sources. var rulesetSkinProvider = new SkinProvidingContainer(ruleset.CreateLegacySkinProvider(beatmapSkinProvider, EditorBeatmap.PlayableBeatmap)); // load the skinning hierarchy first. // this is intentionally done in two stages to ensure things are in a loaded state before exposing the ruleset to skin sources. return(beatmapSkinProvider.WithChild(rulesetSkinProvider.WithChild(composer))); }
private void load(AudioManager audio) { Beatmap.Value = new WaveformTestBeatmap(audio); var playable = Beatmap.Value.GetPlayableBeatmap(Beatmap.Value.BeatmapInfo.Ruleset); var editorBeatmap = new EditorBeatmap(playable); Dependencies.Cache(editorBeatmap); Dependencies.CacheAs <IBeatSnapProvider>(editorBeatmap); Composer = playable.BeatmapInfo.Ruleset.CreateInstance().CreateHitObjectComposer().With(d => d.Alpha = 0); AddRange(new Drawable[] { editorBeatmap, Composer, new FillFlowContainer { AutoSizeAxes = Axes.Both, Direction = FillDirection.Vertical, Spacing = new Vector2(0, 5), Children = new Drawable[] { new StartStopButton(), new AudioVisualiser(), } }, TimelineArea = new TimelineArea { Child = CreateTestComponent(), Anchor = Anchor.Centre, Origin = Anchor.Centre, RelativeSizeAxes = Axes.X, Size = new Vector2(0.8f, 100), } }); }
protected EditorBlueprintContainer(HitObjectComposer composer) { Composer = composer; }
public KaraokeBlueprintContainer(HitObjectComposer composer) : base(composer) { }
public TaikoBlueprintContainer(HitObjectComposer composer) : base(composer) { }
public LyricBlueprintContainer(HitObjectComposer composer, Singer singer) : base(composer) { this.singer = singer; }
protected BlueprintContainer(HitObjectComposer composer) { Composer = composer; RelativeSizeAxes = Axes.Both; }
private void load([CanBeNull] BindableBeatDivisor beatDivisor) { if (beatDivisor != null) { this.beatDivisor.BindTo(beatDivisor); } Container composerContainer; Children = new Drawable[] { new GridContainer { RelativeSizeAxes = Axes.Both, Content = new[] { new Drawable[] { new Container { Name = "Timeline", RelativeSizeAxes = Axes.Both, Children = new Drawable[] { new Box { RelativeSizeAxes = Axes.Both, Colour = Color4.Black.Opacity(0.5f) }, new Container { Name = "Timeline content", RelativeSizeAxes = Axes.Both, Padding = new MarginPadding { Horizontal = horizontal_margins, Vertical = vertical_margins }, Child = new GridContainer { RelativeSizeAxes = Axes.Both, Content = new[] { new Drawable[] { new Container { RelativeSizeAxes = Axes.Both, Padding = new MarginPadding { Right = 5 }, Child = new TimelineArea { RelativeSizeAxes = Axes.Both } }, new BeatDivisorControl(beatDivisor) { RelativeSizeAxes = Axes.Both } }, }, ColumnDimensions = new[] { new Dimension(), new Dimension(GridSizeMode.Absolute, 90), } }, } } } }, new Drawable[] { composerContainer = new Container { Name = "Composer content", RelativeSizeAxes = Axes.Both, Padding = new MarginPadding { Horizontal = horizontal_margins, Vertical = vertical_margins }, } } }, RowDimensions = new[] { new Dimension(GridSizeMode.Absolute, 110) } }, }; var ruleset = Beatmap.Value.BeatmapInfo.Ruleset?.CreateInstance(); if (ruleset == null) { Logger.Log("Beatmap doesn't have a ruleset assigned."); // ExitRequested?.Invoke(); return; } composer = ruleset.CreateHitObjectComposer(); if (composer == null) { Logger.Log($"Ruleset {ruleset.Description} doesn't support hitobject composition."); // ExitRequested?.Invoke(); return; } composerContainer.Child = composer; }
public ManiaBlueprintContainer(HitObjectComposer composer) : base(composer) { }