Skip to content

Commit

Permalink
Merge branch 'main' into more-timeline-types
Browse files Browse the repository at this point in the history
  • Loading branch information
zompi2 committed Jul 29, 2024
2 parents 6e23af7 + e299343 commit fb667af
Show file tree
Hide file tree
Showing 17 changed files with 445 additions and 52 deletions.
7 changes: 7 additions & 0 deletions Changelog.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
###### 3.3.8
* Fixed coroutines compilation for the environment without coroutines support (which has been broken in 3.3.6).

###### 3.3.7
* Almost every action got alternative callbacks with the less amount of parameters that might not always be needed and are just confusing.
* Better commented callbacks parameters.

###### 3.3.6
* Properly destroying coroutine handlers for actions that has been aborted.
* Renamed CoroutineTasks to CoroutineAwaiters to keep proper naming conventions.
Expand Down
2 changes: 1 addition & 1 deletion EnhancedCodeFlow.uplugin
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"FileVersion": 3,
"Version": 1,
"VersionName": "3.3.6",
"VersionName": "3.3.8",
"FriendlyName": "Enhanced Code Flow",
"Description": "This code plugin provides functions that drastically improve the quality of life during the implementation of game flow in C++.",
"Category": "Programming",
Expand Down
20 changes: 12 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -130,8 +130,8 @@ Run the following functions to use enhanced code flow!
#### Delay

Execute specified action after some time. This can be useful in many various situations. Everytime when I was using a Delay node
in blueprints I wish there was an equivalent of it in c++. The `bStopped` tells if this action has been stopped by a Stop function.
Execute specified action after some time. This can be useful in many various situations. Everytime when I was using a Delay node in blueprints I wish there was an equivalent of it in c++.
The `bStopped` tells if this action has been stopped by a Stop function. This argument is optional.

``` cpp
FFlow::Delay(this, 2.f, [this](bool bStopped)
Expand All @@ -150,7 +150,8 @@ You can plan to execute delayed code without delaying the whole Blueprint, you c
#### Delay Ticks
Execute specified action after some ticks. Can be useful if we want to execute some code in next game tick.
Execute specified action after some ticks. Can be useful if we want to execute some code in next game tick.
The `bStopped` tells if this action has been stopped by a Stop function. This argument is optional.
``` cpp
FFlow::DelayTicks(this, 1, [this](bool bStopped)
Expand Down Expand Up @@ -188,6 +189,7 @@ FFlow::AddTicker(this, 10.f, [this](float DeltaTime)
{
// Code to execute when ticker finishes ticking.
// The bStopped tells if this action has been stopped by a Stop function.
// The bStopped argument is optional.
});
```

Expand Down Expand Up @@ -229,7 +231,8 @@ FFlow::StopAction(this, TickerHandle);
Waits until specific conditions are met and then executes code.
The conditions are defined in a form of a predicate.
You can specify a timeout, which will stop this action after the given time. Setting the timeout value to less or equal 0 will cause this function to run infinitely untill the predicate returns true or when it is explicitly stopped.
The `bStopped` tells if this action has been stopped by a Stop function.
The `bStopped` tells if this action has been stopped by a Stop function. This argument is optional.
The `bTimedOut` tells if this action has been stopped because it timed out. This argument is optional.
Perfect solution if code needs a reference to an object, which spawn moment is not clearly defined, or if you can execute a specific code only when the game reaches a specific state.


Expand Down Expand Up @@ -276,6 +279,7 @@ FFlow::WhileTrueExecute(this, [this]()
{
// Optionally implement a code that runs when this action ends, even when the condition
// in the predicate returns false or it is timed out or it is explicitly stopped.
// Both bTimedOut and bStopped arguments are optional.
}, 0.f);
```

Expand All @@ -293,7 +297,7 @@ You can specify a timeout, which will stop this action after the given time.

> Have in mind, that the neither the timeout nor stopping the action will not stop the running async thread. It just won't trigger the callback when the async task ends. Handle timeout on the side of the async task itself.
The `bStopped` tells if this action has been stopped by a Stop function.
The `bStopped` tells if this action has been stopped by a Stop function. This argument is optional.
You can define the priority of the running task as `Normal` (`AnyBackgroundThreadNormalTask`) or `HiPriority` (`AnyBackgroundHiPriTask`).

> Have in mind, that you can start this function from GameThread only!
Expand Down Expand Up @@ -336,7 +340,7 @@ The function requires the following parameters:
* EaseInOut
* BlendExp - an exponent defining a shape of EaseIn, EaseOut and EaseInOut function shapes. *(default value: 1.f)*;
The `bStopped` tells if this action has been stopped by a Stop function.
The `bStopped` tells if this action has been stopped by a Stop function. This argument is optional.
``` cpp
FFlow::AddTimeline(this, 0.f, 1.f, 2.f, [this](float Value, float Time)
Expand Down Expand Up @@ -366,7 +370,7 @@ FFlow::AddCustomTimeline(this, Curve, [this](float Value, float Time)
},
[this](float Value, float Time, bool bStopped)
{
// Code to run when timeline stops
// Code to run when timeline stops. bStopped argument is optional.
});
```
Expand Down Expand Up @@ -498,7 +502,7 @@ To make defining these settings easier there are few macros that creates a setti
* `ECF_STARTPAUSED` - settings which makes this action started in paused state

``` cpp
FFlow::Delay(this, 2.f, [this](bool bStopped)
FFlow::Delay(this, 2.f, [this]()
{
// Run this code after 2 seconds, while ignoring game pause.
}, ECF_IGNOREPAUSE);
Expand Down
Loading

0 comments on commit fb667af

Please sign in to comment.