A bunch of bug placement improvements, an indicator when leaving the bug placer, configuration options, early server access code... there's a lot here. Not even gonna try to be coherent. It's just a lot.
This commit is contained in:
parent
2a3fc4e75c
commit
a19e70d8f6
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
Content/T_Buggie_Centred.uasset
Normal file
BIN
Content/T_Buggie_Centred.uasset
Normal file
Binary file not shown.
BIN
Content/UI/BP_ExitingBugPlacementScreen.uasset
Normal file
BIN
Content/UI/BP_ExitingBugPlacementScreen.uasset
Normal file
Binary file not shown.
Binary file not shown.
BIN
Content/UI/M_ExitBugPlacementScreenCountdown.uasset
Normal file
BIN
Content/UI/M_ExitBugPlacementScreenCountdown.uasset
Normal file
Binary file not shown.
BIN
Content/UI/T_ConicalGradient.uasset
Normal file
BIN
Content/UI/T_ConicalGradient.uasset
Normal file
Binary file not shown.
@ -3,6 +3,7 @@
|
|||||||
#include "BugPlacerPawn.h"
|
#include "BugPlacerPawn.h"
|
||||||
|
|
||||||
#include "BugMarkerActor.h"
|
#include "BugMarkerActor.h"
|
||||||
|
#include "ExitingBugPlacementScreen.h"
|
||||||
#include "UnrealzillaGlobalSettings.h"
|
#include "UnrealzillaGlobalSettings.h"
|
||||||
|
|
||||||
#include "Components/MaterialBillboardComponent.h"
|
#include "Components/MaterialBillboardComponent.h"
|
||||||
@ -50,19 +51,6 @@ void ABugPlacerPawn::BeginPlay()
|
|||||||
|
|
||||||
this->OriginalPlayer = UGameplayStatics::GetPlayerCharacter(this, 0);
|
this->OriginalPlayer = UGameplayStatics::GetPlayerCharacter(this, 0);
|
||||||
|
|
||||||
// Create the bug marker we will be placing.
|
|
||||||
//if (this->BugPlacerBlueprintClass.IsValid())
|
|
||||||
//{
|
|
||||||
// FActorSpawnParameters SpawnParams;
|
|
||||||
// SpawnParams.Name = TEXT("BugMarker");
|
|
||||||
// SpawnParams.SpawnCollisionHandlingOverride = ESpawnActorCollisionHandlingMethod::AlwaysSpawn;
|
|
||||||
//#if WITH_EDITOR
|
|
||||||
// SpawnParams.bHideFromSceneOutliner = true;
|
|
||||||
//#endif
|
|
||||||
// this->BugMarker = this->GetWorld()->SpawnActor<ABugMarkerActor>(this->BugPlacerBlueprintClass.Get(), this->SphereComponent->GetComponentTransform(), SpawnParams);
|
|
||||||
// this->BugMarker->AttachToComponent(this->PlacementMarkerRoot, FAttachmentTransformRules::SnapToTargetNotIncludingScale);
|
|
||||||
//}
|
|
||||||
|
|
||||||
this->Activate();
|
this->Activate();
|
||||||
|
|
||||||
Super::BeginPlay();
|
Super::BeginPlay();
|
||||||
@ -158,7 +146,7 @@ void ABugPlacerPawn::PlaceBugMarker()
|
|||||||
SpawnParams.bHideFromSceneOutliner = true;
|
SpawnParams.bHideFromSceneOutliner = true;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
ABugMarkerActor *Marker = this->GetWorld()->SpawnActor<ABugMarkerActor>(this->BugPlacerBlueprintClass.Get(), this->PlacementMarkerRoot->GetComponentTransform(), SpawnParams);
|
ABugMarkerActor *Marker = this->GetWorld()->SpawnActor<ABugMarkerActor>(this->BugMarkerBlueprintClass.Get(), this->PlacementMarkerRoot->GetComponentTransform(), SpawnParams);
|
||||||
Marker->LoadBugSubmissionForm();
|
Marker->LoadBugSubmissionForm();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -177,3 +165,55 @@ void ABugPlacerPawn::Deactivate()
|
|||||||
|
|
||||||
this->Destroy();
|
this->Destroy();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void ABugPlacerPawn::ExitStarted()
|
||||||
|
{
|
||||||
|
if (this->ExitingBugPlacementScreenClass.IsValid())
|
||||||
|
{
|
||||||
|
this->ExitingBugPlacementScreen = CreateWidget<UExitingBugPlacementScreen>(UGameplayStatics::GetPlayerController(this, 0), this->ExitingBugPlacementScreenClass.Get());
|
||||||
|
this->ExitingBugPlacementScreen->AddToViewport(GetDefault<UUnrealzillaGlobalSettings>()->BugReportWidgetDepth + 10);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
this->ExitingBugPlacementScreen = nullptr;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void ABugPlacerPawn::ExitOngoing(const float ElapsedSeconds)
|
||||||
|
{
|
||||||
|
if (this->ExitingBugPlacementScreen)
|
||||||
|
{
|
||||||
|
this->ExitingBugPlacementScreen->SetPercent(ElapsedSeconds);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void ABugPlacerPawn::ExitTriggered()
|
||||||
|
{
|
||||||
|
if (this->ExitingBugPlacementScreen)
|
||||||
|
{
|
||||||
|
this->ExitingBugPlacementScreen->RemoveFromParent();
|
||||||
|
this->Deactivate();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void ABugPlacerPawn::ExitCanceled()
|
||||||
|
{
|
||||||
|
if (this->ExitingBugPlacementScreen)
|
||||||
|
{
|
||||||
|
this->ExitingBugPlacementScreen->RemoveFromParent();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void ABugPlacerPawn::SpawnBugPlacerPawn(const UObject *WorldContextObject, TSoftClassPtr<ABugPlacerPawn> Class)
|
||||||
|
{
|
||||||
|
if (Class.IsValid())
|
||||||
|
{
|
||||||
|
const FTransform &Transform = UGameplayStatics::GetPlayerCameraManager(WorldContextObject, 0)->GetActorTransform();
|
||||||
|
FActorSpawnParameters SpawnParams;
|
||||||
|
//SpawnParams.Name = TEXT("BugPlacerPawn");
|
||||||
|
SpawnParams.SpawnCollisionHandlingOverride = ESpawnActorCollisionHandlingMethod::AlwaysSpawn;
|
||||||
|
WorldContextObject->GetWorld()->SpawnActor<ABugPlacerPawn>(Class.Get(), Transform, SpawnParams);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
@ -7,6 +7,7 @@
|
|||||||
#include "CommonTextBlock.h"
|
#include "CommonTextBlock.h"
|
||||||
#include "HttpModule.h"
|
#include "HttpModule.h"
|
||||||
#include "UnrealzillaGlobalSettings.h"
|
#include "UnrealzillaGlobalSettings.h"
|
||||||
|
#include "Components/Overlay.h"
|
||||||
#include "Kismet/GameplayStatics.h"
|
#include "Kismet/GameplayStatics.h"
|
||||||
|
|
||||||
|
|
||||||
@ -38,6 +39,8 @@ void UBugSubmissionForm::SetMarkerData(ABugMarkerActor *BugMarker)
|
|||||||
{
|
{
|
||||||
this->BugMarkerActor = BugMarker;
|
this->BugMarkerActor = BugMarker;
|
||||||
|
|
||||||
|
MapNameValue->SetText(FText::FromString(this->GetWorld()->GetMapName().RightChop(this->GetWorld()->StreamingLevelsPrefix.Len())));
|
||||||
|
|
||||||
const FVector MarkerLocation = this->BugMarkerActor->GetActorLocation();
|
const FVector MarkerLocation = this->BugMarkerActor->GetActorLocation();
|
||||||
FFormatNamedArguments MarkerLocationArgs;
|
FFormatNamedArguments MarkerLocationArgs;
|
||||||
MarkerLocationArgs.Add("X", FormatFloatToText(MarkerLocation.X, 1, 4));
|
MarkerLocationArgs.Add("X", FormatFloatToText(MarkerLocation.X, 1, 4));
|
||||||
@ -53,10 +56,9 @@ void UBugSubmissionForm::SetMarkerData(ABugMarkerActor *BugMarker)
|
|||||||
const FText MarkerUpVectorText = FText::Format(NSLOCTEXT("BugSubmissionForm", "MarkerUpVector", "{X},{Y},{Z}"), MarkerUpVectorArgs);
|
const FText MarkerUpVectorText = FText::Format(NSLOCTEXT("BugSubmissionForm", "MarkerUpVector", "{X},{Y},{Z}"), MarkerUpVectorArgs);
|
||||||
|
|
||||||
FFormatNamedArguments MapDataArgs;
|
FFormatNamedArguments MapDataArgs;
|
||||||
MapDataArgs.Add("MapName", FText::FromString(this->GetWorld()->GetMapName().RightChop(this->GetWorld()->StreamingLevelsPrefix.Len())));
|
|
||||||
MapDataArgs.Add("MarkerLocation", MarkerLocationText);
|
MapDataArgs.Add("MarkerLocation", MarkerLocationText);
|
||||||
MapDataArgs.Add("MarkerUpVector", MarkerUpVectorText);
|
MapDataArgs.Add("MarkerUpVector", MarkerUpVectorText);
|
||||||
const FText MapDataText = FText::Format(NSLOCTEXT("BugSubmissionForm", "MapDataFormat", "{MapName}\n{MarkerLocation}\n{MarkerUpVector}"), MapDataArgs);
|
const FText MapDataText = FText::Format(NSLOCTEXT("BugSubmissionForm", "MapDataFormat", "{MarkerLocation}\n{MarkerUpVector}"), MapDataArgs);
|
||||||
|
|
||||||
this->LocationValue->SetText(MapDataText);
|
this->LocationValue->SetText(MapDataText);
|
||||||
}
|
}
|
||||||
@ -64,8 +66,10 @@ void UBugSubmissionForm::SetMarkerData(ABugMarkerActor *BugMarker)
|
|||||||
|
|
||||||
void UBugSubmissionForm::SubmitForm()
|
void UBugSubmissionForm::SubmitForm()
|
||||||
{
|
{
|
||||||
|
this->ProcessingRequestOverlay->SetVisibility(ESlateVisibility::Visible);
|
||||||
|
|
||||||
const FString RESTURL = "/rest.cgi";
|
const FString RESTURL = "/rest.cgi";
|
||||||
const FString RequestURL = "/bug/7";
|
const FString RequestURL = "/bug";
|
||||||
const FString QueryString = "api_key=" + GetDefault<UUnrealzillaGlobalSettings>()->APIKey;
|
const FString QueryString = "api_key=" + GetDefault<UUnrealzillaGlobalSettings>()->APIKey;
|
||||||
|
|
||||||
FHttpModule &HttpModule = FHttpModule::Get();
|
FHttpModule &HttpModule = FHttpModule::Get();
|
||||||
@ -78,8 +82,6 @@ void UBugSubmissionForm::SubmitForm()
|
|||||||
Request->ProcessRequest();
|
Request->ProcessRequest();
|
||||||
|
|
||||||
this->OnFormSubmit.ExecuteIfBound();
|
this->OnFormSubmit.ExecuteIfBound();
|
||||||
|
|
||||||
this->CloseForm();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void UBugSubmissionForm::CancelForm()
|
void UBugSubmissionForm::CancelForm()
|
||||||
@ -94,7 +96,7 @@ void UBugSubmissionForm::CancelForm()
|
|||||||
void UBugSubmissionForm::CloseForm()
|
void UBugSubmissionForm::CloseForm()
|
||||||
{
|
{
|
||||||
UGameplayStatics::GetPlayerController(this, 0)->SetInputMode(FInputModeGameOnly());
|
UGameplayStatics::GetPlayerController(this, 0)->SetInputMode(FInputModeGameOnly());
|
||||||
UGameplayStatics::GetPlayerController(this, 0)->bShowMouseCursor = true;
|
UGameplayStatics::GetPlayerController(this, 0)->bShowMouseCursor = false;
|
||||||
this->RemoveFromParent();
|
this->RemoveFromParent();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -104,6 +106,8 @@ void UBugSubmissionForm::ServerResponse(FHttpRequestPtr Request, FHttpResponsePt
|
|||||||
if (Success)
|
if (Success)
|
||||||
{
|
{
|
||||||
UE_LOG(LogTemp, Log, TEXT("%s"), *Response->GetContentAsString());
|
UE_LOG(LogTemp, Log, TEXT("%s"), *Response->GetContentAsString());
|
||||||
|
|
||||||
|
this->CloseForm();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -121,7 +125,7 @@ void UBugSubmissionForm::ServerResponse(FHttpRequestPtr Request, FHttpResponsePt
|
|||||||
UE_LOG(LogTemp, Error, TEXT("Connection failed"));
|
UE_LOG(LogTemp, Error, TEXT("Connection failed"));
|
||||||
break;
|
break;
|
||||||
case EHttpRequestStatus::Succeeded:
|
case EHttpRequestStatus::Succeeded:
|
||||||
UE_LOG(LogTemp, Warning, TEXT("Connection succeeded"));
|
UE_LOG(LogTemp, Log, TEXT("Connection succeeded"));
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
UE_LOG(LogTemp, Error, TEXT("Request failed"));
|
UE_LOG(LogTemp, Error, TEXT("Request failed"));
|
||||||
|
|||||||
6
Source/Unrealzilla/Private/ExitingBugPlacementScreen.cpp
Normal file
6
Source/Unrealzilla/Private/ExitingBugPlacementScreen.cpp
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
// ©2022 Batty Bovine Productions, LLC. All Rights Reserved.
|
||||||
|
|
||||||
|
#include "ExitingBugPlacementScreen.h"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -27,6 +27,9 @@ public:
|
|||||||
UFUNCTION(BlueprintCallable)
|
UFUNCTION(BlueprintCallable)
|
||||||
void Deactivate();
|
void Deactivate();
|
||||||
|
|
||||||
|
UFUNCTION(BlueprintCallable, meta=(WorldContext="WorldContextObject"))
|
||||||
|
static void SpawnBugPlacerPawn(const UObject *WorldContextObject, TSoftClassPtr<class ABugPlacerPawn> Class);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
UFUNCTION(BlueprintCallable)
|
UFUNCTION(BlueprintCallable)
|
||||||
void SetArbitraryPlacement(bool bSet);
|
void SetArbitraryPlacement(bool bSet);
|
||||||
@ -34,40 +37,46 @@ protected:
|
|||||||
UFUNCTION(BlueprintCallable)
|
UFUNCTION(BlueprintCallable)
|
||||||
void PlaceBugMarker();
|
void PlaceBugMarker();
|
||||||
|
|
||||||
|
UFUNCTION(BlueprintCallable)
|
||||||
|
void ExitStarted();
|
||||||
|
UFUNCTION(BlueprintCallable)
|
||||||
|
void ExitOngoing(const float ElapsedSeconds);
|
||||||
|
UFUNCTION(BlueprintCallable)
|
||||||
|
void ExitTriggered();
|
||||||
|
UFUNCTION(BlueprintCallable)
|
||||||
|
void ExitCanceled();
|
||||||
|
|
||||||
// Collision sphere, and root component
|
// Collision sphere, and root component
|
||||||
UPROPERTY(BlueprintReadOnly, VisibleAnywhere)
|
UPROPERTY(BlueprintReadOnly, VisibleAnywhere)
|
||||||
TObjectPtr<class USphereComponent> SphereComponent;
|
TObjectPtr<class USphereComponent> SphereComponent;
|
||||||
|
|
||||||
// Follows the collision point of a line trace, and indicates where the bug marker will be placed.
|
// Follows the collision point of a line trace, and indicates where the bug marker will be placed.
|
||||||
UPROPERTY(BlueprintReadOnly, EditAnywhere)
|
UPROPERTY(BlueprintReadOnly, EditAnywhere)
|
||||||
TObjectPtr<class USceneComponent> PlacementMarkerRoot;
|
TObjectPtr<class USceneComponent> PlacementMarkerRoot;
|
||||||
|
|
||||||
// The glowing end point of the laser, to indicate a surface where a marker can be placed.
|
// The glowing end point of the laser, to indicate a surface where a marker can be placed.
|
||||||
UPROPERTY(BlueprintReadOnly, EditDefaultsOnly)
|
UPROPERTY(BlueprintReadOnly, EditDefaultsOnly)
|
||||||
TObjectPtr<class UMaterialBillboardComponent> LaserGlow;
|
TObjectPtr<class UMaterialBillboardComponent> LaserGlow;
|
||||||
|
|
||||||
// The origin of our line trace; line extends from this origin position along the component's
|
// The origin of our line trace; line extends from this origin position along the component's
|
||||||
// forward vector a set distance to check for surfaces where a bug marker can be placed.
|
// forward vector a set distance to check for surfaces where a bug marker can be placed.
|
||||||
UPROPERTY(BlueprintReadOnly, EditAnywhere)
|
UPROPERTY(BlueprintReadOnly, EditAnywhere)
|
||||||
TObjectPtr<class USceneComponent> TraceOriginComponent;
|
TObjectPtr<class USceneComponent> TraceOriginComponent;
|
||||||
|
|
||||||
// Basic movement component to allow the bug placer to fly through a level.
|
// Basic movement component to allow the bug placer to fly through a level.
|
||||||
UPROPERTY(BlueprintReadOnly, VisibleAnywhere)
|
UPROPERTY(BlueprintReadOnly, VisibleAnywhere)
|
||||||
TObjectPtr<class UFloatingPawnMovement> PawnMovement;
|
TObjectPtr<class UFloatingPawnMovement> PawnMovement;
|
||||||
|
|
||||||
|
|
||||||
UPROPERTY(BlueprintReadOnly, EditDefaultsOnly)
|
UPROPERTY(BlueprintReadOnly, EditDefaultsOnly)
|
||||||
TSoftClassPtr<class ABugMarkerActor> BugPlacerBlueprintClass;
|
TSoftClassPtr<class ABugMarkerActor> BugMarkerBlueprintClass;
|
||||||
|
UPROPERTY(BlueprintReadOnly, EditDefaultsOnly)
|
||||||
|
TSoftClassPtr<class UExitingBugPlacementScreen> ExitingBugPlacementScreenClass;
|
||||||
|
|
||||||
UPROPERTY(BlueprintReadWrite)
|
UPROPERTY(BlueprintReadWrite)
|
||||||
float SavedMaxSpeed = 0.0f;
|
float SavedMaxSpeed = 0.0f;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
uint8 bArbitraryPlacement : 1;
|
uint8 bArbitraryPlacement : 1;
|
||||||
|
|
||||||
uint8 bCurrentTraceHit : 1;
|
uint8 bCurrentTraceHit : 1;
|
||||||
|
|
||||||
TObjectPtr<class ACharacter> OriginalPlayer;
|
TObjectPtr<class ACharacter> OriginalPlayer;
|
||||||
TObjectPtr<class ABugMarkerActor> BugMarker;
|
TObjectPtr<class ABugMarkerActor> BugMarker;
|
||||||
|
|
||||||
|
TObjectPtr<class UExitingBugPlacementScreen> ExitingBugPlacementScreen;
|
||||||
};
|
};
|
||||||
|
|||||||
@ -28,6 +28,8 @@ protected:
|
|||||||
|
|
||||||
UPROPERTY(BlueprintReadOnly, meta=(BindWidget))
|
UPROPERTY(BlueprintReadOnly, meta=(BindWidget))
|
||||||
TObjectPtr<class UCommonTextBlock> ProductNameValue;
|
TObjectPtr<class UCommonTextBlock> ProductNameValue;
|
||||||
|
UPROPERTY(BlueprintReadOnly, meta=(BindWidget))
|
||||||
|
TObjectPtr<class UCommonTextBlock> MapNameValue;
|
||||||
UPROPERTY(BlueprintReadOnly, meta=(BindWidget))
|
UPROPERTY(BlueprintReadOnly, meta=(BindWidget))
|
||||||
TObjectPtr<class UCommonTextBlock> LocationValue;
|
TObjectPtr<class UCommonTextBlock> LocationValue;
|
||||||
|
|
||||||
@ -36,6 +38,9 @@ protected:
|
|||||||
UPROPERTY(BlueprintReadOnly, meta=(BindWidget))
|
UPROPERTY(BlueprintReadOnly, meta=(BindWidget))
|
||||||
TObjectPtr<class UCommonButtonBase> SubmitButton;
|
TObjectPtr<class UCommonButtonBase> SubmitButton;
|
||||||
|
|
||||||
|
UPROPERTY(BlueprintReadOnly, meta=(BindWidget))
|
||||||
|
TObjectPtr<class UOverlay> ProcessingRequestOverlay;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void ServerResponse(FHttpRequestPtr Request, FHttpResponsePtr Response, bool Success);
|
void ServerResponse(FHttpRequestPtr Request, FHttpResponsePtr Response, bool Success);
|
||||||
|
|
||||||
|
|||||||
19
Source/Unrealzilla/Public/ExitingBugPlacementScreen.h
Normal file
19
Source/Unrealzilla/Public/ExitingBugPlacementScreen.h
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
// ©2022 Batty Bovine Productions, LLC. All Rights Reserved.
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include "CoreMinimal.h"
|
||||||
|
#include "Blueprint/UserWidget.h"
|
||||||
|
|
||||||
|
#include "ExitingBugPlacementScreen.generated.h"
|
||||||
|
|
||||||
|
|
||||||
|
UCLASS()
|
||||||
|
class UNREALZILLA_API UExitingBugPlacementScreen : public UUserWidget
|
||||||
|
{
|
||||||
|
GENERATED_BODY()
|
||||||
|
|
||||||
|
public:
|
||||||
|
UFUNCTION(BlueprintImplementableEvent)
|
||||||
|
void SetPercent(const float Percent);
|
||||||
|
};
|
||||||
Loading…
x
Reference in New Issue
Block a user