Base functionality for MapObject placement

This commit is contained in:
2022-01-24 21:26:06 +01:00
parent 74eab48a6e
commit 237c056b30
8 changed files with 93 additions and 79 deletions
+23 -2
View File
@@ -11,7 +11,7 @@ class AAdventureMap;
class AHexTile;
class AAdventureCameraPawn;
class AAdventureCharacter;
class AMapObject;
/**
*
*/
@@ -23,6 +23,7 @@ class FRAY_API AAdventurePlayerController : public APlayerController
public:
AAdventurePlayerController();
// General
UPROPERTY()
UWorld* World;
UPROPERTY()
@@ -31,11 +32,31 @@ public:
AHexTile* SpawnHex;
UPROPERTY(VisibleAnywhere, BlueprintReadWrite, Category = "Runtime")
AHexTile* CurrentHex;
UPROPERTY(BlueprintReadWrite, EditAnywhere)
AHexTile* HoveredHex;
UFUNCTION(BlueprintCallable)
void LeftClick();
protected:
virtual void BeginPlay() override;
virtual void SetupInputComponent() override;
public:
void AdvClick();
// Object Placement
UPROPERTY(BlueprintReadWrite, VisibleAnywhere)
bool bInPlacementMode;
UPROPERTY(BlueprintReadWrite, EditAnywhere)
TSubclassOf<AMapObject> PlaceObjClass;
UPROPERTY(BlueprintReadWrite, VisibleAnywhere)
AMapObject* PlaceObj;
UFUNCTION(BlueprintCallable)
void TogglePlacing();
UFUNCTION(BlueprintCallable)
void FitOnGrid(AMapObject* MapObject);
UFUNCTION()
void PlaceObject(TSubclassOf<AMapObject> MapObjClass, AHexTile* OnHex);
// Called every frame
virtual void Tick(float DeltaTime) override;
};