Skip to content
Snippets Groups Projects
Commit fa7570e6 authored by Sebastian Pape's avatar Sebastian Pape
Browse files

Cleaned up and readded F10 Binding

parent 0f38a63b
Branches
Tags
1 merge request!4Develop
No preview for this file type
...@@ -21,11 +21,11 @@ ...@@ -21,11 +21,11 @@
DEFINE_LOG_CATEGORY(LogCAVEOverlay); DEFINE_LOG_CATEGORY(LogCAVEOverlay);
template <std::size_t S> template <std::size_t S>
bool ContainsFString(const std::array<FString, S>& A, const FString& Entry) bool ContainsFString(const std::array<FString, S>& Array, const FString& Entry)
{ {
for (FString CS : A) for (FString Current_Entry : Array)
{ {
if (CS.Equals(Entry, ESearchCase::IgnoreCase)) return true; if (Current_Entry.Equals(Entry, ESearchCase::IgnoreCase)) return true;
} }
return false; return false;
} }
...@@ -188,6 +188,7 @@ void ACAVEOverlayController::BeginPlay() ...@@ -188,6 +188,7 @@ void ACAVEOverlayController::BeginPlay()
//Input config //Input config
InputComponent->BindAction("Action4", EInputEvent::IE_Pressed, this, &ACAVEOverlayController::CycleDoorType); InputComponent->BindAction("Action4", EInputEvent::IE_Pressed, this, &ACAVEOverlayController::CycleDoorType);
InputComponent->BindKey(EKeys::F10, EInputEvent::IE_Pressed, this, &ACAVEOverlayController::CycleDoorType);
//Determine the screen-type for later usage //Determine the screen-type for later usage
if (IDisplayCluster::Get().GetClusterMgr()->GetNodeId().Equals(Screen_Main, ESearchCase::IgnoreCase)) if (IDisplayCluster::Get().GetClusterMgr()->GetNodeId().Equals(Screen_Main, ESearchCase::IgnoreCase))
...@@ -261,6 +262,18 @@ void ACAVEOverlayController::Tick(float DeltaTime) ...@@ -261,6 +262,18 @@ void ACAVEOverlayController::Tick(float DeltaTime)
bAttached = true; bAttached = true;
} }
//FPS Counter
if (Overlay) {
if (Door_Current_Mode == EDoor_Mode::DOOR_DEBUG && ContainsFString(Screens_FPS, IDisplayCluster::Get().GetClusterMgr()->GetNodeId()))
{
Overlay->FPS->SetText(FText::FromString(FString::Printf(TEXT("FPS: %.1f"), 1.0f / DeltaTime)));
}
else
{
Overlay->FPS->SetText(FText::FromString(""));
}
}
if (!Shutter_Glasses) return; //Display Cluster not initialized if (!Shutter_Glasses) return; //Display Cluster not initialized
//Tape Logic //Tape Logic
...@@ -317,14 +330,4 @@ void ACAVEOverlayController::Tick(float DeltaTime) ...@@ -317,14 +330,4 @@ void ACAVEOverlayController::Tick(float DeltaTime)
Sign_Positive_X->SetVisibility(false); Sign_Positive_X->SetVisibility(false);
Sign_Positive_Y->SetVisibility(false); Sign_Positive_Y->SetVisibility(false);
} }
//FPS
if (Overlay && EDoor_Mode::DOOR_DEBUG && ContainsFString(Screens_FPS, IDisplayCluster::Get().GetClusterMgr()->GetNodeId()))
{
Overlay->FPS->SetText(FText::FromString(FString::Printf(TEXT("FPS: %.1f"), 1.0f / DeltaTime)));
}
else
{
Overlay->FPS->SetText(FText::FromString(""));
}
} }
// Fill out your copyright notice in the Description page of Project Settings.
#include "DoorOverlayData.h"
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment