Select Git revision
UniversalTrackedComponent.cpp
-
David Gilbert authored
- Fixed two missing includes that were throwing an error on my end. - Added a general settings class to the toolkit, populated with only a LiveLink preset for now. - Added functionality to the module to load and apply the default preset, added some guards to not do it twice (ART plugin crashes if that is done). - Added LiveLink functionality to the Tracked Components. - Added a change to the VRPawnMovement that manages to keep the rotation of the collider vertical even in the editor with LiveLink enabled. - Added cave config assets (ips public). - Added an example map that already includes the pawn with livelink + the cave root actor (no livelink yet there, todo). - Added a (temporary) SteamVRPreset.uasset for LiveLink for testing purposes.
David Gilbert authored- Fixed two missing includes that were throwing an error on my end. - Added a general settings class to the toolkit, populated with only a LiveLink preset for now. - Added functionality to the module to load and apply the default preset, added some guards to not do it twice (ART plugin crashes if that is done). - Added LiveLink functionality to the Tracked Components. - Added a change to the VRPawnMovement that manages to keep the rotation of the collider vertical even in the editor with LiveLink enabled. - Added cave config assets (ips public). - Added an example map that already includes the pawn with livelink + the cave root actor (no livelink yet there, todo). - Added a (temporary) SteamVRPreset.uasset for LiveLink for testing purposes.
SDasherWidget.cpp 13.64 KiB
#include "SDasherWidget.h"
#include "SlateOptMacros.h"
#include "Styling/CoreStyle.h"
#include "Brushes/SlateColorBrush.h"
#include "Rendering/DrawElements.h"
#include "DasherInterface.h"
#include "Components/SlateWrapperTypes.h"
BEGIN_SLATE_FUNCTION_BUILD_OPTIMIZATION
// ++ This is needed in order to use the localization macro LOCTEXT
#define LOCTEXT_NAMESPACE "SStandardSlateWidget"
//Set the state if we're in the editor or not.
void SDasherWidget::SetEditor(bool EditorState)
{
IsEditor = EditorState;
}
//Event Handlers
//Mouse position saved for mouse Input
FReply SDasherWidget::HandleMouseMoveEvent(const FGeometry& Geometry, const FPointerEvent& MouseEvent)
{
if (CurrentlyUsingVectorInput) return FReply::Unhandled();
//The mouse event only contains the Screen Space Position
CursorPosition = Geometry.AbsoluteToLocal(MouseEvent.GetScreenSpacePosition());
return FReply::Handled();
}
FReply SDasherWidget::HandleMouseDownEvent(const FGeometry& Geometry, const FPointerEvent& MouseEvent)
{
if (CurrentlyUsingVectorInput)
{
CurrentlyUsingVectorInput = false;
return FReply::Handled().LockMouseToWidget(AsShared());
}
DasherMainInterface->KeyDown(FDateTime::Now().GetSecond() + FDateTime::Now().GetMillisecond(), 100); //100 is the keycode for LMB
MouseDownListeners.ExecuteIfBound();
return FReply::Handled().LockMouseToWidget(AsShared());
}
FReply SDasherWidget::HandleMouseUpEvent(const FGeometry& Geometry, const FPointerEvent& MouseEvent)
{
if (CurrentlyUsingVectorInput)
{
CurrentlyUsingVectorInput = false;
return FReply::Handled().ReleaseMouseLock();
}
DasherMainInterface->KeyUp(FDateTime::Now().GetSecond() + FDateTime::Now().GetMillisecond(), 100); //100 is the keycode for LMB
MouseUpListeners.ExecuteIfBound();
return FReply::Handled().ReleaseMouseLock();
}
FReply SDasherWidget::HandleMouseDoubleClickEvent(const FGeometry& Geometry, const FPointerEvent& MouseEvent)
{
if(CurrentlyUsingVectorInput)
{
CurrentlyUsingVectorInput = false;
return FReply::Handled();
}
DasherMainInterface->KeyUp(FDateTime::Now().GetSecond() + FDateTime::Now().GetMillisecond(), 100); //100 is the keycode for LMB
return FReply::Handled();
}
//Set in the HandleMouseMoveEvent or via Set InputVector
//See tick for geometry things that could be use to modify this.
FVector2D SDasherWidget::GetCursorPosition()
{