// Fill out your copyright notice in the Description page of Project Settings.
#pragma once
#include "CoreMinimal.h"
#include "Kismet/BlueprintFunctionLibrary.h"
#include "PluginCheck.generated.h"
/**
*
*/
UCLASS()
class YOUR_API UPluginCheck : public UBlueprintFunctionLibrary
{
GENERATED_BODY()
UFUNCTION(BlueprintCallable)
static bool CheckStencil();
};
.cpp
// Fill out your copyright notice in the Description page of Project Settings.
#include "PluginCheck.h"
#include "Framework/Notifications/NotificationManager.h"
#include "EditorStyleSet.h"
#include "Widgets/Notifications/SNotificationList.h"
bool UPluginCheck::CheckStencil()
{
if (!GConfig) return false;
FString CustomDepth;
GConfig->GetString(TEXT("/Script/Engine.RendererSettings"), TEXT("r.CustomDepth"), CustomDepth, GEngineIni);
if (CustomDepth == "0")
{
FNotificationInfo Info(FText::FromString("Custom stencil disabled")); //LOCTEXT("CustomStencilDisabled", "Custom stencil disabled")
Info.Image = FEditorStyle::GetBrush(TEXT("LevelEditor.RecompileGameCode"));
Info.FadeInDuration = 2.1f;
Info.FadeOutDuration = 2.5f;
Info.ExpireDuration = 2.5f;
Info.bUseThrobber = false;
Info.bUseSuccessFailIcons = true;
Info.bUseLargeFont = true;
Info.bFireAndForget = false;
Info.bAllowThrottleWhenFrameRateIsLow = false;
auto NotificationItem = FSlateNotificationManager::Get().AddNotification(Info);
NotificationItem->SetCompletionState(SNotificationItem::CS_Fail);
NotificationItem->ExpireAndFadeout();
//GEditor->PlayEditorSound(CompileSuccessSound);
}
//CustomDepth 0 = off
return CustomDepth != "0";
}