-
-
Notifications
You must be signed in to change notification settings - Fork 21.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The UndoRedo class has been extended to make it more useful for its own use in addition to internal use by the engine itself. #41193
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -133,6 +133,36 @@ | |
Gets the name of the current action. | ||
</description> | ||
</method> | ||
<method name="get_action_count" qualifiers="const"> | ||
<return type="int"> | ||
</return> | ||
<description> | ||
Gets the ammount of actions. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Typo: "amount" Might be nice to clarify what this means exactly, i.e. that it represents the amount of actions currently stored in the undo/redo. |
||
</description> | ||
</method> | ||
<method name="get_current_action" qualifiers="const"> | ||
<return type="int"> | ||
</return> | ||
<description> | ||
Gets the index of the current action. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is there a link between the "current action" and the amount of undo steps available? If so, the current documentation does not mention it. |
||
</description> | ||
</method> | ||
<method name="set_max_actions"> | ||
<return type="void"> | ||
</return> | ||
<argument index="0" name="max_actions" type="int"> | ||
</argument> | ||
<description> | ||
Sets the max ammount of actions. If [code]max_actions[/code] is [code]-1[/code], there is no limit of actions. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. As above, "amount" There should be an explanation of what happens after the limit is reached, likely that the oldest action (index 0) is forgotten by the UndoRedo. Also, would be ideal if what happens to action indices after the limit is reached is also clarified. |
||
</description> | ||
</method> | ||
<method name="get_max_actions" qualifiers="const"> | ||
<return type="int"> | ||
</return> | ||
<description> | ||
Returns the max ammount of actions. Returns [code]-1[/code], when there is no limit of actions. | ||
</description> | ||
</method> | ||
<method name="get_version" qualifiers="const"> | ||
<return type="int"> | ||
</return> | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Non-blocking:
Shouldn't this occur in
create_action
instead? Note that this is where_discard_redo()
is used currently, and that it is where the action itself is created.Also, note that the
if
does not need to check foractions.size() > max_actions
as it is going to be checked by thewhile
anyway.