1
0
mirror of https://github.com/ppy/osu.git synced 2025-03-03 23:23:25 +08:00

ActivateSelection -> TryActivateSelection

This commit is contained in:
Dean Herbert 2025-01-23 22:44:39 +09:00
parent 2feab31426
commit 0716b73d2a
No known key found for this signature in database
2 changed files with 6 additions and 5 deletions

View File

@ -111,7 +111,7 @@ namespace osu.Game.Screens.SelectV2
protected override bool OnClick(ClickEvent e)
{
if (carousel.CurrentSelection == Item!.Model)
carousel.ActivateSelection();
carousel.TryActivateSelection();
else
carousel.CurrentSelection = Item!.Model;
return true;

View File

@ -97,9 +97,10 @@ namespace osu.Game.Screens.SelectV2
}
/// <summary>
/// Activate the current selection, if a selection exists.
/// Activate the current selection, if a selection exists and matches keyboard selection.
/// If keyboard selection does not match selection, this will transfer the selection on first invocation.
/// </summary>
public void ActivateSelection()
public void TryActivateSelection()
{
if (currentSelection.CarouselItem != currentKeyboardSelection.CarouselItem)
{
@ -295,7 +296,7 @@ namespace osu.Game.Screens.SelectV2
switch (e.Action)
{
case GlobalAction.Select:
ActivateSelection();
TryActivateSelection();
return true;
case GlobalAction.SelectNext:
@ -342,7 +343,7 @@ namespace osu.Game.Screens.SelectV2
// group selection, first transfer the keyboard selection to actual selection.
if (isGroupSelection && currentSelection.CarouselItem != currentKeyboardSelection.CarouselItem)
{
ActivateSelection();
TryActivateSelection();
return true;
}