void UBTTask_WaitAnswer::SetAnswer(UDialogueButton* DialogueButton)
{
	if (DialogueButton != nullptr && DialogueButton->GetChildrenCount() > 0)
	{
		UTextBlock* TextBlock = Cast<UTextBlock>(DialogueButton->GetChildAt(0));
		if (TextBlock)
		{
			SetAnswer(TextBlock->GetText());
		}
	}
}
Пример #2
0
void UChatboxWidget::AddChat(FString theText)
{
	UWidget* theTextWidget = FindFirstWidget(UTextBlock::StaticClass());
	if (theTextWidget)
	{
		UTextBlock* castedTextWidget = Cast<UTextBlock>(theTextWidget);
		castedTextWidget->SetText(FText::FromString(castedTextWidget->GetText().ToString() + "\n" + theText));
	}
	UWidget* theScrollWidget = FindFirstWidget(UScrollBox::StaticClass());
	if (theScrollWidget)
	{
		UScrollBox* castedScrollWidget = Cast<UScrollBox>(theScrollWidget);
		castedScrollWidget->SetScrollOffset(9999);
	}
}