Cant even get a widget to open after 4 hours
This commit is contained in:
parent
cdab08dcdf
commit
4d53a2cdda
BIN
Content/Blueprints/BP_MyTempCharacter.uasset
(Stored with Git LFS)
BIN
Content/Blueprints/BP_MyTempCharacter.uasset
(Stored with Git LFS)
Binary file not shown.
@ -1,3 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:ec29ba0db3dfe4058261d9534947c299b31f5b36d3a91ddfdd70f1606afd1b3d
|
||||
size 23329
|
||||
oid sha256:e11da137b25dda1d74cb3fcbcc1feaaa4fa3d8cffb13e8994b75a01e3691eed7
|
||||
size 23038
|
||||
|
@ -1,3 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:2d2407c9aeda28720c26b714c16034f1209ee213730b0931ebd93ead214b261c
|
||||
size 27962
|
||||
oid sha256:cc549e8f57a466d4be83e0d4519404f3b2dd0186c70090e944c9089772a594b8
|
||||
size 20569
|
||||
|
BIN
Content/Merchant_Blueprint.uasset
(Stored with Git LFS)
Normal file
BIN
Content/Merchant_Blueprint.uasset
(Stored with Git LFS)
Normal file
Binary file not shown.
@ -1,8 +1,10 @@
|
||||
// Fill out your copyright notice in the Description page of Project Settings.
|
||||
|
||||
|
||||
#include "TempCharacter.h"
|
||||
|
||||
#include "UObject/SoftObjectPath.h"
|
||||
#include "Dialogs/Dialogs.h"
|
||||
#include "Engine/GameViewportClient.h"
|
||||
#include "Blueprint/UserWidget.h"
|
||||
#include "../../../Plugins/Developer/RiderLink/Source/RD/thirdparty/clsocket/src/ActiveSocket.h"
|
||||
|
||||
|
||||
@ -66,16 +68,44 @@ void ATempCharacter::LineTraceLogic()
|
||||
|
||||
TraceParams.AddIgnoredActor(this);
|
||||
|
||||
bool bHit = GetWorld()->LineTraceSingleByChannel(OutHit, Start, End, ECC_Visibility, TraceParams);
|
||||
/*bool bHit = GetWorld()->LineTraceSingleByChannel(OutHit, Start, End, ECC_Visibility, TraceParams);
|
||||
if (bHit)
|
||||
{
|
||||
if (OutHit.GetActor()->ActorHasTag("MerchantTag"))
|
||||
{
|
||||
FStringClassReference WidgetRef(TEXT("WidgetBlueprint/Game/Merchant/BP_OPENDIAL.BP_OPENDIAL"));
|
||||
TSubclassOf<class UUserWidget> WidgetLoad = WidgetRef.TryLoadClass<UUserWidget>();
|
||||
|
||||
UUserWidget* TestWidget = CreateWidget<UUserWidget>(this, WidgetLoad, FName(TEXT("MyWidget")));
|
||||
if(TestWidget)
|
||||
{
|
||||
TestWidget->AddToViewport(0);
|
||||
}
|
||||
DrawDebugLine(GetWorld(), Start, End, FColor::Green, false, 1.0f);
|
||||
UE_LOG(LogTemp, Display, TEXT("HIT: %s"), *OutHit.GetActor()->GetName());
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
|
||||
|
||||
// In a constructor
|
||||
FStringClassReference MyWidgetClassRef(TEXT("/Game/Widgets/TestWidget.TestWidget_C"));
|
||||
// Get the widget class
|
||||
|
||||
TSubclassOf<class UUserWidget> TestWidgetClass = MyWidgetClassRef.TryLoadClass<UUserWidget>();
|
||||
|
||||
// ... then to display you widget do
|
||||
|
||||
// Check if class was found
|
||||
if (TestWidgetClass )
|
||||
{
|
||||
// Create the widget
|
||||
UUserWidget* TestWidget= CreateWidget<UUserWidget>(this, TestWidgetClass, FName(TEXT("MyWidget")));
|
||||
// Check if widget was created
|
||||
if (TestWidget)
|
||||
{
|
||||
TestWidget->AddToViewport();
|
||||
}
|
||||
}
|
||||
|
||||
// I GIVE UP LOL!
|
||||
}
|
||||
|
@ -4,6 +4,7 @@
|
||||
|
||||
#include "CoreMinimal.h"
|
||||
#include "GameFramework/Character.h"
|
||||
#include "Blueprint/UserWidget.h"
|
||||
#include "TempCharacter.generated.h"
|
||||
|
||||
UCLASS()
|
||||
|
@ -8,7 +8,7 @@ public class the_twilight_abyss : ModuleRules
|
||||
{
|
||||
PCHUsage = PCHUsageMode.UseExplicitOrSharedPCHs;
|
||||
|
||||
PublicDependencyModuleNames.AddRange(new string[] { "Core", "CoreUObject", "Engine", "InputCore" });
|
||||
PublicDependencyModuleNames.AddRange(new string[] { "Core", "CoreUObject", "Engine", "InputCore", "UMG" });
|
||||
|
||||
PrivateDependencyModuleNames.AddRange(new string[] { });
|
||||
|
||||
|
@ -9,7 +9,8 @@
|
||||
"Type": "Runtime",
|
||||
"LoadingPhase": "Default",
|
||||
"AdditionalDependencies": [
|
||||
"Engine"
|
||||
"Engine",
|
||||
"UMG"
|
||||
]
|
||||
}
|
||||
],
|
||||
|
Loading…
Reference in New Issue
Block a user