I create a button widget, which i can add to my inventory widget
I add button which this:
In the game it looks like:
But if i click on the button nothing happend, when my mouse cursor is on the button it remain unchanged
I create a button widget, which i can add to my inventory widget
I add button which this:
In the game it looks like:
But if i click on the button nothing happend, when my mouse cursor is on the button it remain unchanged
{
if (InventoryClass)
{
if (!IsValid(InventoryWidget))
{
InventoryWidget = CreateWidget(this, InventoryClass);
if (IsValid(InventoryWidget))
{
InventoryWidget->AddToViewport();
bIsMenuOpen = true;
bShowMouseCursor = true;
FInputModeUIOnly Mode;
Mode.SetWidgetToFocus(InventoryWidget->TakeWidget());
}
}
else if (IsValid(InventoryWidget) && !InventoryWidget->IsInViewport())
{
InventoryWidget->AddToViewport();
bIsMenuOpen = true;
bShowMouseCursor = true;
FInputModeUIOnly Mode;
Mode.SetWidgetToFocus(InventoryWidget->TakeWidget());
}
else if (IsValid(InventoryWidget) && InventoryWidget->IsInViewport())
{
bIsMenuOpen = false;
InventoryWidget->RemoveFromParent();
bShowMouseCursor = false;
FInputModeGameOnly InputMode;
SetInputMode(InputMode);
}
}
function to open inventory