init
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
// Fill out your copyright notice in the Description page of Project Settings.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "CoreMinimal.h"
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
UENUM(BlueprintType)
|
||||
enum class EAirMode : uint8
|
||||
{
|
||||
OnGround,
|
||||
InAir
|
||||
};
|
||||
@@ -0,0 +1,8 @@
|
||||
// © 2025 Naked People Team. All Rights Reserved.
|
||||
|
||||
#pragma once
|
||||
|
||||
#define SLOT_NAME "Slot2"
|
||||
#define SLOT_PLAYER 0
|
||||
#define IS_DEMO false
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
// Fill out your copyright notice in the Description page of Project Settings.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "CoreMinimal.h"
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
UENUM(BlueprintType)
|
||||
enum class EGait : uint8
|
||||
{
|
||||
Walk,
|
||||
Run
|
||||
};
|
||||
@@ -0,0 +1,15 @@
|
||||
// Fill out your copyright notice in the Description page of Project Settings.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "CoreMinimal.h"
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
UENUM(BlueprintType)
|
||||
enum class EMovementState : uint8
|
||||
{
|
||||
Idle,
|
||||
Moving
|
||||
};
|
||||
@@ -0,0 +1,4 @@
|
||||
// © 2025 Naked People Team. All Rights Reserved.
|
||||
|
||||
|
||||
#include "NakedDesireGameInstance.h"
|
||||
@@ -0,0 +1,15 @@
|
||||
// © 2025 Naked People Team. All Rights Reserved.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "CoreMinimal.h"
|
||||
#include "NakedDesireGameInstance.generated.h"
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
UCLASS()
|
||||
class NAKEDDESIRE_API UNakedDesireGameInstance : public UGameInstance
|
||||
{
|
||||
GENERATED_BODY()
|
||||
};
|
||||
@@ -0,0 +1,70 @@
|
||||
// © 2025 Naked People Team. All Rights Reserved.
|
||||
|
||||
#include "NakedDesireGameMode.h"
|
||||
#include "Kismet/GameplayStatics.h"
|
||||
#include "NakedDesire/Clothing/ClothingItemData.h"
|
||||
#include "UObject/ConstructorHelpers.h"
|
||||
#include "NakedDesire/Interactables/Wardrobe.h"
|
||||
#include "NakedDesire/MissionBuilder/MissionsConfig.h"
|
||||
#include "NakedDesire/MissionBuilder/MissionsManager.h"
|
||||
#include "NakedDesire/Player/NakedDesireCharacter.h"
|
||||
|
||||
void ANakedDesireGameMode::RestartGame()
|
||||
{
|
||||
UGameplayStatics::OpenLevel(this, "City");
|
||||
}
|
||||
|
||||
AWardrobe* ANakedDesireGameMode::GetWardrobe() const
|
||||
{
|
||||
return Wardrobe;
|
||||
}
|
||||
|
||||
void ANakedDesireGameMode::BuyItem(UClothingItemData* ClothingItem)
|
||||
{
|
||||
ANakedDesireCharacter* Player = Cast<ANakedDesireCharacter>(UGameplayStatics::GetPlayerCharacter(GetWorld(), 0));
|
||||
if (!Player)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (Player->Money < ClothingItem->Info->BasePrice)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
Player->Money -= ClothingItem->Info->BasePrice;
|
||||
Wardrobe->ClothingItems.Add(ClothingItem);
|
||||
}
|
||||
|
||||
void ANakedDesireGameMode::OnHourChanged(int32 Hour)
|
||||
{
|
||||
if (Hour == 4)
|
||||
{
|
||||
DaysPassed++;
|
||||
RefreshDailyMissions();
|
||||
}
|
||||
}
|
||||
|
||||
void ANakedDesireGameMode::BeginPlay()
|
||||
{
|
||||
Super::BeginPlay();
|
||||
|
||||
if (AActor* FoundActor = UGameplayStatics::GetActorOfClass(GetWorld(), AWardrobe::StaticClass()))
|
||||
{
|
||||
if (AWardrobe* WardrobeActor = Cast<AWardrobe>(FoundActor))
|
||||
{
|
||||
Wardrobe = WardrobeActor;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void ANakedDesireGameMode::RefreshDailyMissions()
|
||||
{
|
||||
ANakedDesireCharacter* Player = Cast<ANakedDesireCharacter>(UGameplayStatics::GetPlayerCharacter(GetWorld(), 0));
|
||||
if (!Player)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
Player->MissionsManager->RefreshDailyMissions(MissionsConfig->DailyMissions[DaysPassed].Missions);
|
||||
}
|
||||
@@ -0,0 +1,62 @@
|
||||
// © 2025 Naked People Team. All Rights Reserved.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "CoreMinimal.h"
|
||||
#include "GameFramework/GameModeBase.h"
|
||||
#include "NakedDesireGameMode.generated.h"
|
||||
|
||||
class UMissionsConfig;
|
||||
class AWardrobe;
|
||||
class UClothingItemData;
|
||||
|
||||
UCLASS(minimalapi)
|
||||
class ANakedDesireGameMode : public AGameModeBase
|
||||
{
|
||||
GENERATED_BODY()
|
||||
|
||||
UPROPERTY()
|
||||
AWardrobe* Wardrobe = nullptr;
|
||||
|
||||
UPROPERTY(EditDefaultsOnly)
|
||||
UMissionsConfig* MissionsConfig;
|
||||
|
||||
int32 DaysPassed = 0;
|
||||
|
||||
public:
|
||||
int NoticeCount = 0;
|
||||
|
||||
|
||||
|
||||
void RestartGame();
|
||||
|
||||
UFUNCTION(BlueprintPure, BlueprintImplementableEvent)
|
||||
FTimecode GetCurrentTime() const;
|
||||
|
||||
UFUNCTION(BlueprintPure, BlueprintImplementableEvent)
|
||||
int32 GetDaysElapsed() const;
|
||||
|
||||
UFUNCTION(BlueprintImplementableEvent, BlueprintCallable)
|
||||
void SetCurrentTime(FTimecode TimeCode);
|
||||
|
||||
UFUNCTION(BlueprintPure)
|
||||
AWardrobe* GetWardrobe() const;
|
||||
|
||||
UFUNCTION(BlueprintImplementableEvent)
|
||||
void EndGameEmbarrassed();
|
||||
|
||||
UFUNCTION(BlueprintCallable)
|
||||
void BuyItem(UClothingItemData* ClothingItem);
|
||||
|
||||
UFUNCTION(BlueprintCallable)
|
||||
void OnHourChanged(int32 Hour);
|
||||
|
||||
protected:
|
||||
virtual void BeginPlay() override;
|
||||
|
||||
private:
|
||||
void RefreshDailyMissions();
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,60 @@
|
||||
// © 2025 Naked People Team. All Rights Reserved.
|
||||
|
||||
|
||||
#include "NakedDesireUserSettings.h"
|
||||
|
||||
void UNakedDesireUserSettings::SetGlobalVolume(float Value)
|
||||
{
|
||||
GlobalVolume = Value;
|
||||
}
|
||||
|
||||
float UNakedDesireUserSettings::GetGlobalVolume() const
|
||||
{
|
||||
return GlobalVolume;
|
||||
}
|
||||
|
||||
void UNakedDesireUserSettings::SetIsCensorshipEnabled(bool Value)
|
||||
{
|
||||
IsCensorshipEnabled = Value;
|
||||
}
|
||||
|
||||
bool UNakedDesireUserSettings::GetIsCensorshipEnabled() const
|
||||
{
|
||||
return IsCensorshipEnabled;
|
||||
}
|
||||
|
||||
bool UNakedDesireUserSettings::GetHasAcceptedDisclaimer() const
|
||||
{
|
||||
return HasAcceptedDisclaimer;
|
||||
}
|
||||
|
||||
void UNakedDesireUserSettings::SetHasAcceptedDisclaimer(bool Value)
|
||||
{
|
||||
HasAcceptedDisclaimer = Value;
|
||||
}
|
||||
|
||||
void UNakedDesireUserSettings::SaveSettings()
|
||||
{
|
||||
Super::SaveSettings();
|
||||
|
||||
OnSettingsChanged.Broadcast(this);
|
||||
}
|
||||
|
||||
void UNakedDesireUserSettings::ApplyNonResolutionSettings()
|
||||
{
|
||||
Super::ApplyNonResolutionSettings();
|
||||
|
||||
OnSettingsChanged.Broadcast(this);
|
||||
}
|
||||
|
||||
void UNakedDesireUserSettings::ApplySettings(bool bCheckForCommandLineOverrides)
|
||||
{
|
||||
Super::ApplySettings(bCheckForCommandLineOverrides);
|
||||
|
||||
OnSettingsChanged.Broadcast(this);
|
||||
}
|
||||
|
||||
UNakedDesireUserSettings* UNakedDesireUserSettings::GetNakedDesireUserSettings()
|
||||
{
|
||||
return Cast<UNakedDesireUserSettings>(Super::GetGameUserSettings());
|
||||
}
|
||||
@@ -0,0 +1,57 @@
|
||||
// © 2025 Naked People Team. All Rights Reserved.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "CoreMinimal.h"
|
||||
#include "GameFramework/GameUserSettings.h"
|
||||
#include "NakedDesireUserSettings.generated.h"
|
||||
|
||||
DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FOnSettingsChanged, class UNakedDesireUserSettings*, Settings);
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
UCLASS()
|
||||
class NAKEDDESIRE_API UNakedDesireUserSettings : public UGameUserSettings
|
||||
{
|
||||
GENERATED_BODY()
|
||||
|
||||
public:
|
||||
UFUNCTION(BlueprintCallable)
|
||||
static UNakedDesireUserSettings* GetNakedDesireUserSettings();
|
||||
|
||||
UFUNCTION(BlueprintCallable)
|
||||
void SetGlobalVolume(float Value);
|
||||
|
||||
UFUNCTION(BlueprintPure)
|
||||
float GetGlobalVolume() const;
|
||||
|
||||
UFUNCTION(BlueprintCallable)
|
||||
void SetIsCensorshipEnabled(bool Value);
|
||||
|
||||
UFUNCTION(BlueprintPure)
|
||||
bool GetIsCensorshipEnabled() const;
|
||||
|
||||
UFUNCTION(BlueprintPure)
|
||||
bool GetHasAcceptedDisclaimer() const;
|
||||
|
||||
UFUNCTION(BlueprintCallable)
|
||||
void SetHasAcceptedDisclaimer(bool Value);
|
||||
|
||||
virtual void SaveSettings() override;
|
||||
virtual void ApplyNonResolutionSettings() override;
|
||||
virtual void ApplySettings(bool bCheckForCommandLineOverrides) override;
|
||||
|
||||
UPROPERTY(BlueprintAssignable)
|
||||
FOnSettingsChanged OnSettingsChanged;
|
||||
|
||||
protected:
|
||||
UPROPERTY(Config)
|
||||
float GlobalVolume = 0.5f;
|
||||
|
||||
UPROPERTY(Config)
|
||||
bool IsCensorshipEnabled = false;
|
||||
|
||||
UPROPERTY(Config)
|
||||
bool HasAcceptedDisclaimer = false;
|
||||
};
|
||||
@@ -0,0 +1,15 @@
|
||||
// Fill out your copyright notice in the Description page of Project Settings.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "CoreMinimal.h"
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
UENUM(BlueprintType)
|
||||
enum class EStance : uint8
|
||||
{
|
||||
Stand,
|
||||
Crouch
|
||||
};
|
||||
@@ -0,0 +1,16 @@
|
||||
// © 2025 Naked People Team. All Rights Reserved.
|
||||
|
||||
|
||||
#include "Utils.h"
|
||||
|
||||
#include "Constants.h"
|
||||
|
||||
FString UUtils::GetSlotName()
|
||||
{
|
||||
return SLOT_NAME;
|
||||
}
|
||||
|
||||
int UUtils::GetSlotPlayer()
|
||||
{
|
||||
return SLOT_PLAYER;
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
// © 2025 Naked People Team. All Rights Reserved.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "CoreMinimal.h"
|
||||
#include "Kismet/BlueprintFunctionLibrary.h"
|
||||
#include "Utils.generated.h"
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
UCLASS()
|
||||
class NAKEDDESIRE_API UUtils : public UBlueprintFunctionLibrary
|
||||
{
|
||||
GENERATED_BODY()
|
||||
|
||||
public:
|
||||
UFUNCTION(BlueprintCallable, BlueprintPure)
|
||||
static FString GetSlotName();
|
||||
|
||||
UFUNCTION(BlueprintCallable, BlueprintPure)
|
||||
static int GetSlotPlayer();
|
||||
};
|
||||
Reference in New Issue
Block a user