Commit 5438f039 authored by Geovanny Vera's avatar Geovanny Vera

Game menu toggle, and vrcwidget component and actor restructured

parent dc30adba
......@@ -165,7 +165,7 @@ DoubleClickTime=0.200000
+ActionMappings=(ActionName="ResetVR",bShift=False,bCtrl=False,bAlt=False,bCmd=False,Key=MotionController_Left_Grip1)
+ActionMappings=(ActionName="Jump",bShift=False,bCtrl=False,bAlt=False,bCmd=False,Key=MotionController_Right_Trigger)
+ActionMappings=(ActionName="ToggleKeyboard",bShift=False,bCtrl=False,bAlt=False,bCmd=False,Key=OculusTouch_Right_B_Click)
+ActionMappings=(ActionName="UseAbility2",bShift=False,bCtrl=False,bAlt=False,bCmd=False,Key=Two)
+ActionMappings=(ActionName="ToggleMenu",bShift=False,bCtrl=False,bAlt=False,bCmd=False,Key=OculusTouch_Left_Menu_Click)
+ActionMappings=(ActionName="UseAbility3",bShift=False,bCtrl=False,bAlt=False,bCmd=False,Key=Three)
+ActionMappings=(ActionName="UseAbility4",bShift=False,bCtrl=False,bAlt=False,bCmd=False,Key=Four)
+ActionMappings=(ActionName="UseAbility5",bShift=False,bCtrl=False,bAlt=False,bCmd=False,Key=Five)
......
// Copyright 2020 Testy
#include "VRCCharacter.h"
// Sets default values
AVRCCharacter::AVRCCharacter()
{
// Set this character to call Tick() every frame. You can turn this off to improve performance if you don't need it.
PrimaryActorTick.bCanEverTick = true;
}
// Called when the game starts or when spawned
void AVRCCharacter::BeginPlay()
{
Super::BeginPlay();
}
// Called every frame
void AVRCCharacter::Tick(float DeltaTime)
{
Super::Tick(DeltaTime);
}
// Called to bind functionality to input
void AVRCCharacter::SetupPlayerInputComponent(UInputComponent* PlayerInputComponent)
{
Super::SetupPlayerInputComponent(PlayerInputComponent);
}
UVRCGameInstance* AVRCCharacter::GetVRCGameInstance() const {
return Cast<UVRCGameInstance>(GetWorld()->GetGameInstance());
}
bool AVRCCharacter::IsPlayerLoggedIn() const {
return AVRCCharacter::GetVRCGameInstance()->User.bIsLoggedIn;
}
......@@ -14,6 +14,7 @@ UHttpService* UVRCGameInstance::GetHttpService() {
void UVRCGameInstance::SetUserToken(FString token) {
User.Token = token;
User.bIsLoggedIn = true;
Http->SetAuthToken(token);
}
......
// Copyright 2020 Testy
#include "VRCWidgetActor.h"
// Sets default values
AVRCWidgetActor::AVRCWidgetActor()
{
// Set this actor to call Tick() every frame. You can turn this off to improve performance if you don't need it.
PrimaryActorTick.bCanEverTick = true;
}
// Called when the game starts or when spawned
void AVRCWidgetActor::BeginPlay()
{
Super::BeginPlay();
}
// Called every frame
void AVRCWidgetActor::Tick(float DeltaTime)
{
Super::Tick(DeltaTime);
}
void AVRCWidgetActor::ToggleWidget(bool bActive) {
if (!WidgetVRC) return;
WidgetVRC->ToggleWidget(bActive);
}
\ No newline at end of file
// Copyright 2020 Testy
#pragma once
#include "CoreMinimal.h"
#include "GameFramework/Character.h"
#include "VRCGameInstance.h"
#include "VRCCharacter.generated.h"
UCLASS()
class VRCLASSROOM_API AVRCCharacter : public ACharacter
{
GENERATED_BODY()
public:
// Sets default values for this character's properties
AVRCCharacter();
protected:
// Called when the game starts or when spawned
virtual void BeginPlay() override;
public:
// Called every frame
virtual void Tick(float DeltaTime) override;
// Called to bind functionality to input
virtual void SetupPlayerInputComponent(class UInputComponent* PlayerInputComponent) override;
UFUNCTION(BlueprintCallable, Category = "Instance")
UVRCGameInstance* GetVRCGameInstance() const;
UFUNCTION(BlueprintCallable, Category = "Instance")
bool IsPlayerLoggedIn() const;
};
......@@ -13,10 +13,12 @@ struct FUserData
{
GENERATED_USTRUCT_BODY()
UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "API")
UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "Http")
FString Token;
UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "User")
FString DisplayName;
UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "User")
bool bIsLoggedIn;
};
/**
*
......
// Copyright 2020 Testy
#pragma once
#include "CoreMinimal.h"
#include "GameFramework/Actor.h"
#include "VRCWidgetComponent.h"
#include "VRCWidgetActor.generated.h"
UCLASS()
class VRCLASSROOM_API AVRCWidgetActor : public AActor
{
GENERATED_BODY()
public:
// Sets default values for this actor's properties
AVRCWidgetActor();
protected:
// Called when the game starts or when spawned
virtual void BeginPlay() override;
public:
// Called every frame
virtual void Tick(float DeltaTime) override;
UPROPERTY(EditAnywhere, BlueprintReadWrite)
UVRCWidgetComponent* WidgetVRC;
UFUNCTION(BlueprintCallable, Category = "Widget")
void ToggleWidget(bool bActive);
};
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment