unreal/AdventureCameraPawn.h

82 lines
2.0 KiB
C++

// Fill out your copyright notice in the Description page of Project Settings.
#pragma once
#include "CoreMinimal.h"
#include "GameFramework/Pawn.h"
#include "AdventureCameraPawn.generated.h"
UCLASS()
class FRAY_API AAdventureCameraPawn : public APawn
{
GENERATED_BODY()
public:
// Sets default values for this pawn's properties
AAdventureCameraPawn();
UPROPERTY()
UGameViewportClient* Viewport;
UPROPERTY()
FIntPoint ViewSize;
UPROPERTY(BlueprintReadWrite, Category = "Config")
class AAdventureMap* AdvMapRef;
UPROPERTY(BlueprintReadWrite, Category = "Config")
class AAdventurePlayerController* OwningPC;
UPROPERTY(BlueprintReadWrite, Category = "Config")
class AAdventureCharacter* FollowPawn;
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Input")
float ESASize;
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Input")
float ScrollAccelleration;
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Input")
float BaseScrollSpeed;
UPROPERTY()
FVector AdvPawnLocationPrevious;
UPROPERTY()
FVector AdvPawnLocationCurrent;
UPROPERTY()
FVector AdvPawnLocationDelta;
UPROPERTY(BlueprintReadWrite, Category = "Runtime")
bool bAdvPawnIsMoving = false;
UPROPERTY(BlueprintReadWrite, Category = "Runtime")
class AHexTile* SelectedHex;
protected:
// Called when the game starts or when spawned
virtual void BeginPlay() override;
void GetTheDamnViewport();
float ESAMaxBoundSlope;
float ESAMaxBoundIntercept;
float ESAMinBoundSlope;
float ESAMinBoundIntercept;
public:
// Called every frame
virtual void Tick(float DeltaTime) override;
// Called to bind functionality to input
virtual void SetupPlayerInputComponent(class UInputComponent* PlayerInputComponent) override;
UFUNCTION()
void ScrollSide(float AxisValue);
UFUNCTION()
void ScrollVert(float AxisValue);
UFUNCTION(BlueprintCallable)
void EdgeScrollSide(float AxisValue);
UFUNCTION(BlueprintCallable)
void EdgeScrollVert(float AxisValue);
UFUNCTION(BlueprintCallable)
void FollowAdvPawn();
};