// Project Lab - NHTV IGAD
//////////////////////////////////////////
// Author: Yoshi van Belkom - 130118
//////////////////////////////////////////

#include "SkillTreeEditorPrivatePCH.h"
#include "SSkillTreeEditorViewportToolbar.h"
#include "SkillTreeEditorCommands.h"
#include "SEditorViewport.h"

#define LOCTEXT_NAMESPACE "SSkillTreeEditorViewportToolbar"

void SSkillTreeEditorViewportToolbar::Construct( const FArguments& a_args, TSharedPtr<class ICommonEditorViewportToolbarInfoProvider> a_infoProvider )
{
	SCommonEditorViewportToolbarBase::Construct( SCommonEditorViewportToolbarBase::FArguments(), a_infoProvider );
}

TSharedRef<SWidget> SSkillTreeEditorViewportToolbar::GenerateShowMenu() const
{
	GetInfoProvider().OnFloatingButtonClicked();

	TSharedRef<SEditorViewport> viewportRef = GetInfoProvider().GetViewportWidget();

	const bool shouldCloseWindowAfterMenuSelection = true;
	FMenuBuilder showMenuBuilder( shouldCloseWindowAfterMenuSelection, viewportRef->GetCommandList() );
	{
		showMenuBuilder.AddMenuEntry( FSkillTreeEditorCommands::Get().setShowGrid );
	}

	return showMenuBuilder.MakeWidget();
}

#undef LOCTEXT_NAMESPACE
