mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-03-26 22:49:01 +08:00
[ue4] Fixes #2006
Users project recursively generates UIs, which leads to extremely long resource names. Eventually, assigning such a name to a brush results in an assertion being triggered, as the name is too long. Fixed on our end by creating a custom resource name instead of reusing the name of the material. User still has to clean-up their code.
This commit is contained in:
parent
7400da8896
commit
d065c88ca8
@ -45,12 +45,17 @@
|
|||||||
|
|
||||||
using namespace spine;
|
using namespace spine;
|
||||||
|
|
||||||
|
static int brushNameId = 0;
|
||||||
|
|
||||||
// Workaround for https://github.com/EsotericSoftware/spine-runtimes/issues/1458
|
// Workaround for https://github.com/EsotericSoftware/spine-runtimes/issues/1458
|
||||||
// See issue comments for more information.
|
// See issue comments for more information.
|
||||||
struct SpineSlateMaterialBrush : public FSlateBrush {
|
struct SpineSlateMaterialBrush : public FSlateBrush {
|
||||||
SpineSlateMaterialBrush(class UMaterialInterface &InMaterial, const FVector2D &InImageSize)
|
SpineSlateMaterialBrush(class UMaterialInterface &InMaterial, const FVector2D &InImageSize)
|
||||||
: FSlateBrush(ESlateBrushDrawType::Image, FName(TEXT("None")), FMargin(0), ESlateBrushTileType::NoTile, ESlateBrushImageType::FullColor, InImageSize, FLinearColor::White, &InMaterial) {
|
: FSlateBrush(ESlateBrushDrawType::Image, FName(TEXT("None")), FMargin(0), ESlateBrushTileType::NoTile, ESlateBrushImageType::FullColor, InImageSize, FLinearColor::White, &InMaterial) {
|
||||||
ResourceName = FName(*InMaterial.GetFullName());
|
// Workaround for https://github.com/EsotericSoftware/spine-runtimes/issues/2006
|
||||||
|
FString brushName = TEXT("spineslatebrush");
|
||||||
|
brushName.AppendInt(brushNameId++);
|
||||||
|
ResourceName = FName(brushName);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user