Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
Maxwell21 committed May 13, 2018
2 parents 9a90116 + e790606 commit 65c74c0
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -175,12 +175,17 @@ void UNavigableVerticalBox::HandleNextKeyPressed()
if (this->NavigableWidgets[Index]->IsFocused && this->NavigableWidgets.IsValidIndex(Index + 1))
{
UNavigableWidgetLibrary::FocusNavigableWidget(this, this->NavigableWidgets[Index + 1]);
this->OnVerticalBoxChangedChild.Broadcast(Index + 1);

return;
}
}

if (this->BoundOpposite)
{
UNavigableWidgetLibrary::FocusNavigableWidget(this, this->NavigableWidgets[0]);
this->OnVerticalBoxChangedChild.Broadcast(0);
}
}

void UNavigableVerticalBox::HandlePreviousKeyPressed()
Expand All @@ -193,12 +198,17 @@ void UNavigableVerticalBox::HandlePreviousKeyPressed()
if (this->NavigableWidgets[Index]->IsFocused && this->NavigableWidgets.IsValidIndex(Index - 1))
{
UNavigableWidgetLibrary::FocusNavigableWidget(this, this->NavigableWidgets[Index -1]);
this->OnVerticalBoxChangedChild.Broadcast(Index - 1);

return;
}
}

if (this->BoundOpposite)
{
UNavigableWidgetLibrary::FocusNavigableWidget(this, this->NavigableWidgets[this->NavigableWidgets.Num() - 1]);
this->OnVerticalBoxChangedChild.Broadcast(this->NavigableWidgets.Num() - 1);
}
}

void UNavigableVerticalBox::HandleConfirmKeyPressed()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@

class UNavigableWidget;

DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FNavigableVerticalBoxChangedChild, int32, ChildIndex);

/**
* A navigable vertical box widget is a layout panel allowing child widgets to be automatically laid out
* vertically and user can navigate through their navigable child widgets
Expand Down Expand Up @@ -87,11 +89,20 @@ class UT_FRAMEWORK_API UNavigableVerticalBox : public UVerticalBox, public INavi
UPROPERTY(Category = "Umbra Framework | Navigation", EditAnywhere, BlueprintReadWrite)
bool BoundOpposite = true;

/**
* All childs contain
*/
UPROPERTY()
TArray<UNavigableWidget*> NavigableWidgets;

/**
* User has pressed the confirm button
*/
bool HasConfirmed = false;

UPROPERTY(Category = "Umbra Framework | Navigation", BlueprintAssignable)
FNavigableVerticalBoxChangedChild OnVerticalBoxChangedChild;

/************************************************************************/
/* FUNCTIONS */
/************************************************************************/
Expand Down

0 comments on commit 65c74c0

Please sign in to comment.