Here is the error i get in log when the editor crash :
Address = 0xe4a1b476 (filename not found) [in E:\Programs\Unreal Engine\4.0\Engine\Binaries\Win64\UE4Editor-Core.dll]
Address = 0xe48bf675 (filename not found) [in E:\Programs\Unreal Engine\4.0\Engine\Binaries\Win64\UE4Editor-Core.dll]
FDE_Style::Get() 0xdbe8f481 + 45 bytes [File=e:\elzean documents\documents\unreal projects\fps_inventory\source\fps_inventory\private\ui\style\de_style.cpp:73] [in E:\Elzean Documents\Documents\Unreal Projects\FPS_Inventory\Binaries\Win64\UE4Editor-FPS_Inventory.dll]
SDE_InventorySlotWidget::GetButtonImage() 0xdbe96d98 + 5 bytes [File=e:\elzean documents\documents\unreal projects\fps_inventory\source\fps_inventory\private\ui\widgets\de_inventoryslotwidget.cpp:144] [in E:\Elzean Documents\Documents\Unreal Projects\FPS_Inventory\Binaries\Win64\UE4Editor-FPS_Inventory.dll]
TBaseSPMethodDelegateInstance_RetVal_NoParams_Const<SDE_InventorySlotWidget,FSlateBrush const * __ptr64,0>::Execute() 0xdbe96772 + 12 bytes [File=e:\programs\unrealengine-4.0\engine\source\runtime\core\public emplates\delegateinstancesimpl.inl:223] [in E:\Elzean Documents\Documents\Unreal Projects\FPS_Inventory\Binaries\Win64\UE4Editor-FPS_Inventory.dll]
Address = 0xe40c7633 (filename not found) [in E:\Programs\Unreal Engine\4.0\Engine\Binaries\Win64\UE4Editor-Slate.dll]
Address = 0xe41ba007 (filename not found) [in E:\Programs\Unreal Engine\4.0\Engine\Binaries\Win64\UE4Editor-Slate.dll]
I followed the StrategyGame example for most of my c++ classes, and i also took everything inside the UI folder.
The problem at line 144 of de_inventoryslotwidget.cpp is the “GetBrush” :
const FSlateBrush* SDE_InventorySlotWidget::GetButtonImage() const
{
if (ButtonImage.IsValid())
{
return ButtonImage.Get();
}
else
{
return FDE_Style::Get().GetBrush("InventorySlotBrush");
}
}
And my DE_Style follow what is done in the StrategyGame :
// Copyright 1998-2014 Epic Games, Inc. All Rights Reserved.
#include "FPS_Inventory.h"
#include "DE_Style.h"
#include "SlateGameResources.h"
TSharedPtr< FSlateStyleSet > FDE_Style::DE_StyleInstance = NULL;
void FDE_Style::Initialize()
{
if (!DE_StyleInstance.IsValid())
{
DE_StyleInstance = Create();
FSlateStyleRegistry::RegisterSlateStyle(*DE_StyleInstance);
}
}
void FDE_Style::Shutdown()
{
FSlateStyleRegistry::UnRegisterSlateStyle(*DE_StyleInstance);
ensure(DE_StyleInstance.IsUnique());
DE_StyleInstance.Reset();
}
FName FDE_Style::GetStyleSetName()
{
static FName StyleSetName(TEXT("DE_Style"));
return StyleSetName;
}
#define IMAGE_BRUSH( RelativePath, ... ) FSlateImageBrush( FPaths::GameContentDir() / "Slate"/ RelativePath + TEXT(".png"), __VA_ARGS__ )
#define BOX_BRUSH( RelativePath, ... ) FSlateBoxBrush( FPaths::GameContentDir() / "Slate"/ RelativePath + TEXT(".png"), __VA_ARGS__ )
#define BORDER_BRUSH( RelativePath, ... ) FSlateBorderBrush( FPaths::GameContentDir() / "Slate"/ RelativePath + TEXT(".png"), __VA_ARGS__ )
#define TTF_FONT( RelativePath, ... ) FSlateFontInfo( FPaths::GameContentDir() / "Slate"/ RelativePath + TEXT(".ttf"), __VA_ARGS__ )
#define OTF_FONT( RelativePath, ... ) FSlateFontInfo( FPaths::GameContentDir() / "Slate"/ RelativePath + TEXT(".otf"), __VA_ARGS__ )
TSharedRef< FSlateStyleSet > FDE_Style::Create()
{
TSharedRef<FSlateStyleSet> StyleRef = FSlateGameResources::New(FDE_Style::GetStyleSetName(), "/Game/UI/Styles", "/Game/UI/Styles");
FSlateStyleSet& Style = StyleRef.Get();
const FLinearColor GoldColor(FColor(255,213,160));
// Fonts still need to be specified in code for now
Style.Set("FPS_Inventory.MenuFont", TTF_FONT("Fonts/Roboto-Black", 32));
Style.Set("FPS_Inventory.ResourcesTextStyle", FTextBlockStyle()
.SetFont(TTF_FONT("Fonts/Roboto-Regular", 40))
.SetColorAndOpacity(GoldColor)
.SetShadowColorAndOpacity(FLinearColor::Black)
.SetShadowOffset(FIntPoint(-1,1))
);
Style.Set("FPS_Inventory.ButtonFont", TTF_FONT("Fonts/Roboto-Black", 18));
return StyleRef;
}
#undef IMAGE_BRUSH
#undef BOX_BRUSH
#undef BORDER_BRUSH
#undef TTF_FONT
#undef OTF_FONT
void FDE_Style::ReloadTextures()
{
FSlateApplication::Get().GetRenderer()->ReloadTextureResources();
}
const ISlateStyle& FDE_Style::Get()
{
return *DE_StyleInstance;
}
If i remove the widget using the brush everything else work.
Here is a pic of the brush in the editor :
Can someone see or think of something i’m doing wrong here ?
Thanks !