You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-12-31 18:41:20 +00:00
Expose set_edited and is_edited on EditorInterface
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user