Hi,
I am in the process of building an interface for my game. I need to make a content picking system : click on a button and a panel pops up to shows you a list of available content.
I went to the SComboButton class (is this the right choice ?) but I am having trouble getting the code to build. Here is my work.
SNew(SComboButton)
.OnGetMenuContent(this, &SFlareMenu::GetTestContent)
.ButtonContent()
[
SNew(STextBlock)
.Text(FString("Combo box test"))
]
TSharedRef<SWidget> SFlareMenu::GetTestContent() const
{
FMenuBuilder MenuBuilder(true, NULL);
MenuBuilder.AddMenuEntry(
TEXT("Key"),
TEXT("Key tooltip"),
FSlateIcon(),
FUIAction(FExecuteAction::CreateSP(this, &SFlareMenu::VoidFunction))
);
return MenuBuilder.MakeWidget();
}
It is basically copy-pasted from UEâs source code. But it wonât build :
20>D:\UnrealEngine\Engine\Source\Runtime\Core\Public\Misc\Attribute.h(48):
error C2248: âFText::FTextâ : cannot
access private member declared in
class âFTextâ 20>
d:\unrealengine\engine\source\runtime\core\public\internationalization\Text.h(265)
: see declaration of âFText::FTextâ
20>
d:\unrealengine\engine\source\runtime\core\public\internationalization\Text.h(105)
: see declaration of âFTextâ 20>
D:\Flare\Source\Flare\UI\Menus\FlareMenu.cpp(150)
: see reference to function template
instantiation
âTAttribute::TAttribute wchar_t[4]>(OtherType (&))â being
compiled 20> with 20>
[ 20> OtherType=const
wchar_t [4] 20> ] 20>
D:\Flare\Source\Flare\UI\Menus\FlareMenu.cpp(150)
: see reference to function template
instantiation
âTAttribute::TAttribute wchar_t[4]>(OtherType (&))â being
compiled 20> with 20>
[ 20> OtherType=const
wchar_t [4] 20> ] 20>
d:\unrealengine\engine\source\runtime\core\public\internationalization\Text.h(265)
: see declaration of âFText::FTextâ
20>
d:\unrealengine\engine\source\runtime\core\public\internationalization\Text.h(105)
: see declaration of âFTextâ
FlareMenu.cpp:150 refers to the last line of the AddMenuEntry() call (yes, the â;â line).
So whatâs wrong with this code ?
Thanks !