2022-05-23 18:41:30 +00:00
|
|
|
// Copyright Epic Games, Inc. All Rights Reserved.
|
|
|
|
|
|
|
|
#include "Messaging/CommonGameDialog.h"
|
|
|
|
|
2022-09-13 07:18:28 +00:00
|
|
|
#include "Internationalization/Internationalization.h"
|
|
|
|
#include "Messaging/CommonMessagingSubsystem.h"
|
|
|
|
|
2022-05-23 18:41:30 +00:00
|
|
|
#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
|