Skip to content

Commit

Permalink
Merge pull request #141 from MashdorDev/FeedbackRedirect
Browse files Browse the repository at this point in the history
Feedback link within game, and pause menu.
  • Loading branch information
MashdorDev authored Feb 29, 2024
2 parents 31ada33 + 5c466d9 commit 4ec205a
Show file tree
Hide file tree
Showing 7 changed files with 27 additions and 15 deletions.
4 changes: 2 additions & 2 deletions Content/Unbread/Core/Character/BP_Character.uasset
Git LFS file not shown
4 changes: 2 additions & 2 deletions Content/Unbread/Core/GameModes/RespawnGamemode.uasset
Git LFS file not shown
4 changes: 2 additions & 2 deletions Content/Unbread/Core/UI/Widgets/WBP_Main_Menu.uasset
Git LFS file not shown
4 changes: 2 additions & 2 deletions Content/Unbread/Core/UI/Widgets/WBP_PauseMenu.uasset
Git LFS file not shown
4 changes: 2 additions & 2 deletions Content/Unbread/Core/UI/Widgets/WBP_WinMenu.uasset
Git LFS file not shown
16 changes: 11 additions & 5 deletions Source/unbread/Private/SRespawnGameMode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,17 @@ void ASRespawnGameMode::BeginPlay()
CurLives = MaxLives;

SetSpawnLocation(FindPlayerStart(UGameplayStatics::GetPlayerController(GetWorld(), 0))->GetTransform());
UGameplayStatics::GetPlayerPawn(GetWorld(),0)->OnDestroyed.AddDynamic(this, &ASRespawnGameMode::RespawnPlayer);

// Temp code for testing pause game
/*FTimerHandle UnusedHandle;
GetWorldTimerManager().SetTimer(
UnusedHandle, this, &ASRespawnGameMode::PauseGame, 2.0f, false);*/
// get ref to player in world
APawn* Pawn = UGameplayStatics::GetPlayerPawn(GetWorld(),0);

// bind death and pause
Pawn->OnDestroyed.AddDynamic(this, &ASRespawnGameMode::RespawnPlayer);
if(auto Player = Cast<ASCharacter>(Pawn))
{
Player->PauseGame.AddDynamic(this, &ASRespawnGameMode::PauseGame);
}



}
Expand All @@ -44,6 +49,7 @@ void ASRespawnGameMode::SpawnPlayer()
{
auto DynamicCamera = Cast<UDynamicCameraComponent>(Player->GetComponentByClass(UDynamicCameraComponent::StaticClass()));
DynamicCamera->FindDefaultLevelCamera();
Player->PauseGame.AddDynamic(this, &ASRespawnGameMode::PauseGame);
}

}
Expand Down
6 changes: 6 additions & 0 deletions Source/unbread/Public/SCharacter.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ class UGameplayEffect;
class UAbilitySystemComponent;
class ASWeapon;

DECLARE_DYNAMIC_MULTICAST_DELEGATE(FGamePauseInput);


UCLASS()
class UNBREAD_API ASCharacter : public ACharacter, public IDynamicCameraInterface, public IAbilitySystemInterface, public IInteractInterface, public ICookieInterface
{
Expand Down Expand Up @@ -208,6 +211,9 @@ class UNBREAD_API ASCharacter : public ACharacter, public IDynamicCameraInterfac

virtual void Landed(const FHitResult& Hit) override;

UPROPERTY(BlueprintAssignable, BlueprintCallable)
FGamePauseInput PauseGame;

protected:
UPROPERTY()
TWeakObjectPtr<class UAbilitySystemComponent> AbilitySystemComponent;
Expand Down

0 comments on commit 4ec205a

Please sign in to comment.