From 33cae564e9a98299cd788effc5e10a2bc3ea901f Mon Sep 17 00:00:00 2001 From: m4xxx1m Date: Tue, 30 May 2023 23:22:19 +0300 Subject: [PATCH] game over widget --- Content/BattleField/BP_EndOfGameWidget.uasset | Bin 0 -> 29975 bytes Content/BattleField/BP_MyPlayerState.uasset | Bin 18777 -> 18798 bytes .../Multiplayer/BP_MyGameState.uasset | Bin 18785 -> 18798 bytes .../SinglePlayer/BP_SinglePlayerGS.uasset | Bin 18965 -> 19230 bytes .../TurnBasedTutorial/EnemyAIController.cpp | 5 +++- Source/TurnBasedTutorial/GameOverWidget.cpp | 13 +++++++++ Source/TurnBasedTutorial/GameOverWidget.h | 26 ++++++++++++++++++ Source/TurnBasedTutorial/MyGameState.cpp | 17 ++++++++++++ Source/TurnBasedTutorial/MyGameState.h | 6 ++++ Source/TurnBasedTutorial/MyPlayerState.cpp | 9 ++++++ Source/TurnBasedTutorial/MyPlayerState.h | 8 +++++- 11 files changed, 82 insertions(+), 2 deletions(-) create mode 100644 Content/BattleField/BP_EndOfGameWidget.uasset create mode 100644 Source/TurnBasedTutorial/GameOverWidget.cpp create mode 100644 Source/TurnBasedTutorial/GameOverWidget.h diff --git a/Content/BattleField/BP_EndOfGameWidget.uasset b/Content/BattleField/BP_EndOfGameWidget.uasset new file mode 100644 index 0000000000000000000000000000000000000000..91d6502c5163f79eb6c402407947e8138a3a0ce6 GIT binary patch literal 29975 zcmeHQ33yaRwysuC*;JIx4H8fhL9!<#I%>L;5FjCe1Vk7Jo%Bu8(CH4nghfQeWn2(P z5fya=5nMqTM@7f?=84Yg?l|g_6PcQnCvnnF@ir z$#mKie|{K+OK1d#$0R8JL1x$k`JtPv@!mEg%k7Ou14f142>7zxwGHJ#UrjR_&hYzM zjHvkAw@)2C&LQ$xoBpwbF1h`fc>ijzKUi%9V_96NGCGWam^pOdB3M<8h}$|Njb*Uv za#*i5!NKTK*A(`*N3-04n9&~g2czS|-u70p^W~*w11!y+P}rDO(>Tv)ii$5LoOJ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$C*11pPL#8ewgWr>}n zKk<4rq+)*>f->--OG4y@mTJFq{CqW)J8aK{ZKD@bO5UaP1Z=mC6g&q%`uO6=S0jh( zPu^M;@w{@bPxepVm(vSLVwPJIr8DlYx0H!7j$(!)tX$7rVpLmMAbzMV5ye-Sp_W(* zbw6`4vDBKQhh?m}n|Y#*?4+6vtl0srRh|BgJd>TqRYug=EeJHNWz*bGM4lUdB@ zM$CgdowmDG_vYNnMKDlNWOQlNiWrm+*V8u;5&r)otIgtzdGf4oVnj7_yRI*xV2Rpp ziIe2~|4O+JMyni{vdlHfQ{F5Ig)i4kl5!Xf7a0rTYdb?}>RSIQ zOFVw5xBk0Q?_rx#>Jt^258O4h<3LUMB;_O4$T(dI`uJ1NdmJv+m%8wSuZg~+eZ5b1 zs5Ousjbsv#8tHs^wbr+6zJ^%;2sJ1})bR?MPimY%R7UxbQy=n{&=iTvJ=LlLH|CUjn^=I z{pn*1LoEfL)xG(}Q*SNZ|804g(FxtKkQK2ZwySetText(FText::FromString("You won!")); + } else { + GameOverText->SetText(FText::FromString("You lose!")); + } +} diff --git a/Source/TurnBasedTutorial/GameOverWidget.h b/Source/TurnBasedTutorial/GameOverWidget.h new file mode 100644 index 0000000..5bee377 --- /dev/null +++ b/Source/TurnBasedTutorial/GameOverWidget.h @@ -0,0 +1,26 @@ +// Fill out your copyright notice in the Description page of Project Settings. + +#pragma once + +#include "CoreMinimal.h" +#include "Blueprint/UserWidget.h" +#include "GameOverWidget.generated.h" + +/** + * + */ +UCLASS() +class TURNBASEDTUTORIAL_API UGameOverWidget : public UUserWidget { + GENERATED_BODY() + +public: + UFUNCTION(Client, Reliable) + void SetWidgetText(bool HasWon); + +protected: + UPROPERTY(meta = (BindWidget)) + class UButton *ButtonToMenu; + + UPROPERTY(meta = (BindWidget)) + class UTextBlock *GameOverText; +}; diff --git a/Source/TurnBasedTutorial/MyGameState.cpp b/Source/TurnBasedTutorial/MyGameState.cpp index ee2bed3..45ed445 100644 --- a/Source/TurnBasedTutorial/MyGameState.cpp +++ b/Source/TurnBasedTutorial/MyGameState.cpp @@ -2,8 +2,10 @@ #include "MyGameState.h" +// #include "GameOverWidget.h" #include "MyPlayerState.h" #include "Trooper.h" +#include "Blueprint/UserWidget.h" #include "Net/UnrealNetwork.h" auto AMyGameState::GetMyPlayerState(uint8 PlayerIndex) const { @@ -90,9 +92,24 @@ void AMyGameState::DecreaseLivingTroopers(int PlayerIndex) { if (LivingTroopersCount[PlayerIndex] <= 0) { UE_LOG(LogTemp, Warning, TEXT("Player %d lose!"), PlayerIndex); bGameIsOver = true; + GameOver(PlayerIndex); } } +void AMyGameState::GameOver(int PlayerIndexLose) const { + Cast(PlayerArray[0])->GameOver(PlayerIndexLose); + if (bIsMultiplayer) { + Cast(PlayerArray[1])->GameOver(PlayerIndexLose); + } +} + +// void AMyGameState::GameOver_Implementation(int PlayerIndexLose) { +// UGameOverWidget *CreatedWidget = CreateWidget( +// GetWorld(), GameOverWidgetClass); +// CreatedWidget->AddToViewport(); +// CreatedWidget->SetWidgetText(PlayerIndexLose != ); +// } + void AMyGameState::GetLifetimeReplicatedProps( TArray &OutLifetimeProps) const { diff --git a/Source/TurnBasedTutorial/MyGameState.h b/Source/TurnBasedTutorial/MyGameState.h index 00817bb..1a30b60 100644 --- a/Source/TurnBasedTutorial/MyGameState.h +++ b/Source/TurnBasedTutorial/MyGameState.h @@ -45,8 +45,14 @@ public: UFUNCTION() void DecreaseLivingTroopers(int PlayerIndex); + + UFUNCTION() + void GameOver(int PlayerIndexLose) const; protected: + // UPROPERTY(EditAnywhere, BlueprintReadWrite) + // TSubclassOf GameOverWidgetClass; + UPROPERTY() bool bIsMultiplayer = true; diff --git a/Source/TurnBasedTutorial/MyPlayerState.cpp b/Source/TurnBasedTutorial/MyPlayerState.cpp index ca50779..240e267 100644 --- a/Source/TurnBasedTutorial/MyPlayerState.cpp +++ b/Source/TurnBasedTutorial/MyPlayerState.cpp @@ -1,6 +1,8 @@ // Fill out your copyright notice in the Description page of Project Settings. #include "MyPlayerState.h" + +#include "GameOverWidget.h" #include "MyGameState.h" #include "Kismet/GameplayStatics.h" #include "Net/UnrealNetwork.h" @@ -37,6 +39,13 @@ void AMyPlayerState::SetPlayerIndex(uint8 NewPlayerIndex) { PlayerIndex = NewPlayerIndex; } +void AMyPlayerState::GameOver_Implementation(int PlayerLoseIndex) { + UGameOverWidget *CreatedWidget = CreateWidget( + GetWorld(), GameOverWidgetClass); + CreatedWidget->AddToViewport(); + CreatedWidget->SetWidgetText(PlayerLoseIndex != PlayerIndex); +} + void AMyPlayerState::SetEnemySelection_Implementation( /*const TArray &Troopers*/) const { TArray Troopers; diff --git a/Source/TurnBasedTutorial/MyPlayerState.h b/Source/TurnBasedTutorial/MyPlayerState.h index 62109fa..84c4aa2 100644 --- a/Source/TurnBasedTutorial/MyPlayerState.h +++ b/Source/TurnBasedTutorial/MyPlayerState.h @@ -56,7 +56,13 @@ public: UFUNCTION(Client, Reliable) void SetEnemySelection(/*const TArray &Troopers*/) const; -private: + UFUNCTION(Client, Reliable) + void GameOver(int PlayerLoseIndex); + +protected: + UPROPERTY(EditAnywhere, BlueprintReadWrite) + TSubclassOf GameOverWidgetClass; + UPROPERTY(Replicated) bool bIsSelectionInitialized = false;