Bug markers now correctly update immediately after being submitted and placed in the world.
This commit is contained in:
parent
89c759894c
commit
2c29b5e052
Binary file not shown.
BIN
Content/BP_BugMarkerActorDummy.uasset
Normal file
BIN
Content/BP_BugMarkerActorDummy.uasset
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
Content/M_IDText.uasset
Normal file
BIN
Content/M_IDText.uasset
Normal file
Binary file not shown.
BIN
Content/UI/M_BugPlacementReticle.uasset
Normal file
BIN
Content/UI/M_BugPlacementReticle.uasset
Normal file
Binary file not shown.
BIN
Content/UI/T_BugPlacementReticle.uasset
Normal file
BIN
Content/UI/T_BugPlacementReticle.uasset
Normal file
Binary file not shown.
BIN
Content/UI/UMG_BugPlacementOverlay.uasset
Normal file
BIN
Content/UI/UMG_BugPlacementOverlay.uasset
Normal file
Binary file not shown.
@ -8,3 +8,20 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
EBugStatus ABugMarkerActor::GetBugStatus() const
|
||||||
|
{
|
||||||
|
if (GetDefault<UUnrealzillaGlobalSettings>()->ResolvedStatuses.Contains(this->BugData.status))
|
||||||
|
{
|
||||||
|
return EBugStatus::Resolved;
|
||||||
|
}
|
||||||
|
else if (GetDefault<UUnrealzillaGlobalSettings>()->InProgressStatuses.Contains(this->BugData.status))
|
||||||
|
{
|
||||||
|
return EBugStatus::InProgress;
|
||||||
|
}
|
||||||
|
else if (GetDefault<UUnrealzillaGlobalSettings>()->UnresolvedStatuses.Contains(this->BugData.status))
|
||||||
|
{
|
||||||
|
return EBugStatus::Unresolved;
|
||||||
|
}
|
||||||
|
|
||||||
|
return EBugStatus::NoStatus;
|
||||||
|
}
|
||||||
|
|||||||
@ -107,22 +107,8 @@ void ABugMarkerLoader::LoadNewBatch()
|
|||||||
FActorSpawnParameters SpawnParams;
|
FActorSpawnParameters SpawnParams;
|
||||||
SpawnParams.Owner = this;
|
SpawnParams.Owner = this;
|
||||||
const FTransform Transform = FTransform(FRotationMatrix::MakeFromZ(UpVector).Rotator(), Location, FVector::OneVector);
|
const FTransform Transform = FTransform(FRotationMatrix::MakeFromZ(UpVector).Rotator(), Location, FVector::OneVector);
|
||||||
ABugMarkerActor *Marker = this->GetWorld()->SpawnActorDeferred<ABugMarkerActor>(Class, Transform, this);
|
ABugMarkerActor *Marker = this->GetWorld()->SpawnActor<ABugMarkerActor>(Class, Transform, SpawnParams);
|
||||||
Marker->SetBugID(BugData.id);
|
Marker->SetBugData(BugData);
|
||||||
Marker->SetBugSummary(BugData.summary);
|
|
||||||
if (GetDefault<UUnrealzillaGlobalSettings>()->UnresolvedStatuses.Contains(BugData.status))
|
|
||||||
{
|
|
||||||
Marker->SetBugStatus(EBugStatus::Unresolved);
|
|
||||||
}
|
|
||||||
else if (GetDefault<UUnrealzillaGlobalSettings>()->InProgressStatuses.Contains(BugData.status))
|
|
||||||
{
|
|
||||||
Marker->SetBugStatus(EBugStatus::InProgress);
|
|
||||||
}
|
|
||||||
else if (GetDefault<UUnrealzillaGlobalSettings>()->ResolvedStatuses.Contains(BugData.status))
|
|
||||||
{
|
|
||||||
Marker->SetBugStatus(EBugStatus::Resolved);
|
|
||||||
}
|
|
||||||
Marker->FinishSpawning(Transform);
|
|
||||||
this->Markers.Add(Marker);
|
this->Markers.Add(Marker);
|
||||||
|
|
||||||
this->BugBatch.RemoveAt(0);
|
this->BugBatch.RemoveAt(0);
|
||||||
|
|||||||
@ -6,6 +6,7 @@
|
|||||||
#include "BugMarkerLoader.h"
|
#include "BugMarkerLoader.h"
|
||||||
#include "ExitingBugPlacementScreen.h"
|
#include "ExitingBugPlacementScreen.h"
|
||||||
#include "UnrealzillaGlobalSettings.h"
|
#include "UnrealzillaGlobalSettings.h"
|
||||||
|
#include "UnrealzillaJSON.h"
|
||||||
|
|
||||||
#include "Components/MaterialBillboardComponent.h"
|
#include "Components/MaterialBillboardComponent.h"
|
||||||
#include "Components/SphereComponent.h"
|
#include "Components/SphereComponent.h"
|
||||||
@ -78,28 +79,51 @@ void ABugPlacerPawn::TraceTimerElapsed()
|
|||||||
|
|
||||||
FCollisionQueryParams Params;
|
FCollisionQueryParams Params;
|
||||||
Params.bTraceComplex = false;
|
Params.bTraceComplex = false;
|
||||||
|
Params.bIgnoreTouches = false;
|
||||||
Params.AddIgnoredActor(this);
|
Params.AddIgnoredActor(this);
|
||||||
|
|
||||||
FHitResult TraceHit;
|
FHitResult TraceHit;
|
||||||
const FVector TraceStart = this->TraceOriginComponent->GetComponentLocation();
|
const FVector TraceStart = this->GetActorLocation();
|
||||||
const FVector TraceEnd = TraceStart + (this->TraceOriginComponent->GetForwardVector() * GetDefault<UUnrealzillaGlobalSettings>()->BugPlacementTraceDistance);
|
const FVector TraceEnd = TraceStart + (this->GetActorForwardVector() * GetDefault<UUnrealzillaGlobalSettings>()->BugPlacementTraceDistance);
|
||||||
this->bCurrentTraceHit = World->LineTraceSingleByChannel(TraceHit, TraceStart, TraceEnd, ECollisionChannel::ECC_Visibility, Params);
|
this->bCurrentTraceHit = World->LineTraceSingleByChannel(TraceHit, TraceStart, TraceEnd, ECollisionChannel::ECC_Visibility, Params);
|
||||||
|
|
||||||
// Move bug marker to the current pointer position, or behind
|
// Move bug marker to the current pointer position, or behind
|
||||||
// the camera if the pointer is not currently hitting a surface.
|
// the camera if the pointer is not currently hitting a surface.
|
||||||
if (this->bCurrentTraceHit)
|
if (this->bCurrentTraceHit)
|
||||||
{
|
{
|
||||||
this->PlacementMarkerRoot->SetWorldLocationAndRotation(TraceHit.ImpactPoint, FRotationMatrix::MakeFromZ(TraceHit.ImpactNormal).ToQuat());
|
if (ABugMarkerActor *Marker = Cast<ABugMarkerActor>(TraceHit.GetActor()))
|
||||||
this->PlacementMarkerRoot->SetVisibility(true, true);
|
{
|
||||||
|
this->PlacementMarkerRoot->SetVisibility(true, false);
|
||||||
|
this->UpdateBugInformation(Marker->GetBugData());
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
this->PlacementMarkerRoot->SetVisibility(true, true);
|
||||||
|
this->UpdateBugInformation(FJSONBugData());
|
||||||
|
}
|
||||||
|
|
||||||
this->TraceOriginComponent->SetRelativeScale3D(FVector(1.0f, 1.0f, (TraceHit.ImpactPoint - TraceStart).Length()));
|
this->PlacementMarkerRoot->SetWorldLocationAndRotation(TraceHit.ImpactPoint, FRotationMatrix::MakeFromZ(TraceHit.ImpactNormal).ToQuat());
|
||||||
|
|
||||||
|
const FVector TraceOriginLocation = this->TraceOriginComponent->GetComponentLocation();
|
||||||
|
FVector FacingVector = (TraceHit.ImpactPoint - TraceOriginLocation);
|
||||||
|
FacingVector.Normalize();
|
||||||
|
const FRotator TraceOriginFacingRotation = FRotationMatrix::MakeFromX(FacingVector).Rotator();
|
||||||
|
this->TraceOriginComponent->SetWorldRotation(TraceOriginFacingRotation);
|
||||||
|
const FVector TraceOriginScale = this->TraceOriginComponent->GetRelativeScale3D();
|
||||||
|
this->TraceOriginComponent->SetRelativeScale3D(FVector(TraceOriginScale.X, TraceOriginScale.Y, (TraceHit.ImpactPoint - TraceOriginLocation).Length()));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
this->PlacementMarkerRoot->SetRelativeLocationAndRotation(FVector::ZeroVector, FRotator::ZeroRotator);
|
this->PlacementMarkerRoot->SetRelativeLocationAndRotation(FVector::ZeroVector, FRotator::ZeroRotator);
|
||||||
this->PlacementMarkerRoot->SetVisibility(false, true);
|
this->PlacementMarkerRoot->SetVisibility(false, true);
|
||||||
|
|
||||||
this->TraceOriginComponent->SetRelativeScale3D(FVector(1.0f, 1.0f, (TraceEnd - TraceStart).Length()));
|
const FVector TraceOriginLocation = this->TraceOriginComponent->GetComponentLocation();
|
||||||
|
FVector FacingVector = (TraceEnd - TraceOriginLocation);
|
||||||
|
FacingVector.Normalize();
|
||||||
|
const FRotator TraceOriginFacingRotation = FRotationMatrix::MakeFromX(FacingVector).Rotator();
|
||||||
|
this->TraceOriginComponent->SetWorldRotation(TraceOriginFacingRotation);
|
||||||
|
const FVector TraceOriginScale = this->TraceOriginComponent->GetRelativeScale3D();
|
||||||
|
this->TraceOriginComponent->SetRelativeScale3D(FVector(TraceOriginScale.X, TraceOriginScale.Y, (TraceEnd - TraceStart).Length()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -171,9 +195,8 @@ void ABugPlacerPawn::ExitCanceled()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void ABugPlacerPawn::SpawnBugPlacerPawn(const UObject *WorldContextObject)
|
void ABugPlacerPawn::SpawnBugPlacerPawn(const UObject *WorldContextObject, TSubclassOf<ABugPlacerPawn> Class)
|
||||||
{
|
{
|
||||||
TSubclassOf<ABugPlacerPawn> Class = StaticLoadClass(ABugPlacerPawn::StaticClass(), nullptr, BUG_PLACER_PAWN_BP);
|
|
||||||
const FTransform &Transform = UGameplayStatics::GetPlayerCameraManager(WorldContextObject, 0)->GetActorTransform();
|
const FTransform &Transform = UGameplayStatics::GetPlayerCameraManager(WorldContextObject, 0)->GetActorTransform();
|
||||||
FActorSpawnParameters SpawnParams;
|
FActorSpawnParameters SpawnParams;
|
||||||
SpawnParams.SpawnCollisionHandlingOverride = ESpawnActorCollisionHandlingMethod::AlwaysSpawn;
|
SpawnParams.SpawnCollisionHandlingOverride = ESpawnActorCollisionHandlingMethod::AlwaysSpawn;
|
||||||
|
|||||||
@ -9,6 +9,7 @@
|
|||||||
#include "HttpModule.h"
|
#include "HttpModule.h"
|
||||||
#include "JsonObjectConverter.h"
|
#include "JsonObjectConverter.h"
|
||||||
#include "UnrealzillaGlobalSettings.h"
|
#include "UnrealzillaGlobalSettings.h"
|
||||||
|
#include "UnrealzillaJSON.h"
|
||||||
|
|
||||||
#include "Components/CircularThrobber.h"
|
#include "Components/CircularThrobber.h"
|
||||||
#include "Components/Overlay.h"
|
#include "Components/Overlay.h"
|
||||||
@ -251,6 +252,68 @@ void UBugSubmissionForm::ServerPOSTResponse(FHttpRequestPtr Request, FHttpRespon
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
const FString FullURL = GetDefault<UUnrealzillaGlobalSettings>()->SubmissionServer + "/rest.cgi";
|
||||||
|
|
||||||
|
TArray<FString> StatusQueries;
|
||||||
|
StatusQueries.Add("id=" + FString::FromInt(ResponseData.id));
|
||||||
|
if (GetDefault<UUnrealzillaGlobalSettings>()->bShowUnresolvedBugs)
|
||||||
|
{
|
||||||
|
for (const FString Unresolved : GetDefault<UUnrealzillaGlobalSettings>()->UnresolvedStatuses)
|
||||||
|
{
|
||||||
|
StatusQueries.Add("status=" + Unresolved);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (GetDefault<UUnrealzillaGlobalSettings>()->bShowInProgressBugs)
|
||||||
|
{
|
||||||
|
for (const FString InProgress : GetDefault<UUnrealzillaGlobalSettings>()->InProgressStatuses)
|
||||||
|
{
|
||||||
|
StatusQueries.Add("status=" + InProgress);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (GetDefault<UUnrealzillaGlobalSettings>()->bShowResolvedBugs)
|
||||||
|
{
|
||||||
|
for (const FString Resolved : GetDefault<UUnrealzillaGlobalSettings>()->ResolvedStatuses)
|
||||||
|
{
|
||||||
|
StatusQueries.Add("status=" + Resolved);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
StatusQueries.Add("cf_mapname=" + this->GetWorld()->GetMapName().RightChop(this->GetWorld()->StreamingLevelsPrefix.Len()));
|
||||||
|
StatusQueries.Add("api_key=" + GetDefault<UUnrealzillaGlobalSettings>()->APIKey);
|
||||||
|
const FString QueryString = FString::Join(StatusQueries, TEXT("&"));
|
||||||
|
|
||||||
|
FHttpModule &HttpModule = FHttpModule::Get();
|
||||||
|
TSharedRef<IHttpRequest, ESPMode::ThreadSafe> SeverityRequest = HttpModule.CreateRequest();
|
||||||
|
SeverityRequest->SetVerb(TEXT("GET"));
|
||||||
|
SeverityRequest->SetHeader(TEXT("Content-Type"), TEXT("application/json"));
|
||||||
|
SeverityRequest->SetURL(FullURL + "/bug" + "?" + QueryString);
|
||||||
|
SeverityRequest->OnProcessRequestComplete().BindUObject(this, &UBugSubmissionForm::ServerPOSTUpdateMarkerResponse);
|
||||||
|
SeverityRequest->ProcessRequest();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
this->ServerConnectionError(Request->GetStatus());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void UBugSubmissionForm::ServerPOSTUpdateMarkerResponse(FHttpRequestPtr Request, FHttpResponsePtr Response, bool Success)
|
||||||
|
{
|
||||||
|
if (Success)
|
||||||
|
{
|
||||||
|
FJSONBugResponse ResponseData;
|
||||||
|
FString JSONResponse = Response->GetContentAsString();
|
||||||
|
FJsonObjectConverter::JsonObjectStringToUStruct(JSONResponse, &ResponseData);
|
||||||
|
|
||||||
|
if (ResponseData.error)
|
||||||
|
{
|
||||||
|
this->ShowProcessingOverlayMessage(ResponseData.message);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (!ResponseData.bugs.IsEmpty())
|
||||||
|
{
|
||||||
|
this->BugMarkerActor->SetBugData(ResponseData.bugs[0]);
|
||||||
|
}
|
||||||
this->CloseForm();
|
this->CloseForm();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -3,6 +3,7 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "CoreMinimal.h"
|
#include "CoreMinimal.h"
|
||||||
|
#include "UnrealzillaJSON.h"
|
||||||
|
|
||||||
#include "BugMarkerActor.generated.h"
|
#include "BugMarkerActor.generated.h"
|
||||||
|
|
||||||
@ -12,6 +13,7 @@
|
|||||||
UENUM()
|
UENUM()
|
||||||
enum class EBugStatus : uint8
|
enum class EBugStatus : uint8
|
||||||
{
|
{
|
||||||
|
NoStatus UMETA(DisplayName="No Status"),
|
||||||
Unresolved UMETA(DisplayName="Unresolved"),
|
Unresolved UMETA(DisplayName="Unresolved"),
|
||||||
InProgress UMETA(DisplayName="In Progress"),
|
InProgress UMETA(DisplayName="In Progress"),
|
||||||
Resolved UMETA(DisplayName="Resolved"),
|
Resolved UMETA(DisplayName="Resolved"),
|
||||||
@ -24,15 +26,18 @@ class UNREALZILLA_API ABugMarkerActor : public AActor
|
|||||||
GENERATED_BODY()
|
GENERATED_BODY()
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
UFUNCTION(BlueprintImplementableEvent)
|
||||||
|
void ReloadBugData();
|
||||||
UFUNCTION(BlueprintImplementableEvent)
|
UFUNCTION(BlueprintImplementableEvent)
|
||||||
void LoadBugSubmissionForm();
|
void LoadBugSubmissionForm();
|
||||||
|
|
||||||
void SetBugID(const uint32 &ID) { this->BugID = ID; }
|
UFUNCTION(BlueprintCallable)
|
||||||
void SetBugSummary(const FString &Summary) { this->BugSummary = Summary; }
|
void SetBugData(const FJSONBugData &Data) { this->BugData = Data; this->ReloadBugData(); }
|
||||||
void SetBugStatus(const EBugStatus &Status) { this->BugStatus = Status; }
|
UFUNCTION(BlueprintPure)
|
||||||
|
FJSONBugData GetBugData() const { return this->BugData; }
|
||||||
|
UFUNCTION(BlueprintPure)
|
||||||
|
EBugStatus GetBugStatus() const;
|
||||||
|
|
||||||
private:
|
protected:
|
||||||
uint32 BugID = 0;
|
FJSONBugData BugData;
|
||||||
FString BugSummary;
|
|
||||||
EBugStatus BugStatus;
|
|
||||||
};
|
};
|
||||||
|
|||||||
@ -4,67 +4,13 @@
|
|||||||
|
|
||||||
#include "CoreMinimal.h"
|
#include "CoreMinimal.h"
|
||||||
|
|
||||||
|
#include "UnrealzillaJSON.h"
|
||||||
#include "Interfaces/IHttpRequest.h"
|
#include "Interfaces/IHttpRequest.h"
|
||||||
#include "Interfaces/IHttpResponse.h"
|
#include "Interfaces/IHttpResponse.h"
|
||||||
|
|
||||||
#include "BugMarkerLoader.generated.h"
|
#include "BugMarkerLoader.generated.h"
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* JSON structs for bug lists
|
|
||||||
*/
|
|
||||||
USTRUCT(Blueprintable)
|
|
||||||
struct FJSONBugData
|
|
||||||
{
|
|
||||||
GENERATED_BODY()
|
|
||||||
public:
|
|
||||||
UPROPERTY()
|
|
||||||
int32 id = -1;
|
|
||||||
UPROPERTY()
|
|
||||||
FString summary;
|
|
||||||
UPROPERTY()
|
|
||||||
FString component;
|
|
||||||
UPROPERTY()
|
|
||||||
FString cf_mapname;
|
|
||||||
UPROPERTY()
|
|
||||||
FString cf_location;
|
|
||||||
UPROPERTY()
|
|
||||||
FString platform;
|
|
||||||
UPROPERTY()
|
|
||||||
FString op_sys;
|
|
||||||
UPROPERTY()
|
|
||||||
bool is_open = true;
|
|
||||||
UPROPERTY()
|
|
||||||
FString severity;
|
|
||||||
UPROPERTY()
|
|
||||||
FString status;
|
|
||||||
UPROPERTY()
|
|
||||||
FString resolution;
|
|
||||||
UPROPERTY()
|
|
||||||
int32 dupe_of = -1;
|
|
||||||
};
|
|
||||||
|
|
||||||
USTRUCT(Blueprintable)
|
|
||||||
struct FJSONBugResponse
|
|
||||||
{
|
|
||||||
GENERATED_BODY()
|
|
||||||
public:
|
|
||||||
UPROPERTY(BlueprintReadOnly)
|
|
||||||
TArray<FJSONBugData> bugs;
|
|
||||||
UPROPERTY(BlueprintReadOnly)
|
|
||||||
bool error = false;
|
|
||||||
UPROPERTY(BlueprintReadOnly)
|
|
||||||
int32 code = -1;
|
|
||||||
UPROPERTY(BlueprintReadOnly)
|
|
||||||
FString message;
|
|
||||||
UPROPERTY(BlueprintReadOnly)
|
|
||||||
FString documentation;
|
|
||||||
};
|
|
||||||
/**
|
|
||||||
* END JSON structs for bug lists
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
UCLASS()
|
UCLASS()
|
||||||
class UNREALZILLA_API ABugMarkerLoader : public AActor
|
class UNREALZILLA_API ABugMarkerLoader : public AActor
|
||||||
{
|
{
|
||||||
|
|||||||
@ -3,6 +3,7 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "CoreMinimal.h"
|
#include "CoreMinimal.h"
|
||||||
|
#include "UnrealzillaJSON.h"
|
||||||
#include "GameFramework/Pawn.h"
|
#include "GameFramework/Pawn.h"
|
||||||
|
|
||||||
#include "BugPlacerPawn.generated.h"
|
#include "BugPlacerPawn.generated.h"
|
||||||
@ -22,16 +23,16 @@ public:
|
|||||||
|
|
||||||
UFUNCTION(BlueprintCallable)
|
UFUNCTION(BlueprintCallable)
|
||||||
void Activate();
|
void Activate();
|
||||||
|
|
||||||
UFUNCTION(BlueprintCallable)
|
UFUNCTION(BlueprintCallable)
|
||||||
void Deactivate();
|
void Deactivate();
|
||||||
|
|
||||||
UFUNCTION(BlueprintCallable, meta=(WorldContext="WorldContextObject"))
|
UFUNCTION(BlueprintImplementableEvent)
|
||||||
static void SpawnBugPlacerPawn(const UObject *WorldContextObject);
|
void UpdateBugInformation(const FJSONBugData &BugData);
|
||||||
|
|
||||||
|
UFUNCTION(BlueprintCallable, meta=(WorldContext="WorldContextObject"))
|
||||||
|
static void SpawnBugPlacerPawn(const UObject *WorldContextObject, TSubclassOf<ABugPlacerPawn> Class);
|
||||||
UFUNCTION(BlueprintCallable, meta=(WorldContext="WorldContextObject"))
|
UFUNCTION(BlueprintCallable, meta=(WorldContext="WorldContextObject"))
|
||||||
static void ShowBugMarkersInLevel(const UObject *WorldContextObject);
|
static void ShowBugMarkersInLevel(const UObject *WorldContextObject);
|
||||||
|
|
||||||
UFUNCTION(BlueprintCallable, meta=(WorldContext="WorldContextObject"))
|
UFUNCTION(BlueprintCallable, meta=(WorldContext="WorldContextObject"))
|
||||||
static void HideBugMarkersInLevel(const UObject *WorldContextObject);
|
static void HideBugMarkersInLevel(const UObject *WorldContextObject);
|
||||||
|
|
||||||
|
|||||||
@ -6,231 +6,13 @@
|
|||||||
|
|
||||||
#include "BugFormButton.h"
|
#include "BugFormButton.h"
|
||||||
#include "CommonActivatableWidget.h"
|
#include "CommonActivatableWidget.h"
|
||||||
|
#include "UnrealzillaJSON.h"
|
||||||
#include "Interfaces/IHttpRequest.h"
|
#include "Interfaces/IHttpRequest.h"
|
||||||
#include "Interfaces/IHttpResponse.h"
|
#include "Interfaces/IHttpResponse.h"
|
||||||
|
|
||||||
#include "BugSubmissionForm.generated.h"
|
#include "BugSubmissionForm.generated.h"
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* JSON structs for POST
|
|
||||||
*/
|
|
||||||
USTRUCT()
|
|
||||||
struct FJSONPostBug
|
|
||||||
{
|
|
||||||
GENERATED_BODY()
|
|
||||||
public:
|
|
||||||
UPROPERTY()
|
|
||||||
FString product;
|
|
||||||
UPROPERTY()
|
|
||||||
FString version;
|
|
||||||
UPROPERTY()
|
|
||||||
FString platform;
|
|
||||||
UPROPERTY()
|
|
||||||
FString op_sys;
|
|
||||||
UPROPERTY()
|
|
||||||
FString component;
|
|
||||||
UPROPERTY()
|
|
||||||
FString severity;
|
|
||||||
UPROPERTY()
|
|
||||||
FString cf_mapname;
|
|
||||||
UPROPERTY()
|
|
||||||
FString cf_location;
|
|
||||||
UPROPERTY()
|
|
||||||
FString summary;
|
|
||||||
UPROPERTY()
|
|
||||||
FString description;
|
|
||||||
UPROPERTY()
|
|
||||||
FString status;
|
|
||||||
};
|
|
||||||
|
|
||||||
USTRUCT(Blueprintable)
|
|
||||||
struct FJSONPostResponse
|
|
||||||
{
|
|
||||||
GENERATED_BODY()
|
|
||||||
public:
|
|
||||||
UPROPERTY(BlueprintReadOnly)
|
|
||||||
int32 id = -1;
|
|
||||||
UPROPERTY(BlueprintReadOnly)
|
|
||||||
bool error = false;
|
|
||||||
UPROPERTY(BlueprintReadOnly)
|
|
||||||
int32 code = -1;
|
|
||||||
UPROPERTY(BlueprintReadOnly)
|
|
||||||
FString message;
|
|
||||||
UPROPERTY(BlueprintReadOnly)
|
|
||||||
FString documentation;
|
|
||||||
};
|
|
||||||
/**
|
|
||||||
* END JSON structs for POST
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
///**
|
|
||||||
// * JSON structs for bug lists
|
|
||||||
// */
|
|
||||||
//USTRUCT(Blueprintable)
|
|
||||||
//struct FJSONBugData
|
|
||||||
//{
|
|
||||||
// GENERATED_BODY()
|
|
||||||
//public:
|
|
||||||
// UPROPERTY()
|
|
||||||
// FString component;
|
|
||||||
// UPROPERTY()
|
|
||||||
// FString cf_mapname;
|
|
||||||
// UPROPERTY()
|
|
||||||
// FString cf_location;
|
|
||||||
//};
|
|
||||||
//
|
|
||||||
//USTRUCT(Blueprintable)
|
|
||||||
//struct FJSONBugResponse
|
|
||||||
//{
|
|
||||||
// GENERATED_BODY()
|
|
||||||
//public:
|
|
||||||
// UPROPERTY(BlueprintReadOnly)
|
|
||||||
// TArray<FJSONBugData> bugs;
|
|
||||||
// UPROPERTY(BlueprintReadOnly)
|
|
||||||
// bool error = false;
|
|
||||||
// UPROPERTY(BlueprintReadOnly)
|
|
||||||
// int32 code = -1;
|
|
||||||
// UPROPERTY(BlueprintReadOnly)
|
|
||||||
// FString message;
|
|
||||||
// UPROPERTY(BlueprintReadOnly)
|
|
||||||
// FString documentation;
|
|
||||||
//};
|
|
||||||
///**
|
|
||||||
// * END JSON structs for bug lists
|
|
||||||
// */
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* JSON structs for product data
|
|
||||||
*/
|
|
||||||
USTRUCT(Blueprintable)
|
|
||||||
struct FJSONComponentData
|
|
||||||
{
|
|
||||||
GENERATED_BODY()
|
|
||||||
public:
|
|
||||||
UPROPERTY()
|
|
||||||
int32 id = -1;
|
|
||||||
UPROPERTY()
|
|
||||||
bool is_active = false;
|
|
||||||
UPROPERTY()
|
|
||||||
FString name;
|
|
||||||
UPROPERTY()
|
|
||||||
FString description;
|
|
||||||
UPROPERTY()
|
|
||||||
FString default_assigned_to;
|
|
||||||
UPROPERTY()
|
|
||||||
int32 sort_key = -1;
|
|
||||||
};
|
|
||||||
|
|
||||||
USTRUCT(Blueprintable)
|
|
||||||
struct FJSONVersionData
|
|
||||||
{
|
|
||||||
GENERATED_BODY()
|
|
||||||
public:
|
|
||||||
UPROPERTY()
|
|
||||||
int32 id = -1;
|
|
||||||
UPROPERTY()
|
|
||||||
bool is_active = false;
|
|
||||||
UPROPERTY()
|
|
||||||
FString name;
|
|
||||||
UPROPERTY()
|
|
||||||
int32 sort_key = -1;
|
|
||||||
};
|
|
||||||
|
|
||||||
USTRUCT(Blueprintable)
|
|
||||||
struct FJSONProductData
|
|
||||||
{
|
|
||||||
GENERATED_BODY()
|
|
||||||
public:
|
|
||||||
UPROPERTY(BlueprintReadOnly)
|
|
||||||
FString name;
|
|
||||||
UPROPERTY(BlueprintReadOnly)
|
|
||||||
FString classification;
|
|
||||||
UPROPERTY(BlueprintReadOnly)
|
|
||||||
FString description;
|
|
||||||
UPROPERTY(BlueprintReadOnly)
|
|
||||||
TArray<FJSONComponentData> components;
|
|
||||||
UPROPERTY(BlueprintReadOnly)
|
|
||||||
TArray<FJSONVersionData> versions;
|
|
||||||
};
|
|
||||||
|
|
||||||
USTRUCT(Blueprintable)
|
|
||||||
struct FJSONProductResponse
|
|
||||||
{
|
|
||||||
GENERATED_BODY()
|
|
||||||
public:
|
|
||||||
UPROPERTY(BlueprintReadOnly)
|
|
||||||
TArray<FJSONProductData> products;
|
|
||||||
|
|
||||||
UPROPERTY(BlueprintReadOnly)
|
|
||||||
bool error = false;
|
|
||||||
UPROPERTY(BlueprintReadOnly)
|
|
||||||
int32 code = -1;
|
|
||||||
UPROPERTY(BlueprintReadOnly)
|
|
||||||
FString message;
|
|
||||||
UPROPERTY(BlueprintReadOnly)
|
|
||||||
FString documentation;
|
|
||||||
};
|
|
||||||
/**
|
|
||||||
* END JSON structs for product data
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* JSON structs for product data
|
|
||||||
*/
|
|
||||||
USTRUCT(Blueprintable)
|
|
||||||
struct FJSONFieldValueData
|
|
||||||
{
|
|
||||||
GENERATED_BODY()
|
|
||||||
public:
|
|
||||||
UPROPERTY()
|
|
||||||
FString name;
|
|
||||||
UPROPERTY()
|
|
||||||
int32 sort_key = -1;
|
|
||||||
};
|
|
||||||
|
|
||||||
USTRUCT(Blueprintable)
|
|
||||||
struct FJSONFieldData
|
|
||||||
{
|
|
||||||
GENERATED_BODY()
|
|
||||||
public:
|
|
||||||
UPROPERTY(BlueprintReadOnly)
|
|
||||||
int32 id = -1;
|
|
||||||
UPROPERTY(BlueprintReadOnly)
|
|
||||||
FString name;
|
|
||||||
UPROPERTY(BlueprintReadOnly)
|
|
||||||
FString display_name;
|
|
||||||
UPROPERTY(BlueprintReadOnly)
|
|
||||||
bool is_mandatory = false;
|
|
||||||
UPROPERTY(BlueprintReadOnly)
|
|
||||||
TArray<FJSONFieldValueData> values;
|
|
||||||
};
|
|
||||||
|
|
||||||
USTRUCT(Blueprintable)
|
|
||||||
struct FJSONFieldResponse
|
|
||||||
{
|
|
||||||
GENERATED_BODY()
|
|
||||||
public:
|
|
||||||
UPROPERTY(BlueprintReadOnly)
|
|
||||||
TArray<FJSONFieldData> fields;
|
|
||||||
|
|
||||||
UPROPERTY(BlueprintReadOnly)
|
|
||||||
bool error = false;
|
|
||||||
UPROPERTY(BlueprintReadOnly)
|
|
||||||
int32 code = -1;
|
|
||||||
UPROPERTY(BlueprintReadOnly)
|
|
||||||
FString message;
|
|
||||||
UPROPERTY(BlueprintReadOnly)
|
|
||||||
FString documentation;
|
|
||||||
};
|
|
||||||
/**
|
|
||||||
* END JSON structs for product data
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
UCLASS()
|
UCLASS()
|
||||||
class UNREALZILLA_API UBugSubmissionForm : public UCommonActivatableWidget
|
class UNREALZILLA_API UBugSubmissionForm : public UCommonActivatableWidget
|
||||||
{
|
{
|
||||||
@ -298,6 +80,7 @@ protected:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
void ServerPOSTResponse(FHttpRequestPtr Request, FHttpResponsePtr Response, bool Success);
|
void ServerPOSTResponse(FHttpRequestPtr Request, FHttpResponsePtr Response, bool Success);
|
||||||
|
void ServerPOSTUpdateMarkerResponse(FHttpRequestPtr Request, FHttpResponsePtr Response, bool Success);
|
||||||
void ServerProductInfoResponse(FHttpRequestPtr Request, FHttpResponsePtr Response, bool Success);
|
void ServerProductInfoResponse(FHttpRequestPtr Request, FHttpResponsePtr Response, bool Success);
|
||||||
void ServerSeverityInfoResponse(FHttpRequestPtr Request, FHttpResponsePtr Response, bool Success);
|
void ServerSeverityInfoResponse(FHttpRequestPtr Request, FHttpResponsePtr Response, bool Success);
|
||||||
void ServerPlatformInfoResponse(FHttpRequestPtr Request, FHttpResponsePtr Response, bool Success);
|
void ServerPlatformInfoResponse(FHttpRequestPtr Request, FHttpResponsePtr Response, bool Success);
|
||||||
|
|||||||
@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
#include "BugPlacerPawn.h"
|
||||||
#include "Engine/DeveloperSettingsBackedByCVars.h"
|
#include "Engine/DeveloperSettingsBackedByCVars.h"
|
||||||
|
|
||||||
#include "UnrealzillaGlobalSettings.generated.h"
|
#include "UnrealzillaGlobalSettings.generated.h"
|
||||||
|
|||||||
244
Source/Unrealzilla/Public/UnrealzillaJSON.h
Normal file
244
Source/Unrealzilla/Public/UnrealzillaJSON.h
Normal file
@ -0,0 +1,244 @@
|
|||||||
|
// ©2022 Batty Bovine Productions, LLC. All Rights Reserved.
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include "CoreMinimal.h"
|
||||||
|
|
||||||
|
#include "UnrealzillaJSON.generated.h"
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* JSON structs for POST
|
||||||
|
*/
|
||||||
|
USTRUCT()
|
||||||
|
struct FJSONPostBug
|
||||||
|
{
|
||||||
|
GENERATED_BODY()
|
||||||
|
public:
|
||||||
|
UPROPERTY()
|
||||||
|
FString product;
|
||||||
|
UPROPERTY()
|
||||||
|
FString version;
|
||||||
|
UPROPERTY()
|
||||||
|
FString platform;
|
||||||
|
UPROPERTY()
|
||||||
|
FString op_sys;
|
||||||
|
UPROPERTY()
|
||||||
|
FString component;
|
||||||
|
UPROPERTY()
|
||||||
|
FString severity;
|
||||||
|
UPROPERTY()
|
||||||
|
FString cf_mapname;
|
||||||
|
UPROPERTY()
|
||||||
|
FString cf_location;
|
||||||
|
UPROPERTY()
|
||||||
|
FString summary;
|
||||||
|
UPROPERTY()
|
||||||
|
FString description;
|
||||||
|
UPROPERTY()
|
||||||
|
FString status;
|
||||||
|
};
|
||||||
|
|
||||||
|
USTRUCT(Blueprintable)
|
||||||
|
struct FJSONPostResponse
|
||||||
|
{
|
||||||
|
GENERATED_BODY()
|
||||||
|
public:
|
||||||
|
UPROPERTY(BlueprintReadOnly)
|
||||||
|
int32 id = -1;
|
||||||
|
UPROPERTY(BlueprintReadOnly)
|
||||||
|
bool error = false;
|
||||||
|
UPROPERTY(BlueprintReadOnly)
|
||||||
|
int32 code = -1;
|
||||||
|
UPROPERTY(BlueprintReadOnly)
|
||||||
|
FString message;
|
||||||
|
UPROPERTY(BlueprintReadOnly)
|
||||||
|
FString documentation;
|
||||||
|
};
|
||||||
|
/**
|
||||||
|
* END JSON structs for POST
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* JSON structs for product data
|
||||||
|
*/
|
||||||
|
USTRUCT(Blueprintable)
|
||||||
|
struct FJSONComponentData
|
||||||
|
{
|
||||||
|
GENERATED_BODY()
|
||||||
|
public:
|
||||||
|
UPROPERTY()
|
||||||
|
int32 id = -1;
|
||||||
|
UPROPERTY()
|
||||||
|
bool is_active = false;
|
||||||
|
UPROPERTY()
|
||||||
|
FString name;
|
||||||
|
UPROPERTY()
|
||||||
|
FString description;
|
||||||
|
UPROPERTY()
|
||||||
|
FString default_assigned_to;
|
||||||
|
UPROPERTY()
|
||||||
|
int32 sort_key = -1;
|
||||||
|
};
|
||||||
|
|
||||||
|
USTRUCT(Blueprintable)
|
||||||
|
struct FJSONVersionData
|
||||||
|
{
|
||||||
|
GENERATED_BODY()
|
||||||
|
public:
|
||||||
|
UPROPERTY()
|
||||||
|
int32 id = -1;
|
||||||
|
UPROPERTY()
|
||||||
|
bool is_active = false;
|
||||||
|
UPROPERTY()
|
||||||
|
FString name;
|
||||||
|
UPROPERTY()
|
||||||
|
int32 sort_key = -1;
|
||||||
|
};
|
||||||
|
|
||||||
|
USTRUCT(Blueprintable)
|
||||||
|
struct FJSONProductData
|
||||||
|
{
|
||||||
|
GENERATED_BODY()
|
||||||
|
public:
|
||||||
|
UPROPERTY(BlueprintReadOnly)
|
||||||
|
FString name;
|
||||||
|
UPROPERTY(BlueprintReadOnly)
|
||||||
|
FString classification;
|
||||||
|
UPROPERTY(BlueprintReadOnly)
|
||||||
|
FString description;
|
||||||
|
UPROPERTY(BlueprintReadOnly)
|
||||||
|
TArray<FJSONComponentData> components;
|
||||||
|
UPROPERTY(BlueprintReadOnly)
|
||||||
|
TArray<FJSONVersionData> versions;
|
||||||
|
};
|
||||||
|
|
||||||
|
USTRUCT(Blueprintable)
|
||||||
|
struct FJSONProductResponse
|
||||||
|
{
|
||||||
|
GENERATED_BODY()
|
||||||
|
public:
|
||||||
|
UPROPERTY(BlueprintReadOnly)
|
||||||
|
TArray<FJSONProductData> products;
|
||||||
|
|
||||||
|
UPROPERTY(BlueprintReadOnly)
|
||||||
|
bool error = false;
|
||||||
|
UPROPERTY(BlueprintReadOnly)
|
||||||
|
int32 code = -1;
|
||||||
|
UPROPERTY(BlueprintReadOnly)
|
||||||
|
FString message;
|
||||||
|
UPROPERTY(BlueprintReadOnly)
|
||||||
|
FString documentation;
|
||||||
|
};
|
||||||
|
/**
|
||||||
|
* END JSON structs for product data
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* JSON structs for product data
|
||||||
|
*/
|
||||||
|
USTRUCT(Blueprintable)
|
||||||
|
struct FJSONFieldValueData
|
||||||
|
{
|
||||||
|
GENERATED_BODY()
|
||||||
|
public:
|
||||||
|
UPROPERTY()
|
||||||
|
FString name;
|
||||||
|
UPROPERTY()
|
||||||
|
int32 sort_key = -1;
|
||||||
|
};
|
||||||
|
|
||||||
|
USTRUCT(Blueprintable)
|
||||||
|
struct FJSONFieldData
|
||||||
|
{
|
||||||
|
GENERATED_BODY()
|
||||||
|
public:
|
||||||
|
UPROPERTY(BlueprintReadOnly)
|
||||||
|
int32 id = -1;
|
||||||
|
UPROPERTY(BlueprintReadOnly)
|
||||||
|
FString name;
|
||||||
|
UPROPERTY(BlueprintReadOnly)
|
||||||
|
FString display_name;
|
||||||
|
UPROPERTY(BlueprintReadOnly)
|
||||||
|
bool is_mandatory = false;
|
||||||
|
UPROPERTY(BlueprintReadOnly)
|
||||||
|
TArray<FJSONFieldValueData> values;
|
||||||
|
};
|
||||||
|
|
||||||
|
USTRUCT(Blueprintable)
|
||||||
|
struct FJSONFieldResponse
|
||||||
|
{
|
||||||
|
GENERATED_BODY()
|
||||||
|
public:
|
||||||
|
UPROPERTY(BlueprintReadOnly)
|
||||||
|
TArray<FJSONFieldData> fields;
|
||||||
|
|
||||||
|
UPROPERTY(BlueprintReadOnly)
|
||||||
|
bool error = false;
|
||||||
|
UPROPERTY(BlueprintReadOnly)
|
||||||
|
int32 code = -1;
|
||||||
|
UPROPERTY(BlueprintReadOnly)
|
||||||
|
FString message;
|
||||||
|
UPROPERTY(BlueprintReadOnly)
|
||||||
|
FString documentation;
|
||||||
|
};
|
||||||
|
/**
|
||||||
|
* END JSON structs for product data
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* JSON structs for bug lists
|
||||||
|
*/
|
||||||
|
USTRUCT(Blueprintable)
|
||||||
|
struct FJSONBugData
|
||||||
|
{
|
||||||
|
GENERATED_BODY()
|
||||||
|
public:
|
||||||
|
UPROPERTY(BlueprintReadOnly)
|
||||||
|
int32 id = -1;
|
||||||
|
UPROPERTY(BlueprintReadOnly)
|
||||||
|
FString summary;
|
||||||
|
UPROPERTY(BlueprintReadOnly)
|
||||||
|
FString component;
|
||||||
|
UPROPERTY(BlueprintReadOnly)
|
||||||
|
FString cf_mapname;
|
||||||
|
UPROPERTY(BlueprintReadOnly)
|
||||||
|
FString cf_location;
|
||||||
|
UPROPERTY(BlueprintReadOnly)
|
||||||
|
FString platform;
|
||||||
|
UPROPERTY(BlueprintReadOnly)
|
||||||
|
FString op_sys;
|
||||||
|
UPROPERTY(BlueprintReadOnly)
|
||||||
|
bool is_open = true;
|
||||||
|
UPROPERTY(BlueprintReadOnly)
|
||||||
|
FString severity;
|
||||||
|
UPROPERTY(BlueprintReadOnly)
|
||||||
|
FString status;
|
||||||
|
UPROPERTY(BlueprintReadOnly)
|
||||||
|
FString resolution;
|
||||||
|
UPROPERTY(BlueprintReadOnly)
|
||||||
|
int32 dupe_of = -1;
|
||||||
|
};
|
||||||
|
|
||||||
|
USTRUCT(Blueprintable)
|
||||||
|
struct FJSONBugResponse
|
||||||
|
{
|
||||||
|
GENERATED_BODY()
|
||||||
|
public:
|
||||||
|
UPROPERTY(BlueprintReadOnly)
|
||||||
|
TArray<FJSONBugData> bugs;
|
||||||
|
UPROPERTY(BlueprintReadOnly)
|
||||||
|
bool error = false;
|
||||||
|
UPROPERTY(BlueprintReadOnly)
|
||||||
|
int32 code = -1;
|
||||||
|
UPROPERTY(BlueprintReadOnly)
|
||||||
|
FString message;
|
||||||
|
UPROPERTY(BlueprintReadOnly)
|
||||||
|
FString documentation;
|
||||||
|
};
|
||||||
|
/**
|
||||||
|
* END JSON structs for bug lists
|
||||||
|
*/
|
||||||
Loading…
x
Reference in New Issue
Block a user