Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
godot
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
community
godot
Commits
e9db8964
Commit
e9db8964
authored
May 26, 2018
by
Marcelo Fernandez
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add a message when there is nothing to Undo or Redo
parent
130fd6bc
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
13 additions
and
8 deletions
+13
-8
undo_redo.cpp
core/undo_redo.cpp
+10
-6
undo_redo.h
core/undo_redo.h
+2
-2
editor_node.cpp
editor/editor_node.cpp
+0
-0
editor_node.h
editor/editor_node.h
+1
-0
No files found.
core/undo_redo.cpp
View file @
e9db8964
...
...
@@ -299,26 +299,30 @@ void UndoRedo::_process_operation_list(List<Operation>::Element *E) {
}
}
void
UndoRedo
::
redo
()
{
bool
UndoRedo
::
redo
()
{
ERR_FAIL_COND
(
action_level
>
0
);
ERR_FAIL_COND
_V
(
action_level
>
0
,
false
);
if
((
current_action
+
1
)
>=
actions
.
size
())
return
;
//nothing to redo
return
false
;
//nothing to redo
current_action
++
;
_process_operation_list
(
actions
[
current_action
].
do_ops
.
front
());
version
++
;
return
true
;
}
void
UndoRedo
::
undo
()
{
bool
UndoRedo
::
undo
()
{
ERR_FAIL_COND
(
action_level
>
0
);
ERR_FAIL_COND
_V
(
action_level
>
0
,
false
);
if
(
current_action
<
0
)
return
;
//nothing to redo
return
false
;
//nothing to redo
_process_operation_list
(
actions
[
current_action
].
undo_ops
.
front
());
current_action
--
;
version
--
;
return
true
;
}
void
UndoRedo
::
clear_history
()
{
...
...
core/undo_redo.h
View file @
e9db8964
...
...
@@ -109,8 +109,8 @@ public:
void
commit_action
();
void
redo
();
void
undo
();
bool
redo
();
bool
undo
();
String
get_current_action_name
()
const
;
void
clear_history
();
...
...
editor/editor_node.cpp
View file @
e9db8964
This diff is collapsed.
Click to expand it.
editor/editor_node.h
View file @
e9db8964
...
...
@@ -680,6 +680,7 @@ public:
Ref
<
Theme
>
get_editor_theme
()
const
{
return
theme
;
}
void
show_accept
(
const
String
&
p_text
,
const
String
&
p_title
);
void
show_warning
(
const
String
&
p_text
,
const
String
&
p_title
=
"Warning!"
);
Error
export_preset
(
const
String
&
p_preset
,
const
String
&
p_path
,
bool
p_debug
,
const
String
&
p_password
,
bool
p_quit_after
=
false
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment