diff --git a/Content/GameData/DA_BazaarSettings.uasset b/Content/GameData/DA_BazaarSettings.uasset new file mode 100644 index 00000000..ba4be15b --- /dev/null +++ b/Content/GameData/DA_BazaarSettings.uasset @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:50ac6734674f5cca57e5fefccba6d0c197d7cb3b379e15fcceafa10688c0d10a +size 5547 diff --git a/Content/Scripts/Bazar/BP_BazarSellingStand.uasset b/Content/Scripts/Bazar/BP_BazarSellingStand.uasset index 38ae8209..ca9cde0b 100644 --- a/Content/Scripts/Bazar/BP_BazarSellingStand.uasset +++ b/Content/Scripts/Bazar/BP_BazarSellingStand.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:65eeb1bc380ddff9e13f49060741cf7df5c976c0cc4d2019f0d77a83f527451b -size 1086992 +oid sha256:5961c4c98747ff18a832c752d79f55c2f7b98cf475cb119c15eb1bb3dcdf5d31 +size 982474 diff --git a/Content/Scripts/Bazar/EBazaarEmotion.uasset b/Content/Scripts/Bazar/EBazaarEmotion.uasset deleted file mode 100644 index 11e4216e..00000000 --- a/Content/Scripts/Bazar/EBazaarEmotion.uasset +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:33bfd5908365a610d6e6b5b211aa579934c7f4fc270bb69663344c4e3438c88f -size 2598 diff --git a/Content/Scripts/Bazar/FBazarOptionData.uasset b/Content/Scripts/Bazar/FBazarOptionData.uasset deleted file mode 100644 index 1cc48b47..00000000 --- a/Content/Scripts/Bazar/FBazarOptionData.uasset +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:71431290ef71147b540afc8cb9b263f42ba7b8d0524d37f753003cb821ac4e8d -size 4654 diff --git a/Content/Scripts/DialogueSystem/UI/DialogueScreen.uasset b/Content/Scripts/DialogueSystem/UI/DialogueScreen.uasset index 0a01bae5..00b047a6 100644 --- a/Content/Scripts/DialogueSystem/UI/DialogueScreen.uasset +++ b/Content/Scripts/DialogueSystem/UI/DialogueScreen.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:6f2fc6f097291b81bd79ec514ae0a01093fb434c1e8dddd8aae87f81a1705396 -size 661524 +oid sha256:1bc60c9560a528f02ee8309f2f86f58ef7c9aa949e346c50366b6b28a828b0f5 +size 660320 diff --git a/Content/Scripts/InventorySystem/UI/Modules/UI_SelectableTextModule.uasset b/Content/Scripts/InventorySystem/UI/Modules/UI_SelectableTextModule.uasset index 36dd17db..410271fe 100644 --- a/Content/Scripts/InventorySystem/UI/Modules/UI_SelectableTextModule.uasset +++ b/Content/Scripts/InventorySystem/UI/Modules/UI_SelectableTextModule.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:97cfc40730407373e1fe83ddea0ef54670306499ff65c51ece8678e1f3a318ba -size 120690 +oid sha256:fbaf9cff79cade18a29890ad0637f1c88991d9f977032f98f0fcf2ba4c39d9d7 +size 134090 diff --git a/Content/Scripts/MODULES/UI_DialogueOptionModule.uasset b/Content/Scripts/MODULES/UI_DialogueOptionModule.uasset index a0396240..0b0ec0c8 100644 --- a/Content/Scripts/MODULES/UI_DialogueOptionModule.uasset +++ b/Content/Scripts/MODULES/UI_DialogueOptionModule.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:eae9c20bd314a3a91b807bc780697c4a7d8a2ebc016f25920de4afe6c7b42238 -size 116933 +oid sha256:8d7bc36ec901c645e3f9487f05fe36e978fbba017db0ebe99d64a458f057e986 +size 117355 diff --git a/Source/ProjectEleri/Bazar/BazarSellingStand.cpp b/Source/ProjectEleri/Bazar/BazarSellingStand.cpp index e4c51d26..62d39f03 100644 --- a/Source/ProjectEleri/Bazar/BazarSellingStand.cpp +++ b/Source/ProjectEleri/Bazar/BazarSellingStand.cpp @@ -3,3 +3,12 @@ #include "BazarSellingStand.h" +void ABazarSellingStand::BeginPlay() +{ + Super::BeginPlay(); + + BazarSettingsDataAsset.LoadAsync(FLoadSoftObjectPathAsyncDelegate::CreateWeakLambda(this, [this](const FSoftObjectPath& Path, UObject* Object) + { + + })); +} diff --git a/Source/ProjectEleri/Bazar/BazarSellingStand.h b/Source/ProjectEleri/Bazar/BazarSellingStand.h index f43075de..c5687626 100644 --- a/Source/ProjectEleri/Bazar/BazarSellingStand.h +++ b/Source/ProjectEleri/Bazar/BazarSellingStand.h @@ -6,6 +6,8 @@ #include "ProjectEleri/GameObjects/EleriBaseActor.h" #include "BazarSellingStand.generated.h" +class UBazarSettingsDataAsset; + /** * */ @@ -14,4 +16,11 @@ class PROJECTELERI_API ABazarSellingStand : public AEleriBaseActor { GENERATED_BODY() +public: + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Eleri|Bazaar") + TSoftObjectPtr BazarSettingsDataAsset; + +protected: + virtual void BeginPlay() override; + }; diff --git a/Source/ProjectEleri/Data/BazarSettingsDataAsset.cpp b/Source/ProjectEleri/Data/BazarSettingsDataAsset.cpp new file mode 100644 index 00000000..cf7c8f4e --- /dev/null +++ b/Source/ProjectEleri/Data/BazarSettingsDataAsset.cpp @@ -0,0 +1,25 @@ +// Fill out your copyright notice in the Description page of Project Settings. + + +#include "BazarSettingsDataAsset.h" + +void UBazarSettingsDataAsset::GetModifiersFromEmotionData(const FBazarDialogueEmotionData& InData, int32& OutAnger, + int32& OutFear, int32& OutSadness) +{ + for (const FBazarEmotionModifier& Mod : InData.EmotionModifiers) + { + switch (Mod.Emotion) + { + case EBazarNpcEmotion::Anger: + OutAnger = FMath::RandRange(Mod.ValueMin, Mod.ValueMax); + break; + case EBazarNpcEmotion::Fear: + OutFear = FMath::RandRange(Mod.ValueMin, Mod.ValueMax); + break; + case EBazarNpcEmotion::Sadness: + OutSadness = FMath::RandRange(Mod.ValueMin, Mod.ValueMax); + break; + default: ; + } + } +} diff --git a/Source/ProjectEleri/Data/BazarSettingsDataAsset.h b/Source/ProjectEleri/Data/BazarSettingsDataAsset.h new file mode 100644 index 00000000..20295b30 --- /dev/null +++ b/Source/ProjectEleri/Data/BazarSettingsDataAsset.h @@ -0,0 +1,61 @@ +// Fill out your copyright notice in the Description page of Project Settings. + +#pragma once + +#include "CoreMinimal.h" +#include "Engine/DataAsset.h" +#include "BazarSettingsDataAsset.generated.h" + +UENUM(BlueprintType) +enum class EBazarNpcEmotion: uint8 +{ + None, + Anger, + Fear, + Sadness, + MAX UMETA(Hidden) +}; + +USTRUCT(BlueprintType) +struct FBazarEmotionModifier +{ + GENERATED_BODY() + + UPROPERTY(BlueprintReadWrite, EditAnywhere) + EBazarNpcEmotion Emotion; + + UPROPERTY(BlueprintReadWrite, EditAnywhere) + float ValueMin = 0.f; + + UPROPERTY(BlueprintReadWrite, EditAnywhere) + float ValueMax = 0.f; + + float GetValueInRange() const { return FMath::RandRange(ValueMin, ValueMax); } +}; + +USTRUCT(BlueprintType) +struct FBazarDialogueEmotionData +{ + GENERATED_BODY() + + UPROPERTY(BlueprintReadWrite, EditAnywhere) + TArray EmotionModifiers; + + UPROPERTY(BlueprintReadWrite, EditAnywhere) + FText DialogueText; +}; + +/** + * + */ +UCLASS() +class PROJECTELERI_API UBazarSettingsDataAsset : public UDataAsset +{ + GENERATED_BODY() +public: + UPROPERTY(BlueprintReadWrite, EditAnywhere) + TArray AvailableDialogueEmotionData; + + UFUNCTION(BlueprintPure, Category = "Eleri|Bazaar") + static void GetModifiersFromEmotionData(const FBazarDialogueEmotionData& InData, int32& OutAnger, int32& OutFear, int32& OutSadness); +};