Skip to content

Commit

Permalink
Allow users of the undo module to follow the command pattern more clo…
Browse files Browse the repository at this point in the history
…sely if needed
  • Loading branch information
Madman10K committed Jun 10, 2024
1 parent 010afa2 commit 35fca09
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions Framework/C/Modules/Undo/Undo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
extern "C"
{
#endif
void UImGui_StateTracker_push(UImGui_CTransaction transaction)
void UImGui_StateTracker_push(UImGui_CTransaction transaction, bool bRedoIsInit)
{
UImGui::StateTracker::push({
.undofunc = [&](UImGui::TransactionPayload& payload) -> void
Expand All @@ -17,7 +17,7 @@ void UImGui_StateTracker_push(UImGui_CTransaction transaction)
transaction.redoFunc(&payload);
},
.payload = transaction.payload
});
}, bRedoIsInit);
}

void UImGui_StateTracker_undo()
Expand Down
3 changes: 2 additions & 1 deletion Framework/C/Modules/Undo/Undo.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ extern "C"
} UImGui_CTransaction;

// UntitledImGuiFramework Event Safety - Post-begin
UIMGUI_PUBLIC_API void UImGui_StateTracker_push(UImGui_CTransaction transaction);
// bRedoIsInit defaults to false in the C++ API
UIMGUI_PUBLIC_API void UImGui_StateTracker_push(UImGui_CTransaction transaction, bool bRedoIsInit);
// UntitledImGuiFramework Event Safety - Post-begin
UIMGUI_PUBLIC_API void UImGui_StateTracker_undo();
// UntitledImGuiFramework Event Safety - Post-begin
Expand Down

0 comments on commit 35fca09

Please sign in to comment.