Ejemplo n.º 1
0
TSharedRef<ITableRow> SVisualLoggerLogsList::LogEntryLinesGenerateRow(TSharedPtr<FLogEntryItem> Item, const TSharedRef<STableViewBase>& OwnerTable)
{
	return SNew(STableRow< TSharedPtr<FString> >, OwnerTable)
		[
			SNew(SHorizontalBox)
			+ SHorizontalBox::Slot()
			.AutoWidth()
			.Padding(FMargin(5.0f, 0.0f))
			[
				SNew(STextBlock)
				.ColorAndOpacity(FSlateColor(Item->CategoryColor))
				.Text( FText::FromString(Item->Category) )
				.HighlightText(this, &SVisualLoggerLogsList::GetFilterText)
			]
			+ SHorizontalBox::Slot()
			.AutoWidth()
			.Padding(FMargin(5.0f, 0.0f))
			[
				SNew(STextBlock)
				.ColorAndOpacity(FSlateColor(Item->Verbosity == ELogVerbosity::Error ? FLinearColor::Red : (Item->Verbosity == ELogVerbosity::Warning ? FLinearColor::Yellow : FLinearColor::Gray)))
				.Text(FText::FromString(FString(TEXT("(")) + FString(FOutputDevice::VerbosityToString(Item->Verbosity)) + FString(TEXT(")"))))
			]
			+ SHorizontalBox::Slot()
			.Padding(FMargin(5.0f, 0.0f))
			[
				SNew(STextBlock)
				.AutoWrapText(true)
				.ColorAndOpacity(FSlateColor(Item->Verbosity == ELogVerbosity::Error ? FLinearColor::Red : (Item->Verbosity == ELogVerbosity::Warning ? FLinearColor::Yellow : FLinearColor::Gray)))
				.Text(FText::FromString(Item->Line))
				.HighlightText(this, &SVisualLoggerLogsList::GetFilterText)
			]
		];
}
Ejemplo n.º 2
0
FSlateColor STransportControl::GetLoopStatusColor() const
{
	if (TransportControlArgs.OnGetLooping.IsBound() &&
		TransportControlArgs.OnGetLooping.Execute())
	{
		return FSlateColor(FLinearColor(1.f, 0.f, 0.f));
	}

	return FSlateColor(FLinearColor(1.f, 1.f, 1.f));
}
void UTextBlock::SetOpacity(float InOpacity)
{
	FLinearColor CurrentColor = ColorAndOpacity.GetSpecifiedColor();
	CurrentColor.A = InOpacity;
	
	SetColorAndOpacity(FSlateColor(CurrentColor));
}
USpinBox::USpinBox(const FObjectInitializer& ObjectInitializer)
	: Super(ObjectInitializer)
{
	if (!IsRunningDedicatedServer())
	{
		static ConstructorHelpers::FObjectFinder<UFont> RobotoFontObj(TEXT("/Engine/EngineFonts/Roboto"));
		Font = FSlateFontInfo(RobotoFontObj.Object, 12, FName("Bold"));
	}

	// Grab other defaults from slate arguments.
	SSpinBox<float>::FArguments Defaults;

	Value = Defaults._Value.Get();
	MinValue = Defaults._MinValue.Get().Get(0.0f);
	MaxValue = Defaults._MaxValue.Get().Get(0.0f);
	MinSliderValue = Defaults._MinSliderValue.Get().Get(0.0f);
	MaxSliderValue = Defaults._MaxSliderValue.Get().Get(0.0f);
	Delta = Defaults._Delta.Get();
	SliderExponent = Defaults._SliderExponent.Get();
	MinDesiredWidth = Defaults._MinDesiredWidth.Get();
	ClearKeyboardFocusOnCommit = Defaults._ClearKeyboardFocusOnCommit.Get();
	SelectAllTextOnCommit = Defaults._SelectAllTextOnCommit.Get();

	WidgetStyle = *Defaults._Style;
	ForegroundColor = FSlateColor(FLinearColor::Black);
}
TSharedRef< FSlateStyleSet > FCrashReportClientStyle::Create()
{
	TSharedRef<FSlateStyleSet> StyleRef = MakeShareable(new FSlateStyleSet("CrashReportClientStyle"));
	FSlateStyleSet& Style = StyleRef.Get();

	const FTextBlockStyle DefaultText = FTextBlockStyle()
		.SetFont(TTF_FONT("Fonts/Roboto-Black", 10))
		.SetColorAndOpacity(FSlateColor::UseForeground())
		.SetShadowOffset(FVector2D::ZeroVector)
		.SetShadowColorAndOpacity(FLinearColor::Black);

	// Set the client app styles
	Style.Set(TEXT("Code"), FTextBlockStyle(DefaultText)
		.SetFont(TTF_FONT("Fonts/DroidSansMono", 8))
		.SetColorAndOpacity(FSlateColor(FLinearColor::White * 0.8f))
	);

	Style.Set(TEXT("Title"), FTextBlockStyle(DefaultText)
		.SetFont(TTF_FONT("Fonts/Roboto-Bold", 12))
	);

	Style.Set(TEXT("Status"), FTextBlockStyle(DefaultText)
		.SetColorAndOpacity(FSlateColor::UseSubduedForeground())
	);

	return StyleRef;
}
Ejemplo n.º 6
0
FSlateColor FPropertyEditorToolkit::GetPinColorAndOpacity( const TWeakPtr< IPropertyTreeRow > Row ) const
{
	if ( Row.IsValid() && ( Row.Pin()->IsCursorHovering() || IsExposedAsColumn( Row ) ) )
	{
		return FSlateColor( FLinearColor::White );
	}

	return PinColor;
}
void USlateBrushAsset::PostLoad()
{
	Super::PostLoad();

	if ( Brush.Tint_DEPRECATED != FLinearColor::White )
	{
		Brush.TintColor = FSlateColor( Brush.Tint_DEPRECATED );
	}
}
void FColorStructCustomization::MakeHeaderRow( TSharedRef<class IPropertyHandle>& InStructPropertyHandle, FDetailWidgetRow& Row )
{
	// We'll set up reset to default ourselves
	const bool bDisplayResetToDefault = false;
	const FString DisplayNameOverride = TEXT("");

	FSlateFontInfo NormalText = IDetailLayoutBuilder::GetDetailFont();

	Row.NameContent()
	[
		StructPropertyHandle->CreatePropertyNameWidget( DisplayNameOverride, bDisplayResetToDefault )
	]
	.ValueContent()
	.MinDesiredWidth(250.0f)
	.MaxDesiredWidth(250.0f)
	[
		SNew( SHorizontalBox )
		+ SHorizontalBox::Slot()
		.VAlign(VAlign_Center)
		[
			SNew( SOverlay )
			+SOverlay::Slot()
			[
				// Displays the color with alpha unless it is ignored
				SAssignNew( ColorPickerParentWidget, SColorBlock )
				.Color( this, &FColorStructCustomization::OnGetColorForColorBlock )
				.ShowBackgroundForAlpha(true)
				.IgnoreAlpha( bIgnoreAlpha )
				.OnMouseButtonDown( this, &FColorStructCustomization::OnMouseButtonDownColorBlock )
				.Size( FVector2D( 35.0f, 12.0f ) )
			]
			+SOverlay::Slot()
			.HAlign(HAlign_Center)
			.VAlign(VAlign_Center)
			[
				SNew( STextBlock )
				.Text(NSLOCTEXT("PropertyEditor", "MultipleValues", "Multiple Values"))
				.Font(NormalText)
				.ColorAndOpacity(FSlateColor(FLinearColor::Black)) // we know the background is always white, so can safely set this to black
				.Visibility(this, &FColorStructCustomization::GetMultipleValuesTextVisibility)
			]
		]
		+ SHorizontalBox::Slot()
		.VAlign(VAlign_Center)
		[
			// Displays the color without alpha
			SNew( SColorBlock )
			.Color( this, &FColorStructCustomization::OnGetColorForColorBlock )
			.ShowBackgroundForAlpha(false)
			.IgnoreAlpha(true)
			.OnMouseButtonDown( this, &FColorStructCustomization::OnMouseButtonDownColorBlock )
			.Size( FVector2D( 35.0f, 12.0f ) )
		]
	];
}
FSlateColor SPropertyEditorAsset::GetAssetClassColor()
{
	FAssetToolsModule& AssetToolsModule = FModuleManager::LoadModuleChecked<FAssetToolsModule>(TEXT("AssetTools"));	
	TWeakPtr<IAssetTypeActions> AssetTypeActions = AssetToolsModule.Get().GetAssetTypeActionsForClass(GetDisplayedClass());
	if(AssetTypeActions.IsValid())
	{
		return FSlateColor(AssetTypeActions.Pin()->GetTypeColor());
	}

	return FSlateColor::UseForeground();
}
FSlateColor FTileSetDetailsCustomization::GetCellDimensionHeaderColor() const
{
	if (UPaperTileSet* TileSet = TileSetPtr.Get())
	{
		if (TileSet->GetTileCount() == 0)
		{
			return FSlateColor(FLinearColor::Red);
		}
	}

	return FSlateColor::UseForeground();
}
Ejemplo n.º 11
0
FSlateColor SFriendsList::GetActionButtonFontColor(const FFriendsAndChatStyle& FriendStyle, EFriendActionLevel ActionLevel)
{
	switch (ActionLevel)
	{
	case EFriendActionLevel::Critical:
	case EFriendActionLevel::Emphasis:
		return FSlateColor::UseForeground();
	case EFriendActionLevel::Action:
	default:
		return FSlateColor(FriendStyle.FriendListActionFontColor);
	}
}
Ejemplo n.º 12
0
FSlateColor Fixup(const FSlateColor& Src)
{
	Prepare();

	if (Src.IsColorSpecified())
	{
		return FSlateColor(Src.GetSpecifiedColor());
	}
	else
	{
		return Src;
	}
}
void SARInventoryItemWidget::Construct(const FArguments& InArgs)
{
	PlayerController = InArgs._PlayerController;
	InventoryItem = InArgs._InventoryItem;
	Inventory = InArgs._Inventory;
	Equipment = InArgs._Equipment;

	TextColor = FSlateColor(FLinearColor(1, 0, 0, 1));
	SlotType = InArgs._SlotType;
	SlotName = InArgs._SlotName;
	//	EquipmentSlot = InArgs._EquipmentSlot;
	InventoryItem = InArgs._InventoryItem;
	LootedObject = InArgs._LootedObject;

	ItemInThisSlot = nullptr;

	SpawnItem();

	ChildSlot
		[

			SNew(SBorder)
			.BorderBackgroundColor(FSlateColor(FLinearColor(1, 0, 0, 1)))
			[
				SNew(SOverlay)
				+ SOverlay::Slot()
				[
					SNew(SImage)
					.Image(this, &SARInventoryItemWidget::GetImage)
				]
				+ SOverlay::Slot()
					[
						SNew(STextBlock)
						.Text(SlotName)
					]
			]
		];
}
Ejemplo n.º 14
0
FSlateColor SGraphPin::GetPinColor() const
{
	if(GraphPinObj->bIsDiffing)
	{
		return FSlateColor(FLinearColor(0.9f,0.2f,0.15f));
	}
	const UEdGraphSchema* Schema = GraphPinObj->GetSchema();
	if(!GetPinObj()->GetOwningNode()->bIsNodeEnabled)
	{
		return Schema->GetPinTypeColor(GraphPinObj->PinType) * FLinearColor(1.0f, 1.0f, 1.0f, 0.5f);
	}

	return Schema->GetPinTypeColor(GraphPinObj->PinType) * PinColorModifier;
}
Ejemplo n.º 15
0
bool FSlateColor::SerializeFromMismatchedTag( const FPropertyTag& Tag, FArchive& Ar )
{
	if (Tag.Type == NAME_StructProperty)
	{
		if (Tag.StructName == NAME_Color)
		{
			FColor OldColor;
			Ar << OldColor;
			*this = FSlateColor(FLinearColor(OldColor));

			return true;
		}
		else if(Tag.StructName == NAME_LinearColor)
		{
			FLinearColor OldColor;
			Ar << OldColor;
			*this = FSlateColor(OldColor);

			return true;
		}
	}

	return false;
}
Ejemplo n.º 16
0
void FPropertyEditorToolkit::TickPinColorAndOpacity()
{
	bool IsRowBeingHoveredOver = false;
	for (int Index = PinRows.Num() - 1; Index >= 0 ; Index--)
	{
		TSharedPtr< IPropertyTreeRow > Row = PinRows[ Index ].Pin();
		if ( Row.IsValid() )
		{
			IsRowBeingHoveredOver |= Row->IsCursorHovering();

			if ( IsRowBeingHoveredOver )
			{
				break;
			}
		}
		else
		{
			PinRows.RemoveAt( Index );
		}
	}

	if ( IsRowBeingHoveredOver )
	{
		PinSequence.JumpToStart();
	}

	float Opacity = 0.0f;
	if ( !TableHasCustomColumns() )
	{
		Opacity = PinSequence.GetLerp();
	}

	if ( !PinSequence.IsPlaying() )
	{
		if ( PinSequence.IsAtStart() )
		{
			PinSequence.Play();
		}
		else
		{
			PinSequence.PlayReverse();
		}
	}

	PinColor = FSlateColor( FColor( 255, 255, 255, FMath::Lerp( 0, 200, Opacity ) ).ReinterpretAsLinear() );
}
Ejemplo n.º 17
0
void UBrainLevelSelectionMenuWidget::FillLevelsList(UScrollBox* container)
{
	UWorld* world = GetWorld();
	if (world)
	{
		FString path = FPaths::GameContentDir();
		path += "/FirstPerson/Maps";

		FString pathNFilter = path + "/" + "*.umap";
		IFileManager::Get().FindFiles(_levelList, *pathNFilter, true, true);

		FString mainMenuMap = FString("MainMenu.umap");
		_levelList.Remove(mainMenuMap);

		USlateWidgetStyleAsset* slateStyle = LoadObject<USlateWidgetStyleAsset>(nullptr, TEXT("/Game/FirstPerson/Menus/BrainButtonStyle.BrainButtonStyle"),nullptr,LOAD_None,nullptr);
		const FButtonStyle* btnStyle = slateStyle->GetStyle<FButtonStyle>();
		FLinearColor color = FLinearColor(1,0.255,0,1);
		FSlateColor slateColor = FSlateColor(color);

		for (FString name : _levelList)
		{
			UBrainLevelButtonWidget* btn = NewObject<UBrainLevelButtonWidget>(this);
			btn->WidgetStyle = *btnStyle;
			
			UTextBlock* text = NewObject<UTextBlock>(btn, FName("text"));
			text->ColorAndOpacity = slateColor;
			
			name.RemoveFromEnd(".umap");

			text->SetText(FText::FromString(name));
			btn->AddChild(text);
			container->AddChild(btn);
		}

		TArray<UPanelSlot*> slots = container->GetSlots();
		for (UPanelSlot* slot : slots)
		{
			if (UScrollBoxSlot* sSlot = Cast<UScrollBoxSlot>(slot))
				sSlot->SetPadding(FMargin(0, 0, 0, 5.0f));
		}
	}
}
Ejemplo n.º 18
0
TSharedRef< FSlateStyleSet > FCrashReportClientStyle::Create()
{
	TSharedRef<FSlateStyleSet> StyleRef = MakeShareable(new FSlateStyleSet("CrashReportClientStyle"));
	FSlateStyleSet& Style = StyleRef.Get();

	const FTextBlockStyle DefaultText = FTextBlockStyle()
		.SetFont(TTF_FONT("Fonts/Roboto-Bold", 10))
		.SetColorAndOpacity(FSlateColor::UseForeground())
		.SetShadowOffset(FVector2D::ZeroVector)
		.SetShadowColorAndOpacity(FLinearColor::Black);

	// Set the client app styles
	Style.Set(TEXT("Code"), FTextBlockStyle(DefaultText)
		.SetFont(TTF_FONT("Fonts/Roboto-Regular", 8))
		.SetColorAndOpacity(FSlateColor(FLinearColor::White * 0.8f))
	);

	Style.Set(TEXT("Title"), FTextBlockStyle(DefaultText)
		.SetFont(TTF_FONT("Fonts/Roboto-Bold", 12))
	);

	Style.Set(TEXT("Status"), FTextBlockStyle(DefaultText)
		.SetColorAndOpacity(FSlateColor::UseSubduedForeground())
	);

	const FVector2D Icon16x16( 16.0f, 16.0f );
	FSlateBrush* GenericWhiteBox = new IMAGE_BRUSH( "Old/White", Icon16x16 );

	// SEditableTextBox defaults...
	const FScrollBarStyle& ScrollBarStyle = FCoreStyle::Get().GetWidgetStyle<FScrollBarStyle>( "ScrollBar" );
	const FEditableTextBoxStyle NormalEditableTextBoxStyle = FEditableTextBoxStyle()
		.SetBackgroundImageNormal( *GenericWhiteBox )
		.SetBackgroundImageHovered( *GenericWhiteBox )
		.SetBackgroundImageFocused( *GenericWhiteBox )
		.SetBackgroundImageReadOnly( *GenericWhiteBox )
		.SetScrollBarStyle( ScrollBarStyle );
	{
		Style.Set( "NormalEditableTextBox", NormalEditableTextBoxStyle );
	}

	return StyleRef;
}
//------------------------------------------------------------------------------
FSlateBrush const* FBlueprintDragDropMenuItem::GetMenuIcon(FSlateColor& ColorOut)
{
	FSlateBrush const* IconBrush = nullptr;
	ColorOut = FSlateColor(FLinearColor::White);

	UBlueprintNodeSpawner const* SampleAction = GetSampleAction();
	if (UBlueprintDelegateNodeSpawner const* DelegateSpawner = Cast<UBlueprintDelegateNodeSpawner const>(SampleAction))
	{
		IconBrush = FEditorStyle::GetBrush(TEXT("GraphEditor.Delegate_16x"));
	}
	else if (UBlueprintVariableNodeSpawner const* VariableSpawner = Cast<UBlueprintVariableNodeSpawner const>(SampleAction))
	{
		if (UProperty const* Property = VariableSpawner->GetVarProperty())
		{
			UStruct* const PropertyOwner = CastChecked<UStruct>(Property->GetOuterUField());
			IconBrush = FBlueprintEditor::GetVarIconAndColor(PropertyOwner, Property->GetFName(), ColorOut);
		}
	}
	return IconBrush;
}
Ejemplo n.º 20
0
	FSlateColor GetHintBackgroundColor() const
	{
		const FLinearColor Color = HintColorAndOpacity.Get();
		return FSlateColor( FLinearColor( Color.R, Color.G, Color.B, FMath::Lerp( 0.0f, 0.5f, Color.A ) ) );
	}
void SARInventoryItemWidget::OnMouseLeave(const FPointerEvent& MouseEvent)
{
	TextColor = FSlateColor(FLinearColor(1, 0, 0, 1));
}
FSlateColor SAssetDiscoveryIndicator::GetBorderBackgroundColor() const
{
	return FSlateColor(FLinearColor(1, 1, 1, 0.8f * FadeCurve.GetLerp()));
}
FSlateColor FSequencerFolderNode::GetIconColor() const
{
	return FSlateColor(MovieSceneFolder.GetFolderColor());
}
Ejemplo n.º 24
0
FSlateColor FScriptExecutionInstance::GetInstanceIconColor() const
{
	return FSlateColor(IsObservedObjectValid() ? IconColor : FLinearColor(1.f, 1.f, 1.f, 0.3f));
}
void SARCharacterSheetWidget::Construct(const FArguments& InArgs)
{
	OwnerHUD = InArgs._OwnerHUD;
	MyPC = InArgs._MyPC;
	Character = InArgs._Character;
	Equipment = InArgs._Equipment;
	SyncLeftHandWeapons();
	SyncRightHandWeapons();
	SyncEquipmentWeapons();
	ChildSlot
		[
			SNew(SGridPanel)
			+ SGridPanel::Slot(1, 1)
			.ColumnSpan(6)
			[
				SNew(SBorder) //add visibility check
				.BorderBackgroundColor(FSlateColor(FLinearColor(1, 0, 0, 1)))
				[
					SNew(SOverlay)
					+ SOverlay::Slot()
					[
						SNew(SBox)
						.HeightOverride(52)
						.WidthOverride(400)
						[
							SAssignNew(LeftWeapon, STileView<TSharedPtr<FARDragDropInfo>>)
							.ListItemsSource(&LeftHandWeapons)
							.OnGenerateTile(this, &SARCharacterSheetWidget::MakeLeftHandWeaponWidget)
							.ItemHeight(50)
							.ItemWidth(50)
						]
					]
				]
			]
			+ SGridPanel::Slot(1, 2)
			.ColumnSpan(6)
			[
				SNew(SBorder) //add visibility check
				.BorderBackgroundColor(FSlateColor(FLinearColor(1, 0, 0, 1)))
				[
					SNew(SOverlay)
					+ SOverlay::Slot()
					[
						SNew(SBox)
						.HeightOverride(52)
						.WidthOverride(400)
						[
							SAssignNew(RightWeapon, STileView<TSharedPtr<FARDragDropInfo>>)
							.ListItemsSource(&RightHandWeapons)
							.OnGenerateTile(this, &SARCharacterSheetWidget::MakeRightHandWeaponWidget)
							.ItemHeight(50)
							.ItemWidth(50)
						]
					]
				]
			]
			+ SGridPanel::Slot(1, 3)
			.ColumnSpan(6)
			[
				SNew(SBorder) //add visibility check
				.BorderBackgroundColor(FSlateColor(FLinearColor(1, 0, 0, 1)))
				[
					SNew(SOverlay)
					+ SOverlay::Slot()
					[
						SNew(SBox)
						.HeightOverride(52)
						.WidthOverride(400)
						[
							SAssignNew(EquipmentSlot, STileView<TSharedPtr<FARDragDropInfo>>)
							.ListItemsSource(&EquipmentSlots)
							.OnGenerateTile(this, &SARCharacterSheetWidget::MakeEquipmentSlotsWeaponWidget)
							.ItemHeight(50)
							.ItemWidth(50)
						]
					]
				]
			]

		];
}
Ejemplo n.º 26
0
void FPropertyEditorToolkit::Initialize( const EToolkitMode::Type Mode, const TSharedPtr< class IToolkitHost >& InitToolkitHost, const TArray<UObject*>& ObjectsToEdit )
{
	CreatePropertyTree();
	CreatePropertyTable();

	TArray< UObject* > AdjustedObjectsToEdit;
	for( auto ObjectIter = ObjectsToEdit.CreateConstIterator(); ObjectIter; ++ObjectIter )
	{
		//@todo Remove this and instead extend the blueprints Edit Defaults editor to use a Property Table as well [12/6/2012 Justin.Sargent]
		UObject* Object = *ObjectIter;
		if ( Object->IsA( UBlueprint::StaticClass() ) )
		{
			UBlueprint* Blueprint = Cast<UBlueprint>( Object );

			// Make sure that the generated class is valid, in case the super has been removed, and this class can't be loaded.
			if( Blueprint->GeneratedClass != NULL )
			{
				AdjustedObjectsToEdit.Add( Blueprint->GeneratedClass->GetDefaultObject() );
			}
		}
		else
		{
			AdjustedObjectsToEdit.Add( Object );
		}
	}

	PropertyTable->SetObjects( AdjustedObjectsToEdit );
	TableColumnsChanged();

	TSharedRef<FTabManager::FLayout> StandaloneDefaultLayout = FTabManager::NewLayout( "Standalone_PropertyEditorToolkit_Layout" )
	->AddArea
	(
		FTabManager::NewPrimaryArea() ->SetOrientation(Orient_Horizontal)
		->Split
		(
			FTabManager::NewStack()
			->SetSizeCoefficient(0.8f)
			->AddTab(GridTabId, ETabState::OpenedTab)
		)
		->Split
		(
			FTabManager::NewStack()
			->SetSizeCoefficient(0.2f)
			->SetHideTabWell( true )
			->AddTab(TreeTabId, ETabState::OpenedTab)
		)
	);

	const bool bCreateDefaultStandaloneMenu = true;
	const bool bCreateDefaultToolbar = false;
	FAssetEditorToolkit::InitAssetEditor( Mode, InitToolkitHost, ApplicationId, StandaloneDefaultLayout, bCreateDefaultStandaloneMenu, bCreateDefaultToolbar, AdjustedObjectsToEdit );

	TArray< TWeakObjectPtr<UObject> > AdjustedObjectsToEditWeak;
	for( auto ObjectIter = AdjustedObjectsToEdit.CreateConstIterator(); ObjectIter; ++ObjectIter )
	{
		AdjustedObjectsToEditWeak.Add(*ObjectIter);
	}
	PropertyTree->SetObjectArray( AdjustedObjectsToEditWeak );

	PinColor = FSlateColor( FLinearColor( 1, 1, 1, 0 ) );
	GEditor->GetTimerManager()->SetTimer( TimerHandle_TickPinColor, FTimerDelegate::CreateSP(this, &FPropertyEditorToolkit::TickPinColorAndOpacity), 0.1f, true );
}
TSharedRef< FSlateStyleSet > FAllarBuilderClientStyle::Create()
{
	const FVector2D Icon16x16(16.0f, 16.0f);
	const FVector2D Icon32x32(32.0f, 32.0f);
	const FVector2D Icon48x48(48.0f, 48.0f);
	const FVector2D Icon64x64(64.0f, 64.0f);

	TSharedRef<FSlateStyleSet> StyleRef = MakeShareable(new FSlateStyleSet("FAllarBuilderClientStyle"));
	FSlateStyleSet& Style = StyleRef.Get();

	const FTextBlockStyle DefaultText = FTextBlockStyle()
		.SetFont(TTF_FONT("Fonts/Roboto-Regular", 10))
		.SetColorAndOpacity(FSlateColor::UseForeground())
		.SetShadowOffset(FVector2D::ZeroVector)
		.SetShadowColorAndOpacity(FLinearColor::Black);

	// Set the client app styles
	Style.Set(TEXT("Background"), new IMAGE_BRUSH("Common/NoiseBackground", Icon64x64, FLinearColor(1,1,1,1), ESlateBrushTileType::Both));

	Style.Set(TEXT("ProjectPicker.Text"), FTextBlockStyle(DefaultText)
		.SetFont(TTF_FONT("Fonts/Roboto-Regular", 24))
		);
	
	Style.Set(TEXT("ProjectPicker.ErrorImage"), new IMAGE_BRUSH("Icons/icon_error_16x", Icon32x32));

	Style.Set(TEXT("Section.Label"), FTextBlockStyle(DefaultText)
		.SetFont(TTF_FONT("Fonts/Roboto-Bold", 18))
		);

	Style.Set(TEXT("Section.Border"), new BOX_BRUSH("Common/GroupBorder", FMargin(4.0f / 16.0f)));

	Style.Set(TEXT("Section.Text"), FTextBlockStyle(DefaultText)
		.SetFont(TTF_FONT("Fonts/Roboto-Regular", 10))
		);


	Style.Set(TEXT("Code"), FTextBlockStyle(DefaultText)
		.SetFont(TTF_FONT("Fonts/Roboto-Regular", 8))
		.SetColorAndOpacity(FSlateColor(FLinearColor::White * 0.8f))
		);

	Style.Set(TEXT("Title"), FTextBlockStyle(DefaultText)
		.SetFont(TTF_FONT("Fonts/Roboto-Bold", 12))
		);

	Style.Set(TEXT("Status"), FTextBlockStyle(DefaultText)
		.SetColorAndOpacity(FSlateColor::UseSubduedForeground())
		);

	FSlateBrush* GenericWhiteBox = new IMAGE_BRUSH("Old/White", Icon16x16);

	// Scrollbar
	const FScrollBarStyle ScrollBar = FScrollBarStyle()
		.SetVerticalTopSlotImage(IMAGE_BRUSH("Common/Scrollbar_Background_Vertical", FVector2D(8, 8)))
		.SetVerticalBottomSlotImage(IMAGE_BRUSH("Common/Scrollbar_Background_Vertical", FVector2D(8, 8)))
		.SetHorizontalTopSlotImage(IMAGE_BRUSH("Common/Scrollbar_Background_Horizontal", FVector2D(8, 8)))
		.SetHorizontalBottomSlotImage(IMAGE_BRUSH("Common/Scrollbar_Background_Horizontal", FVector2D(8, 8)))
		.SetNormalThumbImage(BOX_BRUSH("Common/Scrollbar_Thumb", FMargin(4.f / 16.f)))
		.SetDraggedThumbImage(BOX_BRUSH("Common/Scrollbar_Thumb", FMargin(4.f / 16.f)))
		.SetHoveredThumbImage(BOX_BRUSH("Common/Scrollbar_Thumb", FMargin(4.f / 16.f)));

	// SEditableTextBox defaults...
	const FEditableTextBoxStyle NormalEditableTextBoxStyle = FEditableTextBoxStyle()
		.SetBackgroundImageNormal(*GenericWhiteBox)
		.SetBackgroundImageHovered(*GenericWhiteBox)
		.SetBackgroundImageFocused(*GenericWhiteBox)
		.SetBackgroundImageReadOnly(*GenericWhiteBox)
		.SetScrollBarStyle(ScrollBar);
	{
		Style.Set("NormalEditableTextBox", NormalEditableTextBoxStyle);
	}

	// RichText
	const FTextBlockStyle AllarBuilderDataStyle = FTextBlockStyle()
		.SetFont(TTF_FONT("Testing/Fonts/Roboto-Italic", 9))
		.SetColorAndOpacity(FSlateColor(FLinearColor::White * 0.5f))
		.SetShadowOffset(FVector2D::ZeroVector)
		.SetShadowColorAndOpacity(FLinearColor::Black);

	Style.Set("AllarBuilderDataStyle", AllarBuilderDataStyle);

	FButtonStyle DarkHyperlinkButton = FButtonStyle()
		.SetNormal(BORDER_BRUSH("Old/HyperlinkDotted", FMargin(0, 0, 0, 3 / 16.0f), FSlateColor(FLinearColor::White * 0.5f)))
		.SetPressed(FSlateNoResource())
		.SetHovered(BORDER_BRUSH("Old/HyperlinkUnderline", FMargin(0, 0, 0, 3 / 16.0f), FSlateColor(FLinearColor::White * 0.5f)));

	const FHyperlinkStyle DarkHyperlink = FHyperlinkStyle()
		.SetUnderlineStyle(DarkHyperlinkButton)
		.SetTextStyle(AllarBuilderDataStyle)
		.SetPadding(FMargin(0.0f));

	Style.Set("RichText.Hyperlink", DarkHyperlink);

	return StyleRef;
}
Ejemplo n.º 28
0
FSlateColor SWorldHierarchyItem::GetDrawColor() const
{
	return FSlateColor(LevelModel->GetLevelColor());
}
Ejemplo n.º 29
0
FSlateColor SGraphPinObject::OnGetWidgetBackground() const
{
	float Alpha = IsHovered() ? GraphPinObjectDefs::ActivePinBackgroundAlpha : GraphPinObjectDefs::InactivePinBackgroundAlpha;
	return FSlateColor( FLinearColor( 1.f, 1.f, 1.f, Alpha ) );
}
Ejemplo n.º 30
0
FSlateColor SGraphPinObject::OnGetComboForeground() const
{
	float Alpha = IsHovered() ? GraphPinObjectDefs::ActiveComboAlpha : GraphPinObjectDefs::InActiveComboAlpha;
	return FSlateColor( FLinearColor( 1.f, 1.f, 1.f, Alpha ) );
}