diff --git a/Content/Blueprints/Curves/FireScaleXY.uasset b/Content/Blueprints/Curves/FireScaleXY.uasset new file mode 100644 index 0000000..e5d43fb Binary files /dev/null and b/Content/Blueprints/Curves/FireScaleXY.uasset differ diff --git a/Content/Blueprints/Curves/FireScaleZ.uasset b/Content/Blueprints/Curves/FireScaleZ.uasset new file mode 100644 index 0000000..a4945cf Binary files /dev/null and b/Content/Blueprints/Curves/FireScaleZ.uasset differ diff --git a/Content/Blueprints/Input/IA_ActivateKnob.uasset b/Content/Blueprints/Input/IA_ActivateKnob.uasset new file mode 100644 index 0000000..bf2e10d Binary files /dev/null and b/Content/Blueprints/Input/IA_ActivateKnob.uasset differ diff --git a/Content/Blueprints/Input/IA_KnobMoveController.uasset b/Content/Blueprints/Input/IA_KnobMoveController.uasset new file mode 100644 index 0000000..ffb934f Binary files /dev/null and b/Content/Blueprints/Input/IA_KnobMoveController.uasset differ diff --git a/Content/Blueprints/Input/IA_KnobMoveKeyboard.uasset b/Content/Blueprints/Input/IA_KnobMoveKeyboard.uasset new file mode 100644 index 0000000..a6f5e65 Binary files /dev/null and b/Content/Blueprints/Input/IA_KnobMoveKeyboard.uasset differ diff --git a/Content/Blueprints/Input/IA_KnobToggleKeyboard.uasset b/Content/Blueprints/Input/IA_KnobToggleKeyboard.uasset new file mode 100644 index 0000000..bceff4a Binary files /dev/null and b/Content/Blueprints/Input/IA_KnobToggleKeyboard.uasset differ diff --git a/Content/Blueprints/Input/IA_OpenMenu.uasset b/Content/Blueprints/Input/IA_OpenMenu.uasset new file mode 100644 index 0000000..5f83b54 Binary files /dev/null and b/Content/Blueprints/Input/IA_OpenMenu.uasset differ diff --git a/Content/Blueprints/Input/IA_OvenKnobSelection.uasset b/Content/Blueprints/Input/IA_OvenKnobSelection.uasset new file mode 100644 index 0000000..cb58d51 Binary files /dev/null and b/Content/Blueprints/Input/IA_OvenKnobSelection.uasset differ diff --git a/Content/Blueprints/Input/IA_SelectKnobLeft.uasset b/Content/Blueprints/Input/IA_SelectKnobLeft.uasset new file mode 100644 index 0000000..c433537 Binary files /dev/null and b/Content/Blueprints/Input/IA_SelectKnobLeft.uasset differ diff --git a/Content/Blueprints/Input/IA_SelectKnobRight.uasset b/Content/Blueprints/Input/IA_SelectKnobRight.uasset new file mode 100644 index 0000000..d9b9098 Binary files /dev/null and b/Content/Blueprints/Input/IA_SelectKnobRight.uasset differ diff --git a/Content/Blueprints/Input/IMC_Furnace.uasset b/Content/Blueprints/Input/IMC_Furnace.uasset new file mode 100644 index 0000000..4229ca6 Binary files /dev/null and b/Content/Blueprints/Input/IMC_Furnace.uasset differ diff --git a/Content/Blueprints/Materials/MI_Fire.uasset b/Content/Blueprints/Materials/MI_Fire.uasset new file mode 100644 index 0000000..b6cd79f Binary files /dev/null and b/Content/Blueprints/Materials/MI_Fire.uasset differ diff --git a/Content/Blueprints/Materials/M_Fire.uasset b/Content/Blueprints/Materials/M_Fire.uasset new file mode 100644 index 0000000..d2a5cf5 Binary files /dev/null and b/Content/Blueprints/Materials/M_Fire.uasset differ diff --git a/Content/Blueprints/OvenCookspot_BP.uasset b/Content/Blueprints/OvenCookspot_BP.uasset index 2e8e7d6..c252406 100644 Binary files a/Content/Blueprints/OvenCookspot_BP.uasset and b/Content/Blueprints/OvenCookspot_BP.uasset differ diff --git a/Content/Blueprints/OvenPawn_BP.uasset b/Content/Blueprints/OvenPawn_BP.uasset index 53a82e9..19b81c7 100644 Binary files a/Content/Blueprints/OvenPawn_BP.uasset and b/Content/Blueprints/OvenPawn_BP.uasset differ diff --git a/Content/Levels/Main.umap b/Content/Levels/Main.umap index 80ce0f9..72f3bca 100644 Binary files a/Content/Levels/Main.umap and b/Content/Levels/Main.umap differ diff --git a/Content/__ExternalActors__/Levels/Main/1/WT/7J9UKEOU9FZ4MSUVEO0X27.uasset b/Content/__ExternalActors__/Levels/Main/1/WT/7J9UKEOU9FZ4MSUVEO0X27.uasset index a989a25..afbea61 100644 Binary files a/Content/__ExternalActors__/Levels/Main/1/WT/7J9UKEOU9FZ4MSUVEO0X27.uasset and b/Content/__ExternalActors__/Levels/Main/1/WT/7J9UKEOU9FZ4MSUVEO0X27.uasset differ diff --git a/Content/__ExternalActors__/Levels/Main/2/VE/9QQDSCIN5U7EXJZOEVV967.uasset b/Content/__ExternalActors__/Levels/Main/2/VE/9QQDSCIN5U7EXJZOEVV967.uasset index 39f6f54..d1f70e7 100644 Binary files a/Content/__ExternalActors__/Levels/Main/2/VE/9QQDSCIN5U7EXJZOEVV967.uasset and b/Content/__ExternalActors__/Levels/Main/2/VE/9QQDSCIN5U7EXJZOEVV967.uasset differ diff --git a/Content/__ExternalActors__/Levels/Main/6/OD/VIU20N2A76GYCO1DVKBZ7K.uasset b/Content/__ExternalActors__/Levels/Main/6/OD/VIU20N2A76GYCO1DVKBZ7K.uasset index 73516e5..d463345 100644 Binary files a/Content/__ExternalActors__/Levels/Main/6/OD/VIU20N2A76GYCO1DVKBZ7K.uasset and b/Content/__ExternalActors__/Levels/Main/6/OD/VIU20N2A76GYCO1DVKBZ7K.uasset differ diff --git a/Content/__ExternalActors__/Levels/Main/9/BI/1E2K4JCEVV61RIQPXV14J0.uasset b/Content/__ExternalActors__/Levels/Main/9/BI/1E2K4JCEVV61RIQPXV14J0.uasset index 28a369d..ff0f0b7 100644 Binary files a/Content/__ExternalActors__/Levels/Main/9/BI/1E2K4JCEVV61RIQPXV14J0.uasset and b/Content/__ExternalActors__/Levels/Main/9/BI/1E2K4JCEVV61RIQPXV14J0.uasset differ diff --git a/Content/__ExternalActors__/Levels/Main/B/54/SRV55I3JSWLTKQNJNVREKY.uasset b/Content/__ExternalActors__/Levels/Main/B/54/SRV55I3JSWLTKQNJNVREKY.uasset index a9b7e27..512d39a 100644 Binary files a/Content/__ExternalActors__/Levels/Main/B/54/SRV55I3JSWLTKQNJNVREKY.uasset and b/Content/__ExternalActors__/Levels/Main/B/54/SRV55I3JSWLTKQNJNVREKY.uasset differ diff --git a/Content/__ExternalActors__/Levels/Main/E/WP/88HCTL2XJVH0BSO91BGVU1.uasset b/Content/__ExternalActors__/Levels/Main/E/WP/88HCTL2XJVH0BSO91BGVU1.uasset index f6947bc..d8c62e8 100644 Binary files a/Content/__ExternalActors__/Levels/Main/E/WP/88HCTL2XJVH0BSO91BGVU1.uasset and b/Content/__ExternalActors__/Levels/Main/E/WP/88HCTL2XJVH0BSO91BGVU1.uasset differ diff --git a/Source/minicook/OvenCookspot.cpp b/Source/minicook/OvenCookspot.cpp index fb69adc..1ce9e6e 100644 --- a/Source/minicook/OvenCookspot.cpp +++ b/Source/minicook/OvenCookspot.cpp @@ -20,6 +20,20 @@ AOvenCookspot::AOvenCookspot() CookpotMesh->SetupAttachment(RootComponent); } +void AOvenCookspot::UpdateFire(const float DeltaTime) const +{ + if (FireScaleCurveXY && FireScaleCurveZ && FireMesh) + { + const float ScaleXY = FireScaleCurveXY->GetFloatValue(CurrentHeat); + const float ScaleZ = FireScaleCurveZ->GetFloatValue(CurrentHeat); + FireMesh->SetWorldScale3D(FVector(ScaleXY, ScaleXY, ScaleZ)); + } + else + { + UE_LOG(LogTemp, Error, TEXT("FireScaleCurveXY, FireScaleCurveZ or FireMesh is null")); + } +} + // Called when the game starts or when spawned void AOvenCookspot::BeginPlay() { @@ -28,8 +42,9 @@ void AOvenCookspot::BeginPlay() } // Called every frame -void AOvenCookspot::Tick(float DeltaTime) +void AOvenCookspot::Tick(const float DeltaTime) { Super::Tick(DeltaTime); + UpdateFire(DeltaTime); } \ No newline at end of file diff --git a/Source/minicook/OvenCookspot.h b/Source/minicook/OvenCookspot.h index 841f67b..f0c92c2 100644 --- a/Source/minicook/OvenCookspot.h +++ b/Source/minicook/OvenCookspot.h @@ -15,6 +15,9 @@ public: // Sets default values for this actor's properties AOvenCookspot(); + UFUNCTION(BlueprintCallable, Category = "Cookspot") + void UpdateFire(const float DeltaTime) const; + protected: // Called when the game starts or when spawned virtual void BeginPlay() override; @@ -24,8 +27,6 @@ public: virtual void Tick(float DeltaTime) override; public: - UPROPERTY(EditAnywhere, BlueprintReadWrite) - TObjectPtr RootComp; UPROPERTY(EditAnywhere, BlueprintReadWrite) TObjectPtr FireMesh; @@ -35,4 +36,13 @@ public: UPROPERTY(EditAnywhere, BlueprintReadWrite) TObjectPtr CookpotMesh; + + UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "Default") + TObjectPtr FireScaleCurveXY; + + UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "Default") + TObjectPtr FireScaleCurveZ; +private: + // [0.0, 1.0] + double CurrentHeat; }; \ No newline at end of file diff --git a/Source/minicook/OvenPawn.cpp b/Source/minicook/OvenPawn.cpp index 0e8d3ad..28cb4dc 100644 --- a/Source/minicook/OvenPawn.cpp +++ b/Source/minicook/OvenPawn.cpp @@ -112,6 +112,9 @@ void AOvenPawn::BeginPlay() { Super::BeginPlay(); + Cookstoves.AddDefaulted(CookspotLocations.Num()); + + size_t CookspotIdx{0}; for (const AActor *CookspotLoc : CookspotLocations) { FActorSpawnParameters SpawnParameters; @@ -120,11 +123,9 @@ void AOvenPawn::BeginPlay() CookspotLoc->GetTransform(), SpawnParameters); OvenCookspotActor->SetActorLocation(CookspotLoc->GetActorLocation()); - CookstoveObjects.Add(OvenCookspotActor); + Cookstoves[CookspotIdx].OvenCookstoveActor = OvenCookspotActor; + CookspotIdx++; } - // Setup the cookstove related items - Cookstoves.AddDefaulted(CookspotLocations.Num()); - checkf(Cookstoves.Num() == CookstoveObjects.Num(), TEXT("Cookstoves and CookstoveObjects have different sizes")) } void AOvenPawn::Tick(float DeltaTime) diff --git a/Source/minicook/OvenPawn.h b/Source/minicook/OvenPawn.h index d9b8c6e..cf37245 100644 --- a/Source/minicook/OvenPawn.h +++ b/Source/minicook/OvenPawn.h @@ -69,6 +69,8 @@ struct FCookstove FCookingStats CookingStats{}; + TObjectPtr OvenCookstoveActor; + /** * @brief Given a @param DataTablePtr and a @param MealID, configure the cookstove to start cooking the meal. * @return Returns whether we found a meal with the provided @param MealID and successfully started cooking it. @@ -151,6 +153,5 @@ public: private: // An array of all the cookstoves, from left to right on the screen. - TArray> CookstoveObjects; TArray Cookstoves; }; \ No newline at end of file