Compare commits
12 Commits
feature-re
...
master
Author | SHA1 | Date |
---|---|---|
eyakm1 | 5e7478059c | 2 years ago |
m4xxx1m | baa5dee9b5 | 2 years ago |
eyakm1 | 70f1dad57b | 2 years ago |
eyakm1 | e8e6d37dad | 2 years ago |
eyakm1 | cd94fbc07f | 2 years ago |
m4xxx1m | e27bfbd8a8 | 2 years ago |
eyakm1 | e34909565e | 2 years ago |
m4xxx1m | 1eb65de5e6 | 2 years ago |
eyakm1 | 26b49e2e9d | 2 years ago |
m4xxx1m | 422b1439e5 | 2 years ago |
m4xxx1m | 71fd6242fe | 2 years ago |
m4xxx1m | 6e1fd803f1 | 2 years ago |
@ -1,13 +0,0 @@
|
||||
# Default ignored files
|
||||
/shelf/
|
||||
/workspace.xml
|
||||
# Rider ignored files
|
||||
/modules.xml
|
||||
/contentModel.xml
|
||||
/projectSettingsUpdater.xml
|
||||
/.idea.TurnBased.iml
|
||||
# Editor-based HTTP Client requests
|
||||
/httpRequests/
|
||||
# Datasource local storage ignored files
|
||||
/dataSources/
|
||||
/dataSources.local.xml
|
@ -1 +0,0 @@
|
||||
TurnBased
|
@ -1,4 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="Encoding" addBOMForNewFiles="with BOM under Windows, with no BOM otherwise" />
|
||||
</project>
|
@ -1,8 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="UserContentModel">
|
||||
<attachedFolders />
|
||||
<explicitIncludes />
|
||||
<explicitExcludes />
|
||||
</component>
|
||||
</project>
|
@ -1,6 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="VcsDirectoryMappings">
|
||||
<mapping directory="" vcs="Git" />
|
||||
</component>
|
||||
</project>
|
@ -1,7 +1,10 @@
|
||||
|
||||
[/Script/EngineSettings.GeneralProjectSettings]
|
||||
ProjectID=D68B8A08410D0195272328B9EAD1AE41
|
||||
bShouldWindowPreserveAspectRatio=False
|
||||
bUseBorderlessWindow=False
|
||||
|
||||
[StartupActions]
|
||||
bAddPacks=True
|
||||
InsertPack=(PackSource="StarterContent.upack",PackName="StarterContent")
|
||||
|
||||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -0,0 +1,63 @@
|
||||
// Fill out your copyright notice in the Description page of Project Settings.
|
||||
|
||||
#include "BattleUI.h"
|
||||
#include "Components/Button.h"
|
||||
#include "Components/TextBlock.h"
|
||||
#include "BattlePlayerController.h"
|
||||
#include "BattlePlayerState.h"
|
||||
|
||||
|
||||
void UBattleUI::NativeConstruct() {
|
||||
Super::NativeConstruct();
|
||||
EndTurnButton->OnClicked.AddDynamic(this, &ThisClass::OnEndTurnClicked);
|
||||
ButtonAction_0->OnClicked.AddDynamic(this, &ThisClass::OnActionSwitched_0);
|
||||
ButtonAction_1->OnClicked.AddDynamic(this, &ThisClass::OnActionSwitched_1);
|
||||
ButtonAction_2->OnClicked.AddDynamic(this, &ThisClass::OnActionSwitched_2);
|
||||
}
|
||||
|
||||
void UBattleUI::SetWidgetText_Implementation(const FString &Text) {
|
||||
InformationText->SetText(FText::FromString(Text));
|
||||
}
|
||||
|
||||
void UBattleUI::SetWhoseTurnText_Implementation(bool IsThisPlayerTurn) {
|
||||
if (IsThisPlayerTurn) {
|
||||
SetWidgetText(TEXT("Your turn!"));
|
||||
} else {
|
||||
SetWidgetText(TEXT("Opponent's turn"));
|
||||
}
|
||||
}
|
||||
|
||||
void UBattleUI::OnEndTurnClicked() {
|
||||
Cast<ABattlePlayerController>(GetWorld()->GetFirstPlayerController())->
|
||||
EndTurn();
|
||||
}
|
||||
|
||||
void UBattleUI::OnActionSwitched_0() {
|
||||
ButtonAction_0->SetIsEnabled(false);
|
||||
ButtonAction_1->SetIsEnabled(true);
|
||||
ButtonAction_2->SetIsEnabled(true);
|
||||
ActionType = 0;
|
||||
OnActionSwitched();
|
||||
}
|
||||
|
||||
void UBattleUI::OnActionSwitched_1() {
|
||||
ButtonAction_0->SetIsEnabled(true);
|
||||
ButtonAction_1->SetIsEnabled(false);
|
||||
ButtonAction_2->SetIsEnabled(true);
|
||||
ActionType = 1;
|
||||
OnActionSwitched();
|
||||
}
|
||||
|
||||
void UBattleUI::OnActionSwitched_2() {
|
||||
ButtonAction_0->SetIsEnabled(true);
|
||||
ButtonAction_1->SetIsEnabled(true);
|
||||
ButtonAction_2->SetIsEnabled(false);
|
||||
ActionType = 2;
|
||||
OnActionSwitched();
|
||||
}
|
||||
|
||||
void UBattleUI::OnActionSwitched() const {
|
||||
Cast<ABattlePlayerController>(GetWorld()->GetFirstPlayerController())->
|
||||
GetPlayerState<ABattlePlayerState>()->SetCurrentAction(ActionType);
|
||||
}
|
||||
|
@ -0,0 +1,58 @@
|
||||
// Fill out your copyright notice in the Description page of Project Settings.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "CoreMinimal.h"
|
||||
#include "Blueprint/UserWidget.h"
|
||||
#include "BattleUI.generated.h"
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
UCLASS()
|
||||
class TURNBASEDTUTORIAL_API UBattleUI : public UUserWidget {
|
||||
GENERATED_BODY()
|
||||
|
||||
public:
|
||||
virtual void NativeConstruct() override;
|
||||
|
||||
UFUNCTION(Client, Reliable)
|
||||
void SetWhoseTurnText(bool IsThisPlayerTurn);
|
||||
|
||||
UFUNCTION(Client, Reliable)
|
||||
void SetWidgetText(const FString &Text);
|
||||
|
||||
protected:
|
||||
int ActionType = 0;
|
||||
|
||||
UPROPERTY(EditAnywhere, BlueprintReadWrite, meta=(BindWidget))
|
||||
class UButton *EndTurnButton;
|
||||
|
||||
UPROPERTY(EditAnywhere, BlueprintReadWrite, meta=(BindWidget))
|
||||
class UButton *ButtonAction_0;
|
||||
|
||||
UPROPERTY(EditAnywhere, BlueprintReadWrite, meta=(BindWidget))
|
||||
class UButton *ButtonAction_1;
|
||||
|
||||
UPROPERTY(EditAnywhere, BlueprintReadWrite, meta=(BindWidget))
|
||||
class UButton *ButtonAction_2;
|
||||
|
||||
UPROPERTY(EditAnywhere, BlueprintReadWrite, meta=(BindWidget))
|
||||
class UTextBlock *InformationText;
|
||||
|
||||
UFUNCTION()
|
||||
void OnEndTurnClicked();
|
||||
|
||||
UFUNCTION()
|
||||
void OnActionSwitched_0();
|
||||
|
||||
UFUNCTION()
|
||||
void OnActionSwitched_1();
|
||||
|
||||
UFUNCTION()
|
||||
void OnActionSwitched_2();
|
||||
|
||||
UFUNCTION()
|
||||
void OnActionSwitched() const;
|
||||
|
||||
};
|
@ -0,0 +1,27 @@
|
||||
// Fill out your copyright notice in the Description page of Project Settings.
|
||||
|
||||
#include "ManageSquadWidget.h"
|
||||
|
||||
#include "ManageSquadGameState.h"
|
||||
#include "SelectedTrooperSaveGame.h"
|
||||
#include "Components/Button.h"
|
||||
#include "Kismet/GameplayStatics.h"
|
||||
|
||||
|
||||
void UManageSquadWidget::NativeConstruct() {
|
||||
Super::NativeConstruct();
|
||||
BackButton->OnClicked.AddDynamic(
|
||||
this, &ThisClass::UManageSquadWidget::OnBackButtonClicked);
|
||||
}
|
||||
|
||||
void UManageSquadWidget::OnBackButtonClicked() {
|
||||
USelectedTrooperSaveGame *SaveGameInstance = Cast<USelectedTrooperSaveGame>(
|
||||
UGameplayStatics::CreateSaveGameObject(
|
||||
USelectedTrooperSaveGame::StaticClass()));
|
||||
SaveGameInstance->SelectedTroopers = GetWorld()->GetGameState<
|
||||
AManageSquadGameState>()->GetSquad();
|
||||
UGameplayStatics::SaveGameToSlot(
|
||||
SaveGameInstance,TEXT("Selected troopers"), 0);
|
||||
UGameplayStatics::OpenLevel(GetWorld(), "MainMenuLevel");
|
||||
RemoveFromParent();
|
||||
}
|
@ -0,0 +1,25 @@
|
||||
// Fill out your copyright notice in the Description page of Project Settings.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "CoreMinimal.h"
|
||||
#include "Blueprint/UserWidget.h"
|
||||
#include "ManageSquadWidget.generated.h"
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
UCLASS()
|
||||
class TURNBASEDTUTORIAL_API UManageSquadWidget : public UUserWidget {
|
||||
GENERATED_BODY()
|
||||
|
||||
public:
|
||||
virtual void NativeConstruct() override;
|
||||
|
||||
protected:
|
||||
UPROPERTY(EditAnywhere, BlueprintReadWrite, meta=(BindWidget))
|
||||
class UButton *BackButton;
|
||||
|
||||
UFUNCTION()
|
||||
void OnBackButtonClicked();
|
||||
};
|
@ -0,0 +1,8 @@
|
||||
// Fill out your copyright notice in the Description page of Project Settings.
|
||||
|
||||
|
||||
#include "SelectedTrooperSaveGame.h"
|
||||
|
||||
USelectedTrooperSaveGame::USelectedTrooperSaveGame()
|
||||
: Super() {
|
||||
}
|
@ -0,0 +1,21 @@
|
||||
// Fill out your copyright notice in the Description page of Project Settings.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "CoreMinimal.h"
|
||||
#include "GameFramework/SaveGame.h"
|
||||
#include "SelectedTrooperSaveGame.generated.h"
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
UCLASS()
|
||||
class TURNBASEDTUTORIAL_API USelectedTrooperSaveGame : public USaveGame {
|
||||
GENERATED_BODY()
|
||||
|
||||
public:
|
||||
UPROPERTY(EditAnywhere, Category=Basic)
|
||||
TArray<uint8> SelectedTroopers;
|
||||
|
||||
USelectedTrooperSaveGame();
|
||||
};
|
@ -1,25 +0,0 @@
|
||||
TurnBased/Binaries/Win64/TurnBasedTutorial.exe 2023-03-16T03:05:02.259Z
|
||||
TurnBased/Binaries/Win64/OpenImageDenoise.dll 2023-03-16T01:52:15.842Z
|
||||
TurnBased/Binaries/Win64/tbb12.dll 2023-03-16T01:52:15.844Z
|
||||
Engine/Extras/Redist/en-us/UE4PrereqSetup_x64.exe 2023-03-16T01:46:38.646Z
|
||||
Engine/Binaries/ThirdParty/Oculus/OVRPlugin/OVRPlugin/Win64/OVRPlugin.dll 2023-03-16T01:41:33.496Z
|
||||
Engine/Binaries/ThirdParty/DbgHelp/dbghelp.dll 2023-03-16T01:41:25.090Z
|
||||
Engine/Binaries/ThirdParty/PhysX3/Win64/VS2015/PxFoundationPROFILE_x64.dll 2023-03-16T01:41:46.155Z
|
||||
Engine/Binaries/ThirdParty/PhysX3/Win64/VS2015/PxPvdSDKPROFILE_x64.dll 2023-03-16T01:41:46.339Z
|
||||
Engine/Binaries/ThirdParty/PhysX3/Win64/VS2015/PhysX3PROFILE_x64.dll 2023-03-16T01:41:45.025Z
|
||||
Engine/Binaries/ThirdParty/PhysX3/Win64/VS2015/PhysX3CookingPROFILE_x64.dll 2023-03-16T01:41:45.005Z
|
||||
Engine/Binaries/ThirdParty/PhysX3/Win64/VS2015/PhysX3CommonPROFILE_x64.dll 2023-03-16T01:41:44.869Z
|
||||
Engine/Binaries/ThirdParty/PhysX3/Win64/VS2015/APEX_ClothingPROFILE_x64.dll 2023-03-16T01:41:41.229Z
|
||||
Engine/Binaries/ThirdParty/PhysX3/Win64/VS2015/APEX_LegacyPROFILE_x64.dll 2023-03-16T01:41:42.482Z
|
||||
Engine/Binaries/ThirdParty/PhysX3/Win64/VS2015/ApexFrameworkPROFILE_x64.dll 2023-03-16T01:41:43.065Z
|
||||
Engine/Binaries/ThirdParty/PhysX3/Win64/VS2015/NvClothPROFILE_x64.dll 2023-03-16T01:41:43.666Z
|
||||
Engine/Binaries/ThirdParty/Ogg/Win64/VS2015/libogg_64.dll 2023-03-16T01:41:33.497Z
|
||||
Engine/Binaries/ThirdParty/Vorbis/Win64/VS2015/libvorbis_64.dll 2023-03-16T01:41:53.464Z
|
||||
Engine/Binaries/ThirdParty/Vorbis/Win64/VS2015/libvorbisfile_64.dll 2023-03-16T01:41:53.464Z
|
||||
Engine/Binaries/ThirdParty/NVIDIA/NVaftermath/Win64/GFSDK_Aftermath_Lib.x64.dll 2023-03-16T01:41:32.651Z
|
||||
Engine/Binaries/ThirdParty/OpenXR/win64/openxr_loader.dll 2023-03-16T01:41:33.921Z
|
||||
Engine/Binaries/ThirdParty/OpenVR/OpenVRv1_5_17/Win64/openvr_api.dll 2023-03-16T01:41:33.917Z
|
||||
Engine/Binaries/ThirdParty/NVIDIA/GeForceNOW/Win64/GfnRuntimeSdk.dll 2023-03-16T01:41:32.648Z
|
||||
Engine/Binaries/ThirdParty/Windows/WinPixEventRuntime/x64/WinPixEventRuntime.dll 2023-03-16T01:41:53.487Z
|
||||
Engine/Binaries/ThirdParty/Windows/XAudio2_9/x64/xaudio2_9redist.dll 2023-03-16T01:41:54.149Z
|
||||
TurnBasedTutorial.exe 2023-03-16T03:07:14.267Z
|
Binary file not shown.
Loading…
Reference in new issue