Expose set_edited and is_edited on EditorInterface
This commit is contained in:
parent
235a32ad11
commit
ff561c1379
3 changed files with 33 additions and 0 deletions
|
|
@ -705,6 +705,16 @@ void EditorInterface::reload_scene_from_path(const String &scene_path) {
|
|||
EditorNode::get_singleton()->reload_scene(scene_path);
|
||||
}
|
||||
|
||||
void EditorInterface::set_object_edited(Object *p_object, bool p_edited) {
|
||||
ERR_FAIL_NULL_MSG(p_object, "Cannot change edited status on a null object.");
|
||||
p_object->set_edited(p_edited);
|
||||
}
|
||||
|
||||
bool EditorInterface::is_object_edited(Object *p_object) const {
|
||||
ERR_FAIL_NULL_V_MSG(p_object, false, "Cannot check edit status on a null object.");
|
||||
return p_object->is_edited();
|
||||
}
|
||||
|
||||
Node *EditorInterface::get_edited_scene_root() const {
|
||||
return EditorNode::get_singleton()->get_edited_scene();
|
||||
}
|
||||
|
|
@ -895,6 +905,9 @@ void EditorInterface::_bind_methods() {
|
|||
ClassDB::bind_method(D_METHOD("open_scene_from_path", "scene_filepath", "set_inherited"), &EditorInterface::open_scene_from_path, DEFVAL(false));
|
||||
ClassDB::bind_method(D_METHOD("reload_scene_from_path", "scene_filepath"), &EditorInterface::reload_scene_from_path);
|
||||
|
||||
ClassDB::bind_method(D_METHOD("set_object_edited", "object", "edited"), &EditorInterface::set_object_edited);
|
||||
ClassDB::bind_method(D_METHOD("is_object_edited", "object"), &EditorInterface::is_object_edited);
|
||||
|
||||
ClassDB::bind_method(D_METHOD("get_open_scenes"), &EditorInterface::get_open_scenes);
|
||||
ClassDB::bind_method(D_METHOD("get_open_scene_roots"), &EditorInterface::get_open_scene_roots);
|
||||
ClassDB::bind_method(D_METHOD("get_edited_scene_root"), &EditorInterface::get_edited_scene_root);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue