diff --git a/Content/Buildings/-Shared/BP_ModuleHoloWithCompass_def.uasset b/Content/Buildings/-Shared/BP_ModuleHoloWithCompass_def.uasset index 73c140423..e57ad9038 100644 Binary files a/Content/Buildings/-Shared/BP_ModuleHoloWithCompass_def.uasset and b/Content/Buildings/-Shared/BP_ModuleHoloWithCompass_def.uasset differ diff --git a/Content/Buildings/-Shared/BP_TestArrow.uasset b/Content/Buildings/-Shared/BP_TestArrow.uasset index e7be8b61f..92c6806d4 100644 Binary files a/Content/Buildings/-Shared/BP_TestArrow.uasset and b/Content/Buildings/-Shared/BP_TestArrow.uasset differ diff --git a/Content/Buildings/-Shared/MI_ArrowFont.uasset b/Content/Buildings/-Shared/MI_ArrowFont.uasset new file mode 100644 index 000000000..66f829346 Binary files /dev/null and b/Content/Buildings/-Shared/MI_ArrowFont.uasset differ diff --git a/Content/Buildings/-Shared/MI_UpArrow.uasset b/Content/Buildings/-Shared/MI_UpArrow.uasset index fd9933763..5a2861e25 100644 Binary files a/Content/Buildings/-Shared/MI_UpArrow.uasset and b/Content/Buildings/-Shared/MI_UpArrow.uasset differ diff --git a/Content/Buildings/-Shared/M_ArrowFont.uasset b/Content/Buildings/-Shared/M_ArrowFont.uasset new file mode 100644 index 000000000..9892fd24d Binary files /dev/null and b/Content/Buildings/-Shared/M_ArrowFont.uasset differ diff --git a/Content/Buildings/-Shared/M_ArrowMaterial.uasset b/Content/Buildings/-Shared/M_ArrowMaterial.uasset index 79b0a55df..56c9f8f43 100644 Binary files a/Content/Buildings/-Shared/M_ArrowMaterial.uasset and b/Content/Buildings/-Shared/M_ArrowMaterial.uasset differ diff --git a/Source/FicsItNetworksMisc/Private/ModuleSystem/FINModuleSystemHolo.cpp b/Source/FicsItNetworksMisc/Private/ModuleSystem/FINModuleSystemHolo.cpp index f76bb835b..f5e64d65c 100644 --- a/Source/FicsItNetworksMisc/Private/ModuleSystem/FINModuleSystemHolo.cpp +++ b/Source/FicsItNetworksMisc/Private/ModuleSystem/FINModuleSystemHolo.cpp @@ -8,6 +8,11 @@ AFINModuleSystemHolo::AFINModuleSystemHolo() { PrimaryActorTick.bCanEverTick = true; SetActorTickEnabled(true); + + InformationComponent = CreateDefaultSubobject(TEXT("InformationDisplay")); + InformationComponent->SetupAttachment(RootComponent); + InformationComponent->SetMobility(EComponentMobility::Movable); + InformationComponent->SetCollisionEnabled(ECollisionEnabled::NoCollision); } AFINModuleSystemHolo::~AFINModuleSystemHolo() {} @@ -142,6 +147,19 @@ void AFINModuleSystemHolo::SetHologramLocationAndRotation(const FHitResult& hit) //FVector ArrowLocation = {0, } CompassRose->SetRelativeLocation(ActorLocation); } + if(EnableInformationDisplay && IsValid(InformationComponent)) { + // Roze is having issues getting the Z position correct for the text. + const FVector ModuleSize = getModuleSize(); + InformationComponent->SetMobility(EComponentMobility::Movable); + InformationComponent->SetCollisionEnabled(ECollisionEnabled::NoCollision); + FVector ActorLocation = { (ModuleSize.X - 1) * 5, (ModuleSize.Y - 1 ) * 5,0}; + ActorLocation += InformationDisplayOffset; + if(ShowCompass && IsValid(CompassRose)) { + ActorLocation.Z = CompassRose->GetRelativeLocation().Z; // Dunno why this works, but it does. + } + InformationComponent->SetRelativeLocation(ActorLocation); + OnInformationUpdate(InformationComponent, hit, Snapped, SnappedLoc, SnappedRot); + } //if(IsValid(CompassComponent)) { // FVector ActorOrigin = {0, 0, 0}; @@ -192,4 +210,9 @@ void AFINModuleSystemHolo::OnConstruction(const FTransform& MovieSceneBlends) { CompassRose->SetRelativeLocation(ActorLocation); } + if(EnableInformationDisplay) { + InformationComponent->SetVisibility(true); + }else{ + InformationComponent->SetVisibility(false); + } } diff --git a/Source/FicsItNetworksMisc/Public/ModuleSystem/FINModuleSystemHolo.h b/Source/FicsItNetworksMisc/Public/ModuleSystem/FINModuleSystemHolo.h index afa720c12..e8a006263 100644 --- a/Source/FicsItNetworksMisc/Public/ModuleSystem/FINModuleSystemHolo.h +++ b/Source/FicsItNetworksMisc/Public/ModuleSystem/FINModuleSystemHolo.h @@ -1,6 +1,8 @@ #pragma once #include "CoreMinimal.h" +#include "FINModuleSystemPanel.h" +#include "Components/TextRenderComponent.h" #include "Hologram/FGBuildableHologram.h" #include "FINModuleSystemHolo.generated.h" @@ -49,9 +51,22 @@ class FICSITNETWORKSMISC_API AFINModuleSystemHolo : public AFGBuildableHologram UPROPERTY(EditAnywhere) bool ShowCompass = false; + + UPROPERTY(EditAnywhere, BlueprintReadOnly) + UTextRenderComponent* InformationComponent; + + UPROPERTY(EditAnywhere) + bool EnableInformationDisplay = false; + + UPROPERTY(EditAnywhere) + FVector InformationDisplayOffset = FVector(1,6.5,7); + + UFUNCTION(BlueprintImplementableEvent) + void OnInformationUpdate(UTextRenderComponent* Component, const FHitResult& HitResult, UFINModuleSystemPanel* SnappedPanel, const FVector ModuleLocation, const int ModuleRotation); private: bool checkSpace(FVector min, FVector max); + FVector getModuleSize(); UPROPERTY()