Ejemplo n.º 1
0
        protected override void ApplyMapPropertiesSelf(ControlPointGroup controlPoints, MapDifficulty difficulty)
        {
            base.ApplyMapPropertiesSelf(controlPoints, difficulty);

            ApproachDuration = MapDifficulty.GetDifficultyValue(difficulty.ApproachRate, 2000, 1500, 900);
            Scale            = MapDifficulty.GetDifficultyValue(difficulty.CircleSize, 1, 0.85f, 0.7f);
        }
Ejemplo n.º 2
0
 private Drawable[] createContent(int index, ControlPointGroup group)
 {
     return(new Drawable[]
     {
         new FillFlowContainer
         {
             RelativeSizeAxes = Axes.Y,
             Width = TIMING_COLUMN_WIDTH,
             Spacing = new Vector2(5),
             Children = new Drawable[]
             {
                 new OsuSpriteText
                 {
                     Text = group.Time.ToEditorFormattedString(),
                     Font = OsuFont.GetFont(size: TEXT_SIZE, weight: FontWeight.Bold),
                     Width = 70,
                     Anchor = Anchor.CentreLeft,
                     Origin = Anchor.CentreLeft,
                 },
                 new ControlGroupAttributes(group, c => c is TimingControlPoint)
                 {
                     Anchor = Anchor.CentreLeft,
                     Origin = Anchor.CentreLeft,
                 }
             }
         },
         new ControlGroupAttributes(group, c => !(c is TimingControlPoint))
     });
 }
Ejemplo n.º 3
0
            public RowBackground(ControlPointGroup controlGroup)
            {
                this.controlGroup = controlGroup;
                RelativeSizeAxes  = Axes.X;
                Height            = 25;

                AlwaysPresent = true;

                CornerRadius = 3;
                Masking      = true;

                Children = new Drawable[]
                {
                    hoveredBackground = new Box
                    {
                        RelativeSizeAxes = Axes.Both,
                        Alpha            = 0,
                    },
                };

                Action = () =>
                {
                    selectedGroup.Value = controlGroup;
                    clock.SeekTo(controlGroup.Time);
                };
            }
Ejemplo n.º 4
0
        public GroupVisualisation(ControlPointGroup group)
        {
            RelativePositionAxes = Axes.X;

            RelativeSizeAxes = Axes.Both;
            Origin           = Anchor.TopLeft;

            Group = group;
            X     = (float)group.Time;

            // Run in constructor so IsRedundant calls can work correctly.
            controlPoints.BindTo(Group.ControlPoints);
            controlPoints.BindCollectionChanged((_, __) =>
            {
                ClearInternal();

                if (controlPoints.Count == 0)
                {
                    return;
                }

                foreach (var point in Group.ControlPoints)
                {
                    switch (point)
                    {
                    case TimingControlPoint _:
                        AddInternal(new ControlPointVisualisation(point)
                        {
                            Y = 0,
                        });
                        break;

                    case DifficultyControlPoint _:
                        AddInternal(new ControlPointVisualisation(point)
                        {
                            Y = 0.25f,
                        });
                        break;

                    case SampleControlPoint _:
                        AddInternal(new ControlPointVisualisation(point)
                        {
                            Y = 0.5f,
                        });
                        break;

                    case EffectControlPoint effect:
                        AddInternal(new EffectPointVisualisation(effect)
                        {
                            Y = 0.75f
                        });
                        break;
                    }
                }
            }, true);
        }
Ejemplo n.º 5
0
        public TimelineControlPointGroup(ControlPointGroup group)
        {
            Group = group;

            RelativePositionAxes = Axes.X;
            RelativeSizeAxes     = Axes.Y;
            AutoSizeAxes         = Axes.X;

            X = (float)group.Time;
        }
Ejemplo n.º 6
0
        public GroupVisualisation(ControlPointGroup group)
        {
            RelativePositionAxes = Axes.X;

            RelativeSizeAxes = Axes.Both;
            Origin           = Anchor.TopLeft;

            Group = group;
            X     = (float)group.Time;
        }
Ejemplo n.º 7
0
        protected override void ApplyMapPropertiesSelf(ControlPointGroup controlPoints, MapDifficulty difficulty)
        {
            base.ApplyMapPropertiesSelf(controlPoints, difficulty);

            TimingControlPoint     timingPoint     = controlPoints.TimingPointAt(StartTime);
            DifficultyControlPoint difficultyPoint = controlPoints.DifficultyPointAt(StartTime);

            float distance = BaseDistance * difficultyPoint.SpeedMultiplier * difficulty.SliderMultiplier;

            Speed = distance / timingPoint.BeatLength;
        }
Ejemplo n.º 8
0
            public ControlGroupAttributes(ControlPointGroup group)
            {
                InternalChild = fill = new FillFlowContainer
                {
                    RelativeSizeAxes = Axes.Both,
                    Direction        = FillDirection.Horizontal,
                    Padding          = new MarginPadding(10),
                    Spacing          = new Vector2(2)
                };

                controlPoints = group.ControlPoints.GetBoundCopy();
            }
Ejemplo n.º 9
0
            public ControlGroupAttributes(ControlPointGroup group)
            {
                RelativeSizeAxes = Axes.Both;
                InternalChild    = fill = new FillFlowContainer
                {
                    RelativeSizeAxes = Axes.Both,
                    Direction        = FillDirection.Horizontal,
                    Spacing          = new Vector2(2)
                };

                controlPoints.BindTo(group.ControlPoints);
            }
