Started buildings undo system implementation

This commit is contained in:
2024-07-26 13:44:03 +03:00
parent 42ac0f19ca
commit e30e1ed2d8
4 changed files with 39 additions and 12 deletions

View File

@@ -337,6 +337,12 @@ void StreamWorld::run_command(const String &command, const Array &args)
bnode->set_global_transform(args[1]);
VariantWriter::write_to_string(buildings[id].xform, key);
buildings[id].key = key;
} else if (command == "buildings_checkpoint") {
/* TODO */
} else if (command == "buildings_undo") {
/* TODO */
} else if (command == "buildings_save") {
/* TODO */
} else
print_error("No command " + command);
}

View File

@@ -120,6 +120,18 @@ void WorldEditor::editor_command(const String &command, const Array &args)
if (stream_world) {
stream_world->run_command(command, args);
}
} else if (command == "buildings_checkpoint") {
if (stream_world) {
stream_world->run_command(command, args);
}
} else if (command == "buildings_undo") {
if (stream_world) {
stream_world->run_command(command, args);
}
} else if (command == "buildings_save") {
if (stream_world) {
stream_world->run_command(command, args);
}
}
}