mirror of https://github.com/ppy/osu
Adjust calls to `GetContainingInputManager()`
This commit is contained in:
parent
8a4ae5d23d
commit
659505f711
|
@ -49,7 +49,7 @@ protected override void LoadComplete()
|
|||
{
|
||||
base.LoadComplete();
|
||||
|
||||
inputManager = GetContainingInputManager();
|
||||
inputManager = GetContainingInputManager()!;
|
||||
|
||||
BeginPlacement();
|
||||
}
|
||||
|
|
|
@ -84,7 +84,7 @@ protected override void Update()
|
|||
{
|
||||
base.Update();
|
||||
|
||||
var replayState = (GetContainingInputManager().CurrentState as RulesetInputManagerInputState<CatchAction>)?.LastReplayState as CatchFramedReplayInputHandler.CatchReplayState;
|
||||
var replayState = (GetContainingInputManager()!.CurrentState as RulesetInputManagerInputState<CatchAction>)?.LastReplayState as CatchFramedReplayInputHandler.CatchReplayState;
|
||||
|
||||
SetCatcherPosition(
|
||||
replayState?.CatcherX ??
|
||||
|
|
|
@ -66,7 +66,7 @@ public void TestHoldNoteHeadVisibility()
|
|||
AddStep("Hold key", () =>
|
||||
{
|
||||
clock.CurrentTime = 0;
|
||||
note.OnPressed(new KeyBindingPressEvent<ManiaAction>(GetContainingInputManager().CurrentState, ManiaAction.Key1));
|
||||
note.OnPressed(new KeyBindingPressEvent<ManiaAction>(GetContainingInputManager()!.CurrentState, ManiaAction.Key1));
|
||||
});
|
||||
AddStep("progress time", () => clock.CurrentTime = 500);
|
||||
AddAssert("head is visible", () => note.Head.Alpha == 1);
|
||||
|
|
|
@ -161,9 +161,9 @@ public bool Pressed
|
|||
|
||||
pressed = value;
|
||||
if (value)
|
||||
OnPressed(new KeyBindingPressEvent<OsuAction>(GetContainingInputManager().CurrentState, OsuAction.LeftButton));
|
||||
OnPressed(new KeyBindingPressEvent<OsuAction>(GetContainingInputManager()!.CurrentState, OsuAction.LeftButton));
|
||||
else
|
||||
OnReleased(new KeyBindingReleaseEvent<OsuAction>(GetContainingInputManager().CurrentState, OsuAction.LeftButton));
|
||||
OnReleased(new KeyBindingReleaseEvent<OsuAction>(GetContainingInputManager()!.CurrentState, OsuAction.LeftButton));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -100,7 +100,7 @@ public void TestCircleMissBoundingBoxCorner()
|
|||
private void scheduleHit() => AddStep("schedule action", () =>
|
||||
{
|
||||
double delay = hitCircle.StartTime - hitCircle.HitWindows.WindowFor(HitResult.Great) - Time.Current;
|
||||
Scheduler.AddDelayed(() => hitAreaReceptor.OnPressed(new KeyBindingPressEvent<OsuAction>(GetContainingInputManager().CurrentState, OsuAction.LeftButton)), delay);
|
||||
Scheduler.AddDelayed(() => hitAreaReceptor.OnPressed(new KeyBindingPressEvent<OsuAction>(GetContainingInputManager()!.CurrentState, OsuAction.LeftButton)), delay);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
@ -92,7 +92,7 @@ protected override void LoadComplete()
|
|||
{
|
||||
base.LoadComplete();
|
||||
|
||||
updatePosition(GetContainingInputManager().CurrentState.Mouse.Position);
|
||||
updatePosition(GetContainingInputManager()!.CurrentState.Mouse.Position);
|
||||
}
|
||||
|
||||
protected override bool OnMouseMove(MouseMoveEvent e)
|
||||
|
|
|
@ -53,7 +53,7 @@ protected override void LoadComplete()
|
|||
{
|
||||
base.LoadComplete();
|
||||
|
||||
inputManager = GetContainingInputManager();
|
||||
inputManager = GetContainingInputManager()!;
|
||||
showDuringTouch = config.GetBindable<bool>(OsuSetting.GameplayCursorDuringTouch);
|
||||
}
|
||||
|
||||
|
|
|
@ -31,7 +31,7 @@ public void TakeFocus()
|
|||
if (!allowImmediateFocus)
|
||||
return;
|
||||
|
||||
Scheduler.Add(() => GetContainingFocusManager()?.ChangeFocus(this));
|
||||
Scheduler.Add(() => GetContainingFocusManager()!.ChangeFocus(this));
|
||||
}
|
||||
|
||||
public new void KillFocus() => base.KillFocus();
|
||||
|
|
|
@ -59,7 +59,7 @@ private void load(OsuColour colours)
|
|||
protected override void OnFocus(FocusEvent e)
|
||||
{
|
||||
base.OnFocus(e);
|
||||
GetContainingFocusManager()?.ChangeFocus(Component);
|
||||
GetContainingFocusManager()!.ChangeFocus(Component);
|
||||
}
|
||||
|
||||
protected override OsuTextBox CreateComponent() => CreateTextBox().With(t =>
|
||||
|
|
|
@ -243,7 +243,7 @@ private bool focusNextTextBox()
|
|||
|
||||
if (nextTextBox != null)
|
||||
{
|
||||
Schedule(() => GetContainingFocusManager()?.ChangeFocus(nextTextBox));
|
||||
Schedule(() => GetContainingFocusManager()!.ChangeFocus(nextTextBox));
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
@ -39,7 +39,7 @@ protected override void LoadComplete()
|
|||
base.LoadComplete();
|
||||
|
||||
if (!TextBox.ReadOnly)
|
||||
GetContainingFocusManager()?.ChangeFocus(TextBox);
|
||||
GetContainingFocusManager()!.ChangeFocus(TextBox);
|
||||
}
|
||||
|
||||
protected override void OnCommit(string text)
|
||||
|
|
|
@ -150,7 +150,7 @@ private void performLogin()
|
|||
|
||||
protected override void OnFocus(FocusEvent e)
|
||||
{
|
||||
Schedule(() => { GetContainingFocusManager()?.ChangeFocus(string.IsNullOrEmpty(username.Text) ? username : password); });
|
||||
Schedule(() => { GetContainingFocusManager()!.ChangeFocus(string.IsNullOrEmpty(username.Text) ? username : password); });
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -216,7 +216,7 @@ private void updateDropdownCurrent(UserStatus? status)
|
|||
|
||||
protected override void OnFocus(FocusEvent e)
|
||||
{
|
||||
if (form != null) GetContainingFocusManager()?.ChangeFocus(form);
|
||||
if (form != null) GetContainingFocusManager()!.ChangeFocus(form);
|
||||
base.OnFocus(e);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -141,7 +141,7 @@ private void load()
|
|||
|
||||
protected override void OnFocus(FocusEvent e)
|
||||
{
|
||||
Schedule(() => { GetContainingFocusManager()?.ChangeFocus(codeTextBox); });
|
||||
Schedule(() => { GetContainingFocusManager()!.ChangeFocus(codeTextBox); });
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -78,7 +78,7 @@ protected override void PopIn()
|
|||
this.FadeIn(transition_time, Easing.OutQuint);
|
||||
FadeEdgeEffectTo(WaveContainer.SHADOW_OPACITY, WaveContainer.APPEAR_DURATION, Easing.Out);
|
||||
|
||||
ScheduleAfterChildren(() => GetContainingFocusManager()?.ChangeFocus(panel));
|
||||
ScheduleAfterChildren(() => GetContainingFocusManager()!.ChangeFocus(panel));
|
||||
}
|
||||
|
||||
protected override void PopOut()
|
||||
|
|
|
@ -89,7 +89,7 @@ protected override void LoadComplete()
|
|||
{
|
||||
base.LoadComplete();
|
||||
|
||||
ScheduleAfterChildren(() => GetContainingFocusManager()?.ChangeFocus(nameTextBox));
|
||||
ScheduleAfterChildren(() => GetContainingFocusManager()!.ChangeFocus(nameTextBox));
|
||||
|
||||
nameTextBox.Current.BindValueChanged(s =>
|
||||
{
|
||||
|
|
|
@ -136,7 +136,7 @@ protected override void LoadComplete()
|
|||
{
|
||||
base.LoadComplete();
|
||||
|
||||
ScheduleAfterChildren(() => GetContainingFocusManager()?.ChangeFocus(nameTextBox));
|
||||
ScheduleAfterChildren(() => GetContainingFocusManager()!.ChangeFocus(nameTextBox));
|
||||
}
|
||||
|
||||
public override bool OnPressed(KeyBindingPressEvent<GlobalAction> e)
|
||||
|
|
|
@ -949,7 +949,7 @@ protected override bool OnClick(ClickEvent e)
|
|||
RequestScroll?.Invoke(this);
|
||||
|
||||
// Killing focus is done here because it's the only feasible place on ModSelectOverlay you can click on without triggering any action.
|
||||
Scheduler.Add(() => GetContainingFocusManager()?.ChangeFocus(null));
|
||||
Scheduler.Add(() => GetContainingFocusManager()!.ChangeFocus(null));
|
||||
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -465,7 +465,7 @@ private void finalise(bool advanceToNextBinding = true)
|
|||
}
|
||||
|
||||
if (HasFocus)
|
||||
GetContainingFocusManager()?.ChangeFocus(null);
|
||||
GetContainingFocusManager()!.ChangeFocus(null);
|
||||
|
||||
cancelAndClearButtons.FadeOut(300, Easing.OutQuint);
|
||||
cancelAndClearButtons.BypassAutoSizeAxes |= Axes.Y;
|
||||
|
|
|
@ -201,7 +201,7 @@ protected override void PopOut()
|
|||
|
||||
searchTextBox.HoldFocus = false;
|
||||
if (searchTextBox.HasFocus)
|
||||
GetContainingFocusManager()?.ChangeFocus(null);
|
||||
GetContainingFocusManager()!.ChangeFocus(null);
|
||||
}
|
||||
|
||||
public override bool AcceptsFocus => true;
|
||||
|
|
|
@ -669,7 +669,7 @@ public Task Import(params string[] paths)
|
|||
{
|
||||
SpriteName = { Value = file.Name },
|
||||
Origin = Anchor.Centre,
|
||||
Position = skinnableTarget.ToLocalSpace(GetContainingInputManager().CurrentState.Mouse.Position),
|
||||
Position = skinnableTarget.ToLocalSpace(GetContainingInputManager()!.CurrentState.Mouse.Position),
|
||||
};
|
||||
|
||||
SelectedComponents.Clear();
|
||||
|
|
|
@ -580,7 +580,7 @@ protected override void LoadComplete()
|
|||
{
|
||||
base.LoadComplete();
|
||||
|
||||
GetContainingFocusManager()?.ChangeFocus(this);
|
||||
GetContainingFocusManager()!.ChangeFocus(this);
|
||||
SelectAll();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -138,7 +138,7 @@ private void load()
|
|||
protected override void LoadComplete()
|
||||
{
|
||||
base.LoadComplete();
|
||||
ScheduleAfterChildren(() => GetContainingFocusManager()?.ChangeFocus(sliderVelocitySlider));
|
||||
ScheduleAfterChildren(() => GetContainingFocusManager()!.ChangeFocus(sliderVelocitySlider));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -45,7 +45,7 @@ protected override void OnFocus(FocusEvent e)
|
|||
OnFocused?.Invoke();
|
||||
base.OnFocus(e);
|
||||
|
||||
GetContainingFocusManager()?.TriggerFocusContention(this);
|
||||
GetContainingFocusManager()!.TriggerFocusContention(this);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -70,7 +70,7 @@ protected override void LoadComplete()
|
|||
base.LoadComplete();
|
||||
|
||||
if (string.IsNullOrEmpty(ArtistTextBox.Current.Value))
|
||||
ScheduleAfterChildren(() => GetContainingFocusManager()?.ChangeFocus(ArtistTextBox));
|
||||
ScheduleAfterChildren(() => GetContainingFocusManager()!.ChangeFocus(ArtistTextBox));
|
||||
|
||||
ArtistTextBox.Current.BindValueChanged(artist => transferIfRomanised(artist.NewValue, RomanisedArtistTextBox));
|
||||
TitleTextBox.Current.BindValueChanged(title => transferIfRomanised(title.NewValue, RomanisedTitleTextBox));
|
||||
|
|
|
@ -126,7 +126,7 @@ public IndeterminateSliderWithTextBoxInput(LocalisableString labelText, Bindable
|
|||
protected override void OnFocus(FocusEvent e)
|
||||
{
|
||||
base.OnFocus(e);
|
||||
GetContainingFocusManager()?.ChangeFocus(textBox);
|
||||
GetContainingFocusManager()!.ChangeFocus(textBox);
|
||||
}
|
||||
|
||||
private void updateState()
|
||||
|
|
|
@ -53,7 +53,7 @@ public IEnumerable<Issue> Issues
|
|||
if (issue.Time != null)
|
||||
{
|
||||
clock.Seek(issue.Time.Value);
|
||||
editor.OnPressed(new KeyBindingPressEvent<GlobalAction>(GetContainingInputManager().CurrentState, GlobalAction.EditorComposeMode));
|
||||
editor.OnPressed(new KeyBindingPressEvent<GlobalAction>(GetContainingInputManager()!.CurrentState, GlobalAction.EditorComposeMode));
|
||||
}
|
||||
|
||||
if (!issue.HitObjects.Any())
|
||||
|
|
|
@ -248,7 +248,7 @@ protected override void LoadComplete()
|
|||
{
|
||||
base.LoadComplete();
|
||||
|
||||
ScheduleAfterChildren(() => GetContainingFocusManager()?.ChangeFocus(passwordTextBox));
|
||||
ScheduleAfterChildren(() => GetContainingFocusManager()!.ChangeFocus(passwordTextBox));
|
||||
passwordTextBox.OnCommit += (_, _) => performJoin();
|
||||
}
|
||||
|
||||
|
@ -262,7 +262,7 @@ private void joinFailed(string error) => Schedule(() =>
|
|||
{
|
||||
passwordTextBox.Text = string.Empty;
|
||||
|
||||
GetContainingFocusManager()?.ChangeFocus(passwordTextBox);
|
||||
GetContainingFocusManager()!.ChangeFocus(passwordTextBox);
|
||||
|
||||
errorText.Text = error;
|
||||
errorText
|
||||
|
|
|
@ -249,7 +249,7 @@ protected override void LoadComplete()
|
|||
{
|
||||
base.LoadComplete();
|
||||
|
||||
inputManager = GetContainingInputManager();
|
||||
inputManager = GetContainingInputManager()!;
|
||||
|
||||
showStoryboards.BindValueChanged(val => epilepsyWarning?.FadeTo(val.NewValue ? 1 : 0, 250, Easing.OutQuint), true);
|
||||
epilepsyWarning?.FinishTransforms(true);
|
||||
|
|
|
@ -1279,7 +1279,7 @@ protected override bool OnMouseDown(MouseDownEvent e)
|
|||
{
|
||||
// we need to block right click absolute scrolling when hovering a carousel item so context menus can display.
|
||||
// this can be reconsidered when we have an alternative to right click scrolling.
|
||||
if (GetContainingInputManager().HoveredDrawables.OfType<DrawableCarouselItem>().Any())
|
||||
if (GetContainingInputManager()!.HoveredDrawables.OfType<DrawableCarouselItem>().Any())
|
||||
{
|
||||
rightMouseScrollBlocked = true;
|
||||
return false;
|
||||
|
|
|
@ -245,7 +245,7 @@ public void Deactivate()
|
|||
searchTextBox.ReadOnly = true;
|
||||
searchTextBox.HoldFocus = false;
|
||||
if (searchTextBox.HasFocus)
|
||||
GetContainingFocusManager()?.ChangeFocus(searchTextBox);
|
||||
GetContainingFocusManager()!.ChangeFocus(searchTextBox);
|
||||
}
|
||||
|
||||
public void Activate()
|
||||
|
|
|
@ -95,7 +95,7 @@ protected override bool OnStart()
|
|||
modsAtGameplayStart = Mods.Value;
|
||||
|
||||
// Ctrl+Enter should start map with autoplay enabled.
|
||||
if (GetContainingInputManager().CurrentState?.Keyboard.ControlPressed == true)
|
||||
if (GetContainingInputManager()?.CurrentState?.Keyboard.ControlPressed == true)
|
||||
{
|
||||
var autoInstance = getAutoplayMod();
|
||||
|
||||
|
|
|
@ -81,7 +81,7 @@ protected override void LoadComplete()
|
|||
{
|
||||
base.LoadComplete();
|
||||
|
||||
ScheduleAfterChildren(() => GetContainingFocusManager()?.ChangeFocus(this));
|
||||
ScheduleAfterChildren(() => GetContainingFocusManager()!.ChangeFocus(this));
|
||||
|
||||
beatmap.BindValueChanged(_ => Hide());
|
||||
}
|
||||
|
|
|
@ -38,7 +38,7 @@ protected override void LoadComplete()
|
|||
{
|
||||
base.LoadComplete();
|
||||
|
||||
inputManager = GetContainingInputManager();
|
||||
inputManager = GetContainingInputManager()!;
|
||||
IsActive.BindTo(latencyArea.IsActiveArea);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue