Exemplo n.º 1
0
        /// <summary>
        /// Creates a ruleset visualisation for the provided ruleset and beatmap.
        /// </summary>
        /// <param name="ruleset">The ruleset being represented.</param>
        /// <param name="workingBeatmap">The beatmap to create the hit renderer for.</param>
        protected DrawableRuleset(Ruleset ruleset, WorkingBeatmap workingBeatmap)
            : base(ruleset)
        {
            Debug.Assert(workingBeatmap != null, "DrawableRuleset initialized with a null beatmap.");

            RelativeSizeAxes = Axes.Both;

            Beatmap = (Beatmap <TObject>)workingBeatmap.GetPlayableBeatmap(ruleset.RulesetInfo);

            mods = workingBeatmap.Mods.Value;
            applyBeatmapMods(mods);

            KeyBindingInputManager = CreateInputManager();
            playfield = new Lazy <Playfield>(CreatePlayfield);

            IsPaused.ValueChanged += paused =>
            {
                if (HasReplayLoaded.Value)
                {
                    return;
                }

                KeyBindingInputManager.UseParentInput = !paused.NewValue;
            };
        }
Exemplo n.º 2
0
        /// <summary>
        /// Creates a ruleset visualisation for the provided ruleset and beatmap.
        /// </summary>
        /// <param name="ruleset">The ruleset being represented.</param>
        /// <param name="workingBeatmap">The beatmap to create the hit renderer for.</param>
        protected DrawableRuleset(Ruleset ruleset, WorkingBeatmap workingBeatmap, IReadOnlyList <Mod> mods)
            : base(ruleset)
        {
            if (workingBeatmap == null)
            {
                throw new ArgumentException("Beatmap cannot be null.", nameof(workingBeatmap));
            }

            this.mods = mods.ToArray();

            RelativeSizeAxes = Axes.Both;

            Beatmap = (Beatmap <TObject>)workingBeatmap.GetPlayableBeatmap(ruleset.RulesetInfo, mods);

            applyBeatmapMods(mods);

            KeyBindingInputManager = CreateInputManager();
            playfield = new Lazy <Playfield>(CreatePlayfield);

            IsPaused.ValueChanged += paused =>
            {
                if (HasReplayLoaded.Value)
                {
                    return;
                }

                KeyBindingInputManager.UseParentInput = !paused.NewValue;
            };
        }
        private void load()
        {
            DrawVisualiser vis;
            Drawable       target;

            // Avoid stack-overflow scenarios by isolating the hovered drawables through a new input manager
            Child = new PassThroughInputManager
            {
                Children = new[]
                {
                    target = new TestSceneDynamicDepth
                    {
                        Anchor = Anchor.BottomRight,
                        Origin = Anchor.BottomRight,
                        Size   = new Vector2(0.5f)
                    },
                    vis = new DrawVisualiser(),
                }
            };

            vis.Show();
            vis.Target = target;
        }
Exemplo n.º 4
0
 /// <summary>
 /// A visual representation of a <see cref="Rulesets.Ruleset"/>.
 /// </summary>
 /// <param name="ruleset">The ruleset being repesented.</param>
 internal RulesetContainer(Ruleset ruleset)
 {
     Ruleset = ruleset;
     KeyBindingInputManager = CreateInputManager();
     KeyBindingInputManager.RelativeSizeAxes = Axes.Both;
 }
Exemplo n.º 5
0
 private void load()
 {
     KeyBindingInputManager = CreateInputManager();
     KeyBindingInputManager.RelativeSizeAxes = Axes.Both;
 }
Exemplo n.º 6
0
 /// <summary>
 /// A visual representation of a <see cref="Rulesets.Ruleset"/>.
 /// </summary>
 /// <param name="ruleset">The ruleset being repesented.</param>
 internal RulesetContainer(Ruleset ruleset)
 {
     Ruleset = ruleset;
     KeyConversionInputManager = CreateActionMappingInputManager();
     KeyConversionInputManager.RelativeSizeAxes = Axes.Both;
 }