protected override void PopOut() { base.PopOut(); localCursorContainer?.Expire(); localCursorContainer = null; GameplayCursor?.ActiveCursor?.Show(); }
public override void Hide() { localCursorContainer?.Expire(); localCursorContainer = null; GameplayCursor.ActiveCursor.Show(); base.Hide(); }
private void loadContent(bool automated, Func <SkinProvidingContainer> skinProvider = null) { SetContents(_ => { var inputManager = automated ? (InputManager) new MovingCursorInputManager() : new OsuInputManager(new OsuRuleset().RulesetInfo); var skinContainer = skinProvider?.Invoke() ?? new SkinProvidingContainer(null); lastContainer = automated ? new ClickingCursorContainer() : new OsuCursorContainer(); return(inputManager.WithChild(skinContainer.WithChild(lastContainer))); }); }
public override void Show() { base.Show(); GameplayCursor.ActiveCursor.Hide(); cursorScaleContainer.MoveTo(GameplayCursor.ActiveCursor.Position); clickToResumeCursor.Appear(); if (localCursorContainer == null) { Add(localCursorContainer = new OsuCursorContainer()); localCursorScale = new Bindable <float>(); localCursorScale.BindTo(localCursorContainer.CursorScale); localCursorScale.BindValueChanged(scale => cursorScaleContainer.Scale = new Vector2(scale.NewValue), true); } }
protected override void PopIn() { base.PopIn(); GameplayCursor.ActiveCursor.Hide(); cursorScaleContainer.Position = ToLocalSpace(GameplayCursor.ActiveCursor.ScreenSpaceDrawQuad.Centre); clickToResumeCursor.Appear(); if (localCursorContainer == null) { Add(localCursorContainer = new OsuCursorContainer()); localCursorScale = new BindableFloat(); localCursorScale.BindTo(localCursorContainer.CursorScale); localCursorScale.BindValueChanged(scale => cursorScaleContainer.Scale = new Vector2(scale.NewValue), true); } }
public void TestSizing(int circleSize, float userScale) { AddStep($"set user scale to {userScale}", () => config.Set(OsuSetting.GameplayCursorSize, userScale)); AddStep($"adjust cs to {circleSize}", () => gameplayBeatmap.BeatmapInfo.BaseDifficulty.CircleSize = circleSize); AddStep("turn on autosizing", () => config.Set(OsuSetting.AutoCursorSize, true)); AddStep("load content", loadContent); AddUntilStep("cursor size correct", () => lastContainer.ActiveCursor.Scale.X == OsuCursorContainer.GetScaleForCircleSize(circleSize) * userScale); AddStep("set user scale to 1", () => config.Set(OsuSetting.GameplayCursorSize, 1f)); AddUntilStep("cursor size correct", () => lastContainer.ActiveCursor.Scale.X == OsuCursorContainer.GetScaleForCircleSize(circleSize)); AddStep("turn off autosizing", () => config.Set(OsuSetting.AutoCursorSize, false)); AddUntilStep("cursor size correct", () => lastContainer.ActiveCursor.Scale.X == 1); AddStep($"set user scale to {userScale}", () => config.Set(OsuSetting.GameplayCursorSize, userScale)); AddUntilStep("cursor size correct", () => lastContainer.ActiveCursor.Scale.X == userScale); }