Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PR UE5.1.0 #8

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 15 additions & 8 deletions Source/KantanDocGen/Private/DocGenTaskProcessor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@

#define LOCTEXT_NAMESPACE "KantanDocGen"

#define PLAY_FAIL_SOUND() GEditor->PlayEditorSound(TEXT("/Engine/EditorSounds/Notifications/CompileFailed_Cue.CompileFailed_Cue"))
#define PLAY_SUCC_SOUND() GEditor->PlayEditorSound(TEXT("/Engine/EditorSounds/Notifications/CompileSuccess_Cue.CompileSuccess_Cue"));

FDocGenTaskProcessor::FDocGenTaskProcessor()
{
Expand Down Expand Up @@ -191,17 +193,20 @@ void FDocGenTaskProcessor::ProcessTask(TSharedPtr< FDocGenTask > InTask)
Current->Task->Notification->SetText(LOCTEXT("DocFinalizationFailed", "Doc gen failed"));
Current->Task->Notification->SetCompletionState(SNotificationItem::CS_Fail);
Current->Task->Notification->ExpireAndFadeout();
//GEditor->PlayEditorSound(CompileSuccessSound);
PLAY_FAIL_SOUND();
}

return Result;
};

/*****************************/


Current = MakeUnique< FDocGenCurrentTask >();
Current->Task = InTask;
DocGenThreads::RunOnGameThread([this,InTask]()
{
// Destructor of slate component require in either slate thread or game thread, see SWidget::Invalidate(...)
Current = MakeUnique< FDocGenCurrentTask >();
Current->Task = InTask;
});

FString IntermediateDir = FPaths::ProjectIntermediateDir() / TEXT("KantanDocGen") / Current->Task->Settings.DocumentationTitle;

Expand Down Expand Up @@ -270,8 +275,8 @@ void FDocGenTaskProcessor::ProcessTask(TSharedPtr< FDocGenTask > InTask)
Current->Task->Notification->SetText(LOCTEXT("DocFinalizationFailed", "Doc gen failed - No nodes found"));
Current->Task->Notification->SetCompletionState(SNotificationItem::CS_Fail);
Current->Task->Notification->ExpireAndFadeout();
PLAY_FAIL_SOUND();
});
//GEditor->PlayEditorSound(CompileSuccessSound);
return;
}

Expand Down Expand Up @@ -305,8 +310,8 @@ void FDocGenTaskProcessor::ProcessTask(TSharedPtr< FDocGenTask > InTask)
Current->Task->Notification->SetText(Msg);
Current->Task->Notification->SetCompletionState(SNotificationItem::CS_Fail);
Current->Task->Notification->ExpireAndFadeout();
PLAY_FAIL_SOUND();
});
//GEditor->PlayEditorSound(CompileSuccessSound);
return;
}

Expand All @@ -329,9 +334,9 @@ void FDocGenTaskProcessor::ProcessTask(TSharedPtr< FDocGenTask > InTask)
HyperlinkText
);
Current->Task->Notification->ExpireAndFadeout();
Current.Reset();
PLAY_SUCC_SOUND();
});

Current.Reset();
}

FDocGenTaskProcessor::EIntermediateProcessingResult FDocGenTaskProcessor::ProcessIntermediateDocs(FString const& IntermediateDir, FString const& OutputDir, FString const& DocTitle, bool bCleanOutput)
Expand Down Expand Up @@ -430,5 +435,7 @@ FDocGenTaskProcessor::EIntermediateProcessingResult FDocGenTaskProcessor::Proces
}
}

#undef PLAY_FAIL_SOUND
#undef PLAY_SUCC_SOUND

#undef LOCTEXT_NAMESPACE