Ejemplo n.º 10
0
        public TimelineControlPointGroup(ControlPointGroup group)
        {
            Group = group;

            RelativePositionAxes = Axes.X;
            RelativeSizeAxes     = Axes.Y;
            AutoSizeAxes         = Axes.X;

            Origin = Anchor.TopCentre;

            X = (float)group.Time;
        }
Ejemplo n.º 11
0
        /// <summary>
        /// Applies map properties to this object only.
        /// </summary>
        protected virtual void ApplyMapPropertiesSelf(ControlPointGroup controlPoints, MapDifficulty difficulty)
        {
            IsHighlight = controlPoints.EffectPointAt(StartTime + ControlPointOffset).IsHighlight;

            ApproachDuration = MapDifficulty.GetDifficultyValue(difficulty.ApproachRate, 1000f, 750f, 500f);

            if (Timing == null)
            {
                Timing = CreateHitTiming();
            }
            if (Timing != null)
            {
                Timing.SetDifficulty(difficulty.OverallDifficulty);
            }
        }
Ejemplo n.º 12
0
        protected override void ApplyMapPropertiesSelf(ControlPointGroup controlPoints, MapDifficulty difficulty)
        {
            base.ApplyMapPropertiesSelf(controlPoints, difficulty);

            // Set samples to be played on dragger end.
            EndSamples = NodeSamples[NodeSamples.Count - 1];

            // Set ending position
            EndX = this.GetPosition(1f).x;

            // Calculate tick generation interval.
            TimingControlPoint timingPoint = controlPoints.TimingPointAt(StartTime);

            TickInterval = timingPoint.BeatLength / difficulty.SliderTickRate;
        }
Ejemplo n.º 13
0
        private void Initialize()
        {
            if (_stretchCursorTokenStrategy == null)
            {
                _stretchCursorTokenStrategy = new CompassStretchCursorTokenStrategy();
            }

            if (_controlPoints == null)
            {
                base.Graphics.Add(_controlPoints = new ControlPointGroup());
            }

            _stretchCursorTokenStrategy.TargetGraphic = this;
            _controlPoints.ControlPointChangedEvent  += OnControlPointLocationChanged;
        }
Ejemplo n.º 14
0
 private Drawable[] createContent(int index, ControlPointGroup group) => new Drawable[]
 {
     new OsuSpriteText
     {
         Text   = $"#{index + 1}",
         Font   = OsuFont.GetFont(size: text_size, weight: FontWeight.Bold),
         Margin = new MarginPadding(10)
     },
     new OsuSpriteText
     {
         Text = group.Time.ToEditorFormattedString(),
         Font = OsuFont.GetFont(size: text_size, weight: FontWeight.Bold)
     },
     new ControlGroupAttributes(group),
 };
Ejemplo n.º 15
0
            public ControlGroupAttributes(ControlPointGroup group, Func <ControlPoint, bool> matchFunction)
            {
                this.matchFunction = matchFunction;

                AutoSizeAxes     = Axes.X;
                RelativeSizeAxes = Axes.Y;

                InternalChild = fill = new FillFlowContainer
                {
                    AutoSizeAxes     = Axes.X,
                    RelativeSizeAxes = Axes.Y,
                    Direction        = FillDirection.Horizontal,
                    Spacing          = new Vector2(2)
                };

                controlPoints.BindTo(group.ControlPoints);
            }
Ejemplo n.º 16
0
        /// <summary>
        /// Applies specified map properties to this and all nested hit object.
        /// </summary>
        public void ApplyMapProperties(ControlPointGroup controlPoints, MapDifficulty difficulty)
        {
            // Apply map properties to this object first.
            ApplyMapPropertiesSelf(controlPoints, difficulty);

            // Determine which sample point this object belongs to.
            IHasEndTime endTimeObject = this as IHasEndTime;

            SamplePoint = controlPoints.SamplePointAt(StartTime + ControlPointOffset);

            // Create nested objects if necessary
            NestedObjects.Clear();
            CreateNestedObjects();
            NestedObjects.Sort((x, y) => x.StartTime.CompareTo(y.StartTime));

            // Apply map properties to all nested objects
            foreach (var obj in NestedObjects)
            {
                obj.ApplyMapProperties(controlPoints, difficulty);
            }
        }
Ejemplo n.º 17
0
		private void OnCloneComplete()
		{
			_controlPoints = (ControlPointGroup)CollectionUtils.SelectFirst(base.Graphics, delegate(IGraphic graphic) { return graphic is ControlPointGroup; });

			Initialize();
		}
Ejemplo n.º 18
0
 public bool IsVisuallyRedundant(ControlPointGroup other) =>
 other.ControlPoints.All(c => InternalChildren.OfType <IControlPointVisualisation>().Any(c2 => c2.IsVisuallyRedundant(c)));
Ejemplo n.º 19
0
        private void OnCloneComplete()
        {
            _controlPoints = (ControlPointGroup)CollectionUtils.SelectFirst(base.Graphics, delegate(IGraphic graphic) { return(graphic is ControlPointGroup); });

            Initialize();
        }
Ejemplo n.º 20
0
 public GroupVisualisation(ControlPointGroup group)
     : base(group.Time)
 {
     Group = group;
 }
Ejemplo n.º 21
0
		private void Initialize()
		{
			if (_stretchCursorTokenStrategy == null)
				_stretchCursorTokenStrategy = new CompassStretchCursorTokenStrategy();

			if (_controlPoints == null)
				base.Graphics.Add( _controlPoints = new ControlPointGroup());

			_stretchCursorTokenStrategy.TargetGraphic = this;
			_controlPoints.ControlPointChangedEvent += OnControlPointLocationChanged;
		}