Hey there, I was hoping I could get some help here.
What is my problem exactly? Well, I am making a game using mostly Blueprints, but I wanted to make a C++ class that will obtain the project version from project settings. I can’t just fix the error I am getting.
Here’s the code (VChk stands for VersionCheck):
VChk.h:
// Fill out your copyright notice in the Description page of Project Settings.
#pragma once
#include "CoreMinimal.h"
#include "Kismet/BlueprintFunctionLibrary.h"
#include "VChk.generated.h"
/**
*
*/
UCLASS()
class FORESTOFFALLEN_API UVChk : public UBlueprintFunctionLibrary
{
GENERATED_BODY()
UFUNCTION(BlueprintPure, meta = (FriendlyName = "Project Version", CompactNodeTitle = "PVersion"), Category = "Project")
static FString GetProjectVersion();
};
and VChk.cpp:
// Fill out your copyright notice in the Description page of Project Settings.
#include "VChk.h"
FString UVChk::GetProjectVersion()
{
FString ProjectVersion;
GConfig->GetString(
TEXT("/Script/EngineSettings.GeneralProjectSettings"),
TEXT("ProjectVersion"),
ProjectVersion,
GGameIni
);
return ProjectVersion;
}
Here’s a screenshot:
Thanks in advance.