Attempted fix widget to merchant system

This commit is contained in:
Marcel Hara 2023-03-14 13:04:33 +00:00
parent 363623a315
commit 6f9f95ab9d
19 changed files with 68 additions and 37 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
Content/Blueprints/Game_UI/WBP_Gear.uasset (Stored with Git LFS)

Binary file not shown.

Binary file not shown.

BIN
Content/Blueprints/Game_UI/WBP_Lore.uasset (Stored with Git LFS)

Binary file not shown.

Binary file not shown.

BIN
Content/Blueprints/Game_UI/WBP_Maps.uasset (Stored with Git LFS)

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
Content/Levels/Build.umap (Stored with Git LFS)

Binary file not shown.

View File

@ -40,8 +40,8 @@ void AInteraction::BeginPlay()
//Item Selector refs
ItemSelectorWidget = CreateWidget<UUserWidget>(GetWorld(), ItemSelector);
ItemSelectorWidget->AddToViewport();
ItemSelectorWidget->SetVisibility(ESlateVisibility::Hidden);
//ItemSelectorWidget->AddToViewport();
//We are getting the property of interaction since we need a reference for when we cast in BP and we need the reference to be self
Property = ItemSelectorWidget->GetClass()->FindPropertyByName("publicActor");
@ -102,7 +102,6 @@ void AInteraction::RemoveWidget()
UE_LOG(LogTemp, Display, TEXT("You cant open this widget when this widget is open"));
}
UE_LOG(LogTemp, Display, TEXT("setting isDisabled to true"));
ExitScreen();
if (Property == nullptr)
{
@ -121,6 +120,7 @@ void AInteraction::RemoveWidget()
else
{
ItemSelectorWidget->SetVisibility(ESlateVisibility::Visible);
ItemSelectorWidget->SetRenderOpacity(1);
bisDisabled = false;
}
}

View File

@ -42,6 +42,19 @@ void ATempCharacter::BeginPlay()
//UGameplayStatics::GetAllActorsWithTag(GetWorld(), Enemy, AIActors);
Ammo = TEXT("Ammo");
NoiseEmitter = Cast<UPawnNoiseEmitterComponent>(this->FindComponentByClass(UPawnNoiseEmitterComponent::StaticClass()));
//Widget Refs
CrossHairWidget = CreateWidget<UUserWidget>(GetWorld(), CrossHairSub);
CrossHairWidget->SetVisibility(ESlateVisibility::Visible);
CrossHairWidget->AddToViewport();
ImportantStatsWidget = CreateWidget<UUserWidget>(GetWorld(), ImportantStatsSub);
ImportantStatsWidget->SetVisibility(ESlateVisibility::Visible);
ImportantStatsWidget->AddToViewport();
MainMenuWidget = CreateWidget<UUserWidget>(GetWorld(), MainMenuSub);
MainMenuWidget->SetVisibility(ESlateVisibility::Hidden);
MainMenuWidget->AddToViewport();
}
//Binds the input we made in the setup player component to the forward vector

View File

@ -37,9 +37,9 @@ public:
UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = Inventory, meta = (AllowPrivateAccess = "true"))
class UInventoryComponent* Inventory; //Using the InventoryComponent class
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Widgets")
UUserWidget* ItemSelectorWidget;
//UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Widgets")
//UUserWidget* ItemSelectorWidget;
// Called to bind functionality to input
virtual void SetupPlayerInputComponent(class UInputComponent* PlayerInputComponent) override;
@ -100,8 +100,26 @@ public:
bool isInStealth = false;
UPROPERTY()
UUserWidget* ImportantStatsWidget;
UPROPERTY()
UUserWidget* CrossHairWidget;
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Widgets")
UUserWidget* ImportantStats;
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Widgets")
UUserWidget* MainMenuWidget;
UPROPERTY(EditAnywhere, Category= "Widgets")
TSubclassOf<UUserWidget> ImportantStatsSub;
UPROPERTY(EditAnywhere, Category= "Widgets")
TSubclassOf<UUserWidget> MainMenuSub;
UPROPERTY(EditAnywhere, Category= "Widgets")
TSubclassOf<UUserWidget> CrossHairSub;
};