mirror of
https://github.com/ppy/osu.git
synced 2025-03-03 23:23:25 +08:00
ActivateSelection
-> TryActivateSelection
This commit is contained in:
parent
2feab31426
commit
0716b73d2a
@ -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;
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user