Skip to content
Snippets Groups Projects
Commit 536a4bdf authored by Timon Römer's avatar Timon Römer
Browse files

Removes Debugging in Editor

parent 5d516f33
No related branches found
No related tags found
2 merge requests!81Inten Select 5.3,!80UE5.3-2023.1-rc2
Pipeline #371687 failed
Showing
with 54 additions and 38 deletions
......@@ -19,6 +19,17 @@ protected:
public:
UIntenSelectableCylinderScoring();
virtual void PostEditChangeProperty(FPropertyChangedEvent& PropertyChangedEvent) override
{
Super::PostEditChangeProperty(PropertyChangedEvent);
// Check if the property changed is MyMonitoredProperty
if (PropertyChangedEvent.Property && PropertyChangedEvent.Property->GetName() == TEXT("LinePoints"))
{
}
}
UPROPERTY(EditAnywhere)
bool DrawDebug = true;
......
......@@ -60,7 +60,7 @@ bool FIntenSelectableCircleScoringVisualizer::VisProxyHandleClick(FEditorViewpor
{
bool bEditing = false;
UE_LOG(LogTemp, Warning, TEXT("Handling Click"));
//UE_LOG(LogTemp, Warning, TEXT("Handling Click"));
if (VisProxy && VisProxy->Component.IsValid())
{
......@@ -126,7 +126,7 @@ bool FIntenSelectableCircleScoringVisualizer::HandleInputDelta(FEditorViewportCl
if (CurrentSelectionIndex != INDEX_NONE)
{
UE_LOG(LogTemp, Warning, TEXT("Current Selection! %s"), *DeltaTranslate.ToString());
//UE_LOG(LogTemp, Warning, TEXT("Current Selection! %s"), *DeltaTranslate.ToString());
if(CurrentSelectionIndex == 0)
{
......@@ -153,7 +153,7 @@ bool FIntenSelectableCircleScoringVisualizer::HandleInputDelta(FEditorViewportCl
NotifyPropertiesModified(GetEditedScoringComponent(), Properties, EPropertyChangeType::ValueSet);
}else
{
UE_LOG(LogTemp, Warning, TEXT("No Current Selection!"));
//UE_LOG(LogTemp, Warning, TEXT("No Current Selection!"));
}
return bHandled;
......
......@@ -49,7 +49,7 @@ bool FIntenSelectableCubeScoringVisualizer::VisProxyHandleClick(FEditorViewportC
{
bool bEditing = false;
UE_LOG(LogTemp, Warning, TEXT("Handling Click"));
//UE_LOG(LogTemp, Warning, TEXT("Handling Click"));
if (VisProxy && VisProxy->Component.IsValid())
{
......@@ -108,7 +108,7 @@ bool FIntenSelectableCubeScoringVisualizer::HandleInputDelta(FEditorViewportClie
if (CurrentSelectionIndex != INDEX_NONE)
{
UE_LOG(LogTemp, Warning, TEXT("Current Selection! %s"), *DeltaTranslate.ToString());
//UE_LOG(LogTemp, Warning, TEXT("Current Selection! %s"), *DeltaTranslate.ToString());
const FVector LocalCenter = GetEditedScoringComponent()->GetComponentLocation();
const FVector NewCenter = LocalCenter + DeltaTranslate;
......@@ -125,7 +125,7 @@ bool FIntenSelectableCubeScoringVisualizer::HandleInputDelta(FEditorViewportClie
bHandled = true;
}else
{
UE_LOG(LogTemp, Warning, TEXT("No Current Selection!"));
//UE_LOG(LogTemp, Warning, TEXT("No Current Selection!"));
}
return bHandled;
......
#include "Interaction/IntenSelectableCylinderScoringVisualizer.h"
#include "ActorEditorUtils.h"
#include "SceneManagement.h"
......@@ -50,7 +49,7 @@ bool FIntenSelectableCylinderScoringVisualizer::VisProxyHandleClick(FEditorViewp
{
bool bEditing = false;
UE_LOG(LogTemp, Warning, TEXT("Handling Click"));
//UE_LOG(LogTemp, Warning, TEXT("Handling Click"));
if (VisProxy && VisProxy->Component.IsValid())
{
......@@ -91,8 +90,6 @@ void FIntenSelectableCylinderScoringVisualizer::DrawVisualization(const UActorCo
PDI->SetHitProxy(nullptr);
}
PDI->SetHitProxy(new FCylinderPointProxy(Component, INDEX_NONE));
const FVector Start = ComponentCasted->GetComponentTransform().TransformPositionNoScale(ComponentCasted->LinePoints[0]);
const FVector End = ComponentCasted->GetComponentTransform().TransformPositionNoScale(ComponentCasted->LinePoints[1]);
PDI->DrawLine(Start, End, FColor::Green, SDPG_World);
......@@ -100,7 +97,6 @@ void FIntenSelectableCylinderScoringVisualizer::DrawVisualization(const UActorCo
const float Dist = (End-Start).Size();
DrawCylinder(PDI, Start, End, ComponentCasted->Radius,20 , &DebugMaterial, 0);
PDI->SetHitProxy(nullptr);
}
}
......@@ -134,31 +130,39 @@ bool FIntenSelectableCylinderScoringVisualizer::HandleInputDelta(FEditorViewport
{
ScoringComponent->Modify();
UE_LOG(LogTemp, Warning, TEXT("Current Delta: %s"), *DeltaTranslate.ToString());
UE_LOG(LogTemp, Warning, TEXT("Current Index: %d"), CurrentCylinderSelectionIndex);
const FVector WorldSelection = ScoringComponent->GetComponentTransform().TransformPositionNoScale(ScoringComponent->LinePoints[CurrentCylinderSelectionIndex]);
const FVector NewWorldPos = ScoringComponent->GetComponentTransform().InverseTransformPositionNoScale(WorldSelection + DeltaTranslate);
ScoringComponent->LinePoints[CurrentCylinderSelectionIndex] += DeltaTranslate;
UE_LOG(LogTemp, Warning, TEXT("Component: %s"), *(ScoringComponent->LinePoints[CurrentCylinderSelectionIndex]).ToString());
ScoringComponent->MarkRenderStateDirty();
GEditor->RedrawLevelEditingViewports(true);
//UE_LOG(LogTemp, Warning, TEXT("Component: %s"), *(ScoringComponent->LinePoints[CurrentCylinderSelectionIndex]).ToString());
const FVector Average = (ScoringComponent->LinePoints[0] + ScoringComponent->LinePoints[1])/ 2;
const FVector ShiftToMiddle = Average;
ScoringComponent->SetWorldLocation(ScoringComponent->GetComponentTransform().TransformPositionNoScale(Average));
ScoringComponent->LinePoints[0] -= ShiftToMiddle;
ScoringComponent->LinePoints[1] -= ShiftToMiddle;
TArray<FProperty*> Properties;
Properties.Add(PointsProperty);
Properties.Add(RadiusProperty);
NotifyPropertiesModified(ScoringComponent, Properties, EPropertyChangeType::ValueSet);
/*
const FVector Average = (ScoringComponent->LinePoints[0] + ScoringComponent->LinePoints[1]) / 2;
ScoringComponent->SetWorldLocation(ScoringComponent->GetComponentTransform().TransformPositionNoScale(Average));
ScoringComponent->LinePoints[0] -= Average;
ScoringComponent->LinePoints[1] -= Average;
ScoringComponent->MarkRenderStateDirty();
GEditor->RedrawLevelEditingViewports(true);
ScoringComponent->PostEditChange();
GEditor->NoteActorMovement();
// If you're modifying an actor's component, it might be a good idea to also mark the actor as modified
ScoringComponent->GetOwner()->Modify();
ScoringComponent->GetOwner()->PostEditChange();
// If the component's package might be unsaved, mark it dirty to ensure changes aren't lost
ScoringComponent->GetOuter()->MarkPackageDirty();*/
GEditor->RedrawLevelEditingViewports(true);
bHandled = true;
......@@ -171,7 +175,7 @@ bool FIntenSelectableCylinderScoringVisualizer::HandleInputDelta(FEditorViewport
ScoringComponent->MarkRenderStateDirty();
GEditor->RedrawLevelEditingViewports(true);
UE_LOG(LogTemp, Warning, TEXT("Cylinder Selected!"));
//UE_LOG(LogTemp, Warning, TEXT("Cylinder Selected!"));
return false;
}
......
......@@ -48,7 +48,7 @@ bool FIntenSelectableLineScoringVisualizer::VisProxyHandleClick(FEditorViewportC
{
bool bEditing = false;
UE_LOG(LogTemp, Warning, TEXT("Handling Click"));
//UE_LOG(LogTemp, Warning, TEXT("Handling Click"));
if (VisProxy && VisProxy->Component.IsValid())
{
......@@ -133,7 +133,7 @@ bool FIntenSelectableLineScoringVisualizer::HandleInputDelta(FEditorViewportClie
ScoringComponent->AddWorldRotation(DeltaRotate);
}else
{
UE_LOG(LogTemp, Warning, TEXT("Current Selection! %s"), *DeltaTranslate.ToString());
//UE_LOG(LogTemp, Warning, TEXT("Current Selection! %s"), *DeltaTranslate.ToString());
const FVector WorldSelection = ScoringComponent->GetComponentTransform().TransformPositionNoScale(GetEditedScoringComponent()->LinePoints[CurrentLineSelectionIndex]);
const FVector NewWorldPos = ScoringComponent->GetComponentTransform().InverseTransformPositionNoScale(WorldSelection + DeltaTranslate);
......@@ -159,7 +159,7 @@ bool FIntenSelectableLineScoringVisualizer::HandleInputDelta(FEditorViewportClie
}else
{
UE_LOG(LogTemp, Warning, TEXT("No Current Selection!"));
//UE_LOG(LogTemp, Warning, TEXT("No Current Selection!"));
}
return bHandled;
......
......@@ -54,17 +54,17 @@ bool FIntenSelectableMultiPointScoringVisualizer::VisProxyHandleClick(FEditorVie
FMultiPointProxy* Proxy = (FMultiPointProxy*)VisProxy;
CurrentSelectionIndex = Proxy->TargetIndex;
UE_LOG(LogTemp, Warning, TEXT("Handling Click %i"), CurrentSelectionIndex);
//UE_LOG(LogTemp, Warning, TEXT("Handling Click %i"), CurrentSelectionIndex);
}else
{
CurrentSelectionIndex = INDEX_NONE;
UE_LOG(LogTemp, Warning, TEXT("Handling Click => no selection"));
//UE_LOG(LogTemp, Warning, TEXT("Handling Click => no selection"));
}
}
else
{
CurrentSelectionIndex = INDEX_NONE;
UE_LOG(LogTemp, Warning, TEXT("Handling Click => no selection"));
//UE_LOG(LogTemp, Warning, TEXT("Handling Click => no selection"));
}
......@@ -112,7 +112,7 @@ bool FIntenSelectableMultiPointScoringVisualizer::HandleInputDelta(FEditorViewpo
const FVector NewWorldPos = ScoringComponent->GetComponentTransform().InverseTransformPosition(WorldSelection + DeltaTranslate);
ScoringComponent->PointsToSelect[CurrentSelectionIndex] = NewWorldPos;
UE_LOG(LogTemp, Warning, TEXT("New Pos: %s"), *ScoringComponent->PointsToSelect[CurrentSelectionIndex].ToString());
//UE_LOG(LogTemp, Warning, TEXT("New Pos: %s"), *ScoringComponent->PointsToSelect[CurrentSelectionIndex].ToString());
ScoringComponent->MarkRenderStateDirty();
bHandled = true;
......@@ -125,7 +125,7 @@ bool FIntenSelectableMultiPointScoringVisualizer::HandleInputDelta(FEditorViewpo
}else
{
UE_LOG(LogTemp, Warning, TEXT("No Current Selection!"));
//UE_LOG(LogTemp, Warning, TEXT("No Current Selection!"));
}
return bHandled;
......
......@@ -241,7 +241,7 @@ bool FIntenSelectableRectangleScoringVisualizer::HandleInputDelta(FEditorViewpor
return bHandled;
}else
{
UE_LOG(LogTemp, Warning, TEXT("No Current Selection!"));
//UE_LOG(LogTemp, Warning, TEXT("No Current Selection!"));
}
return false;
......
......@@ -43,7 +43,7 @@ bool FIntenSelectableSphereScoringVisualizer::VisProxyHandleClick(FEditorViewpor
{
bool bEditing = false;
UE_LOG(LogTemp, Warning, TEXT("Handling Click"));
//UE_LOG(LogTemp, Warning, TEXT("Handling Click"));
if (VisProxy && VisProxy->Component.IsValid())
{
......@@ -104,7 +104,7 @@ bool FIntenSelectableSphereScoringVisualizer::HandleInputDelta(FEditorViewportCl
if (true || CurrentSelectionIndex != INDEX_NONE)
{
UE_LOG(LogTemp, Warning, TEXT("Current Selection! %s"), *DeltaTranslate.ToString());
//UE_LOG(LogTemp, Warning, TEXT("Current Selection! %s"), *DeltaTranslate.ToString());
if((true || CurrentSelectionIndex == 0 )&& GetEditedComponent())
{
......@@ -143,7 +143,7 @@ bool FIntenSelectableSphereScoringVisualizer::HandleInputDelta(FEditorViewportCl
}
}else
{
UE_LOG(LogTemp, Warning, TEXT("No Current Selection!"));
//UE_LOG(LogTemp, Warning, TEXT("No Current Selection!"));
}
return bHandled;
......
......@@ -52,6 +52,7 @@ private:
FColoredMaterialRenderProxy DebugMaterial;
FProperty* RadiusProperty;
FProperty* PointsProperty;
FProperty* LocationProperty;
FComponentPropertyPath ScoringBehaviourPropertyPath;
public:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment