|
VoltMod
C++23 framework for CS2 server plugins
|
#include <Flow.hpp>
Inheritance diagram for VoltMod::Flow< TState >:Classes | |
| struct | ConfirmSpec |
| struct | DurationStep |
| struct | OptionsStep |
Public Types | |
| using | Ptr = std::shared_ptr< Flow > |
| using | BuildFn = std::function< std::shared_ptr< Menu >(Flow &flow)> |
| using | AppliesFn = std::function< bool(const TState &)> |
Public Member Functions | |
| Ptr | AddStep (BuildFn build, AppliesFn applies={}) |
| Ptr | AddDurationStep (DurationStep step) |
| Ptr | AddOptionsStep (OptionsStep step) |
| Ptr | Validate (std::function< std::optional< std::string >(const TState &)> check) |
| Ptr | Confirm (ConfirmSpec spec) |
| Ptr | Finish (std::function< void(TState &)> finish) |
| void | Begin () |
| void | Advance () |
| TState & | State () |
Static Public Member Functions | |
| static Ptr | Create (MenuSurface &menus, int slot, TState initial) |
Runs a sequence of menus while collecting state for one player.
|
inline |
Append a duration-picker step, drawn by VoltMod::BuildDurationMenu.
Definition at line 78 of file Flow.hpp.
References VoltMod::Flow< TState >::AddStep(), VoltMod::BuildDurationMenu(), and VoltMod::ReadFile().
|
inline |
Append an options step.
Definition at line 108 of file Flow.hpp.
References VoltMod::Flow< TState >::AddStep(), and VoltMod::ReadFile().
|
inline |
Append a custom step.
Definition at line 71 of file Flow.hpp.
Referenced by VoltMod::Flow< TState >::AddDurationStep(), and VoltMod::Flow< TState >::AddOptionsStep().
|
inline |
|
inline |
|
inline |
End with a summary confirm dialog instead of finishing straight away.
Definition at line 128 of file Flow.hpp.
References VoltMod::ReadFile().
|
inlinestatic |
menus must outlive the flow.
Definition at line 65 of file Flow.hpp.
References VoltMod::ReadFile().
|
inline |
Definition at line 134 of file Flow.hpp.
References VoltMod::ReadFile().
|
inline |
|
inline |
Runs before each step and finish. Return a translation key to abort.
Definition at line 121 of file Flow.hpp.
References VoltMod::ReadFile().