Unreal/CarlaUE4/Plugins/RoadRunnerImporter/Source/RoadRunnerImporter/Private/RoadRunnerImporterOptionWindow.cpp
////////////////////////////////////////////////////////////////////////////////
// Sets up RoadRunner import option window layout
Sets up RoadRunner import option window layout
Sets up RoadRunner import option window layout
void SRoadRunnerImporterOptionWindow::Construct(const FArguments & inArgs)
{
	OwnerWindow = inArgs._OwnerWindow;
	FullPath = inArgs._FullPath;
	ImportOptions = inArgs._ImportOptions;
	VersionOutOfDate = inArgs._VersionOutOfDate;
	this->ChildSlot
	[
		SNew(SVerticalBox)
		+SVerticalBox::Slot()
		.HAlign(HAlign_Fill)
		.VAlign(VAlign_Fill)
		.Padding(5)
		[
			SNew(SHorizontalBox)
			+SHorizontalBox::Slot()
			.AutoWidth()
			.Padding(5)
			[
				SNew(SBorder)
				.BorderImage(FEditorStyle::GetBrush("ToolPanel.GroupBorder"))
				.HAlign(HAlign_Left)
				.VAlign(VAlign_Top)
				[
					SNew(SImage)
					.Image(FRoadRunnerStyle::GetLogoBrush())
				]
			]
			+ SHorizontalBox::Slot()
			.Padding(5)
			[
				SNew(SBorder)
				.BorderImage(FEditorStyle::GetBrush("ToolPanel.GroupBorder"))
				.HAlign(HAlign_Fill)
				.VAlign(VAlign_Fill)
				[
					SNew(SVerticalBox)
					+SVerticalBox::Slot()
					.AutoHeight()
					[
						SNew(SBorder)
						.BorderImage(FEditorStyle::GetBrush("ToolPanel.DarkGroupBorder"))
						.Padding(3)
						[
							SNew(STextBlock)
							.Text(LOCTEXT("OptionsTitle", "Import Options"))
							.TextStyle(&FEditorStyle::GetWidgetStyle<FTextBlockStyle>("RichTextBlock.Bold"))
						]
					]
					+SVerticalBox::Slot()
					.HAlign(HAlign_Left)
					.AutoHeight()
					[
						SNew(SUniformGridPanel)
						.SlotPadding(10)
						+SUniformGridPanel::Slot(0, 0)
						[
							SNew(STextBlock)
							.Text(LOCTEXT("MaterialOptionText", "Overwrite Materials"))
						]
						+SUniformGridPanel::Slot(1, 0)
						[
							SNew(SCheckBox)
							.IsChecked(this, &SRoadRunnerImporterOptionWindow::ShouldOverwriteMaterials)
							.OnCheckStateChanged(this, &SRoadRunnerImporterOptionWindow::OnOverwriteMaterialsChanged)
						]
						+ SUniformGridPanel::Slot(0, 1)
						[
							SNew(STextBlock)
							.Text(LOCTEXT("SignalOptionText", "Import Signal Visuals*"))
						]
						+ SUniformGridPanel::Slot(1, 1)
						[
							SNew(SCheckBox)
							.IsChecked(this, &SRoadRunnerImporterOptionWindow::ShouldImportSignals)
							.OnCheckStateChanged(this, &SRoadRunnerImporterOptionWindow::OnImportSignalsChanged)
						]
					]
					+SVerticalBox::Slot()
					.HAlign(HAlign_Fill)
					.VAlign(VAlign_Bottom)
					[
						SNew(STextBlock)
						.Text(LOCTEXT("Disclaimer", "*Only compatible when importing as blueprint"))
					]
				]
			]
		]
		+SVerticalBox::Slot()
		.AutoHeight()
		[
			SNew(SHorizontalBox)
			+ SHorizontalBox::Slot()
			.Padding(2)
			.HAlign(HAlign_Left)
			[
				SNew(STextBlock)
				.ColorAndOpacity(FLinearColor::Red)
				.Visibility(GetVersionWarningVisibility())
				.Text(LOCTEXT("VersionWarning", "Plugin is out of date, please update."))
			]
			+ SHorizontalBox::Slot()
			.HAlign(HAlign_Right)
			[
				SNew(SUniformGridPanel)
				.SlotPadding(2)
				+ SUniformGridPanel::Slot(0, 0)
				[
					SNew(SButton)
					.HAlign(HAlign_Center)
					.Text(LOCTEXT("ImportBox", "Import"))
					.IsEnabled(this, &SRoadRunnerImporterOptionWindow::CanImport)
					.OnClicked(this, &SRoadRunnerImporterOptionWindow::OnImport)
				]
				+ SUniformGridPanel::Slot(1, 0)
				[
					SNew(SButton)
					.HAlign(HAlign_Center)
					.Text(LOCTEXT("CancelBox", "Cancel"))
					.IsEnabled(this, &SRoadRunnerImporterOptionWindow::CanImport)
					.OnClicked(this, &SRoadRunnerImporterOptionWindow::OnCancel)
				]
			]
		]
	];
}
void SRoadRunnerImporterOptionWindow :: Construct ( const FArguments & inArgs ) { OwnerWindow = inArgs . _OwnerWindow ; FullPath = inArgs . _FullPath ; ImportOptions = inArgs . _ImportOptions ; VersionOutOfDate = inArgs . _VersionOutOfDate ; this -> ChildSlot [ SNew ( SVerticalBox ) + SVerticalBox :: Slot ( ) . HAlign ( HAlign_Fill ) . VAlign ( VAlign_Fill ) . Padding ( 5 ) [ SNew ( SHorizontalBox ) + SHorizontalBox :: Slot ( ) . AutoWidth ( ) . Padding ( 5 ) [ SNew ( SBorder ) . BorderImage ( FEditorStyle :: GetBrush ( " " ) ) . HAlign ( HAlign_Left ) . VAlign ( VAlign_Top ) [ SNew ( SImage ) . Image ( FRoadRunnerStyle :: GetLogoBrush ( ) ) ] ] + SHorizontalBox :: Slot ( ) . Padding ( 5 ) [ SNew ( SBorder ) . BorderImage ( FEditorStyle :: GetBrush ( " " ) ) . HAlign ( HAlign_Fill ) . VAlign ( VAlign_Fill ) [ SNew ( SVerticalBox ) + SVerticalBox :: Slot ( ) . AutoHeight ( ) [ SNew ( SBorder ) . BorderImage ( FEditorStyle :: GetBrush ( " " ) ) . Padding ( 3 ) [ SNew ( STextBlock ) . Text ( LOCTEXT ( " " , " " ) ) . TextStyle ( & FEditorStyle :: GetWidgetStyle < FTextBlockStyle > ( " " ) ) ] ] + SVerticalBox :: Slot ( ) . HAlign ( HAlign_Left ) . AutoHeight ( ) [ SNew ( SUniformGridPanel ) . SlotPadding ( 10 ) + SUniformGridPanel :: Slot ( 0 , 0 ) [ SNew ( STextBlock ) . Text ( LOCTEXT ( " " , " " ) ) ] + SUniformGridPanel :: Slot ( 1 , 0 ) [ SNew ( SCheckBox ) . IsChecked ( this , & SRoadRunnerImporterOptionWindow :: ShouldOverwriteMaterials ) . OnCheckStateChanged ( this , & SRoadRunnerImporterOptionWindow :: OnOverwriteMaterialsChanged ) ] + SUniformGridPanel :: Slot ( 0 , 1 ) [ SNew ( STextBlock ) . Text ( LOCTEXT ( " " , " " ) ) ] + SUniformGridPanel :: Slot ( 1 , 1 ) [ SNew ( SCheckBox ) . IsChecked ( this , & SRoadRunnerImporterOptionWindow :: ShouldImportSignals ) . OnCheckStateChanged ( this , & SRoadRunnerImporterOptionWindow :: OnImportSignalsChanged ) ] ] + SVerticalBox :: Slot ( ) . HAlign ( HAlign_Fill ) . VAlign ( VAlign_Bottom ) [ SNew ( STextBlock ) . Text ( LOCTEXT ( " " , " " ) ) ] ] ] ] + SVerticalBox :: Slot ( ) . AutoHeight ( ) [ SNew ( SHorizontalBox ) + SHorizontalBox :: Slot ( ) . Padding ( 2 ) . HAlign ( HAlign_Left ) [ SNew ( STextBlock ) . ColorAndOpacity ( FLinearColor :: Red ) . Visibility ( GetVersionWarningVisibility ( ) ) . Text ( LOCTEXT ( " " , " " ) ) ] + SHorizontalBox :: Slot ( ) . HAlign ( HAlign_Right ) [ SNew ( SUniformGridPanel ) . SlotPadding ( 2 ) + SUniformGridPanel :: Slot ( 0 , 0 ) [ SNew ( SButton ) . HAlign ( HAlign_Center ) . Text ( LOCTEXT ( " " , " " ) ) . IsEnabled ( this , & SRoadRunnerImporterOptionWindow :: CanImport ) . OnClicked ( this , & SRoadRunnerImporterOptionWindow :: OnImport ) ] + SUniformGridPanel :: Slot ( 1 , 0 ) [ SNew ( SButton ) . HAlign ( HAlign_Center ) . Text ( LOCTEXT ( " " , " " ) ) . IsEnabled ( this , & SRoadRunnerImporterOptionWindow :: CanImport ) . OnClicked ( this , & SRoadRunnerImporterOptionWindow :: OnCancel ) ] ] ] ] ; }
Sets up RoadRunner import option window layout
Sets up RoadRunner import option window layout