void UndoRedo::undo() { ERR_FAIL_COND(action_level>0); if (current_action<0) return; //nothing to redo _process_operation_list(actions[current_action].undo_ops.front()); current_action--; }
bool UndoRedo::undo() { ERR_FAIL_COND_V(action_level > 0, false); if (current_action < 0) return false; //nothing to redo _process_operation_list(actions.write[current_action].undo_ops.front()); current_action--; version--; return true; }
void UndoRedo::redo() { ERR_FAIL_COND(action_level > 0); if ((current_action + 1) >= actions.size()) return; //nothing to redo current_action++; _process_operation_list(actions[current_action].do_ops.front()); version++; }
bool UndoRedo::redo() { ERR_FAIL_COND_V(action_level > 0, false); if ((current_action + 1) >= actions.size()) return false; //nothing to redo current_action++; _process_operation_list(actions.write[current_action].do_ops.front()); version++; return true; }