Commit e9db8964 by Marcelo Fernandez

Add a message when there is nothing to Undo or Redo

parent 130fd6bc
......@@ -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() {
......
......@@ -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();
......
......@@ -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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment