102 lines
3.2 KiB
C++
102 lines
3.2 KiB
C++
|
// Copyright Epic Games, Inc. All Rights Reserved.
|
||
|
|
||
|
#include "Messaging/CommonGameDialog.h"
|
||
|
|
||
|
#define LOCTEXT_NAMESPACE "Messaging"
|
||
|
|
||
|
UCommonGameDialogDescriptor* UCommonGameDialogDescriptor::CreateConfirmationOk(const FText& Header, const FText& Body)
|
||
|
{
|
||
|
UCommonGameDialogDescriptor* Descriptor = NewObject<UCommonGameDialogDescriptor>();
|
||
|
Descriptor->Header = Header;
|
||
|
Descriptor->Body = Body;
|
||
|
|
||
|
FConfirmationDialogAction ConfirmAction;
|
||
|
ConfirmAction.Result = ECommonMessagingResult::Confirmed;
|
||
|
ConfirmAction.OptionalDisplayText = LOCTEXT("Ok", "Ok");
|
||
|
|
||
|
Descriptor->ButtonActions.Add(ConfirmAction);
|
||
|
|
||
|
return Descriptor;
|
||
|
}
|
||
|
|
||
|
UCommonGameDialogDescriptor* UCommonGameDialogDescriptor::CreateConfirmationOkCancel(const FText& Header, const FText& Body)
|
||
|
{
|
||
|
UCommonGameDialogDescriptor* Descriptor = NewObject<UCommonGameDialogDescriptor>();
|
||
|
Descriptor->Header = Header;
|
||
|
Descriptor->Body = Body;
|
||
|
|
||
|
FConfirmationDialogAction ConfirmAction;
|
||
|
ConfirmAction.Result = ECommonMessagingResult::Confirmed;
|
||
|
ConfirmAction.OptionalDisplayText = LOCTEXT("Ok", "Ok");
|
||
|
|
||
|
FConfirmationDialogAction CancelAction;
|
||
|
CancelAction.Result = ECommonMessagingResult::Cancelled;
|
||
|
CancelAction.OptionalDisplayText = LOCTEXT("Cancel", "Cancel");
|
||
|
|
||
|
Descriptor->ButtonActions.Add(ConfirmAction);
|
||
|
Descriptor->ButtonActions.Add(CancelAction);
|
||
|
|
||
|
return Descriptor;
|
||
|
}
|
||
|
|
||
|
UCommonGameDialogDescriptor* UCommonGameDialogDescriptor::CreateConfirmationYesNo(const FText& Header, const FText& Body)
|
||
|
{
|
||
|
UCommonGameDialogDescriptor* Descriptor = NewObject<UCommonGameDialogDescriptor>();
|
||
|
Descriptor->Header = Header;
|
||
|
Descriptor->Body = Body;
|
||
|
|
||
|
FConfirmationDialogAction ConfirmAction;
|
||
|
ConfirmAction.Result = ECommonMessagingResult::Confirmed;
|
||
|
ConfirmAction.OptionalDisplayText = LOCTEXT("Yes", "Yes");
|
||
|
|
||
|
FConfirmationDialogAction DeclineAction;
|
||
|
DeclineAction.Result = ECommonMessagingResult::Declined;
|
||
|
DeclineAction.OptionalDisplayText = LOCTEXT("No", "No");
|
||
|
|
||
|
Descriptor->ButtonActions.Add(ConfirmAction);
|
||
|
Descriptor->ButtonActions.Add(DeclineAction);
|
||
|
|
||
|
return Descriptor;
|
||
|
}
|
||
|
|
||
|
UCommonGameDialogDescriptor* UCommonGameDialogDescriptor::CreateConfirmationYesNoCancel(const FText& Header, const FText& Body)
|
||
|
{
|
||
|
UCommonGameDialogDescriptor* Descriptor = NewObject<UCommonGameDialogDescriptor>();
|
||
|
Descriptor->Header = Header;
|
||
|
Descriptor->Body = Body;
|
||
|
|
||
|
FConfirmationDialogAction ConfirmAction;
|
||
|
ConfirmAction.Result = ECommonMessagingResult::Confirmed;
|
||
|
ConfirmAction.OptionalDisplayText = LOCTEXT("Yes", "Yes");
|
||
|
|
||
|
FConfirmationDialogAction DeclineAction;
|
||
|
DeclineAction.Result = ECommonMessagingResult::Declined;
|
||
|
DeclineAction.OptionalDisplayText = LOCTEXT("No", "No");
|
||
|
|
||
|
FConfirmationDialogAction CancelAction;
|
||
|
CancelAction.Result = ECommonMessagingResult::Cancelled;
|
||
|
CancelAction.OptionalDisplayText = LOCTEXT("Cancel", "Cancel");
|
||
|
|
||
|
Descriptor->ButtonActions.Add(ConfirmAction);
|
||
|
Descriptor->ButtonActions.Add(DeclineAction);
|
||
|
Descriptor->ButtonActions.Add(CancelAction);
|
||
|
|
||
|
return Descriptor;
|
||
|
}
|
||
|
|
||
|
UCommonGameDialog::UCommonGameDialog()
|
||
|
{
|
||
|
|
||
|
}
|
||
|
|
||
|
void UCommonGameDialog::SetupDialog(UCommonGameDialogDescriptor* Descriptor, FCommonMessagingResultDelegate ResultCallback)
|
||
|
{
|
||
|
|
||
|
}
|
||
|
|
||
|
void UCommonGameDialog::KillDialog()
|
||
|
{
|
||
|
|
||
|
}
|
||
|
|
||
|
#undef LOCTEXT_NAMESPACE
|