Skip to content
Snippets Groups Projects
Select Git revision
  • 7e7a709d0369fb471cb7cb13ceb16baa13007dda
  • 5.4 default protected
  • 5.5
  • dev/5.5
  • dev/5.4
  • dev/5.3_downgrade
  • feature/experimenttime_hack
  • 5.3 protected
  • _IntenSelect5.3
  • IntenSelect5.3
  • 4.27 protected
  • 4.26 protected
  • 5.0 protected
  • 4.22 protected
  • 4.21 protected
  • UE5.4-2024.1
  • UE5.4-2024.1-rc1
  • UE5.3-2023.1-rc3
  • UE5.3-2023.1-rc2
  • UE5.3-2023.1-rc
20 results

UniversalTrackedComponent.cpp

Blame
    • David Gilbert's avatar
      7e7a709d
      - Added LiveLink Plugin Dependency to uplugin file. · 7e7a709d
      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.
      7e7a709d
      History
      - Added LiveLink Plugin Dependency to uplugin file.
      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()
    {