So I’m trying to pass these 2 FText vars and it will only let me pass by reference when I want to pass by value. Why is unreal generating const for these variables?
Current BaseElementWidget.h
UFUNCTION(BlueprintNativeEvent, BlueprintCallable, Category = "Elements")
UUserWidget* AddButton(UBaseElementWidget* &Menu, FName ID, const FText &Caption, const FText &Tooltip);
Desired BaseElementWidget.h
UFUNCTION(BlueprintNativeEvent, BlueprintCallable, Category = "Elements")
UUserWidget* AddButton(UBaseElementWidget* &Menu, FName ID, FText Caption, FText Tooltip);
Error
1>------ Build started: Project: UE4, Configuration: BuiltWithUnrealBuildTool Win32 ------
2>------ Build started: Project: PluginDev, Configuration: Development_Editor x64 ------
2> Creating makefile for hot reloading PluginDevEditor (working set of source files changed)
2> Compiling game modules for hot reload
2> Performing 3 actions (4 in parallel)
2> PluginDev.generated.cpp
2> BaseElementWidget.cpp
2>D:\Documents\Unreal Projects\PluginDev\Intermediate\Build\Win64\UE4Editor\Inc\PluginDev\PluginDev.generated.cpp(103): error C2511: 'UUserWidget *UBaseElementWidget::AddButton(UBaseElementWidget *&,FName,const FText &,const FText &)': overloaded member function not found in 'UBaseElementWidget'
2> D:\Documents\Unreal Projects\PluginDev\Intermediate\Build\Win64\UE4Editor\Inc\PluginDev\MenuEventHandler.generated.h(11): note: see declaration of 'UBaseElementWidget'
2>D:\Documents\Unreal Projects\PluginDev\Intermediate\Build\Win64\UE4Editor\Inc\PluginDev\PluginDev.generated.cpp(109): error C2352: 'UObject::FindFunctionChecked': illegal call of non-static member function
2> d:\programfiles\epic games\4.13\engine\source\runtime\coreuobject\public\uobject\UObject.h(745): note: see declaration of 'UObject::FindFunctionChecked'
2>D:\Documents\Unreal Projects\PluginDev\Source\PluginDev\MUI\Private\BaseElementWidget.cpp(63): error C2511: 'UUserWidget *UBaseElementWidget::AddButton_Implementation(UBaseElementWidget *&,FName,FText,FText)': overloaded member function not found in 'UBaseElementWidget'
2> D:\Documents\Unreal Projects\PluginDev\Intermediate\Build\Win64\UE4Editor\Inc\PluginDev\MenuEventHandler.generated.h(11): note: see declaration of 'UBaseElementWidget'
2>ERROR : UBT error : Failed to produce item: D:\Documents\Unreal Projects\PluginDev\Binaries\Win64\UE4Editor-PluginDev-2187.dll
2> Total build time: 6.75 seconds
2>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.MakeFile.Targets(37,5): error MSB3075: The command ""D:\ProgramFiles\Epic Games\4.13\Engine\Build\BatchFiles\Build.bat" PluginDevEditor Win64 Development "D:\Documents\Unreal Projects\PluginDev\PluginDev.uproject" -waitmutex" exited with code 5. Please verify that you have sufficient rights to run this command.
========== Build: 1 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
Basically I want to pass the FText by value like the bottom function but am being forced to pass by ref with the top function…