Added EditorPlugin 'resource_saved' signal
This commit is contained in:
parent
920715b97d
commit
80595ba92b
5 changed files with 16 additions and 0 deletions
|
@ -364,6 +364,14 @@ void EditorData::notify_edited_scene_changed() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void EditorData::notify_resource_saved(const Ref<Resource> &p_resource) {
|
||||||
|
|
||||||
|
for (int i = 0; i < editor_plugins.size(); i++) {
|
||||||
|
|
||||||
|
editor_plugins[i]->notify_resource_saved(p_resource);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void EditorData::clear_editor_states() {
|
void EditorData::clear_editor_states() {
|
||||||
|
|
||||||
for (int i = 0; i < editor_plugins.size(); i++) {
|
for (int i = 0; i < editor_plugins.size(); i++) {
|
||||||
|
|
|
@ -203,6 +203,7 @@ public:
|
||||||
void save_edited_scene_state(EditorSelection *p_selection, EditorHistory *p_history, const Dictionary &p_custom);
|
void save_edited_scene_state(EditorSelection *p_selection, EditorHistory *p_history, const Dictionary &p_custom);
|
||||||
Dictionary restore_edited_scene_state(EditorSelection *p_selection, EditorHistory *p_history);
|
Dictionary restore_edited_scene_state(EditorSelection *p_selection, EditorHistory *p_history);
|
||||||
void notify_edited_scene_changed();
|
void notify_edited_scene_changed();
|
||||||
|
void notify_resource_saved(const Ref<Resource> &p_resource);
|
||||||
|
|
||||||
EditorData();
|
EditorData();
|
||||||
};
|
};
|
||||||
|
|
|
@ -596,6 +596,7 @@ void EditorNode::save_resource_in_path(const Ref<Resource> &p_resource, const St
|
||||||
|
|
||||||
((Resource *)p_resource.ptr())->set_path(path);
|
((Resource *)p_resource.ptr())->set_path(path);
|
||||||
emit_signal("resource_saved", p_resource);
|
emit_signal("resource_saved", p_resource);
|
||||||
|
editor_data.notify_resource_saved(p_resource);
|
||||||
}
|
}
|
||||||
|
|
||||||
void EditorNode::save_resource(const Ref<Resource> &p_resource) {
|
void EditorNode::save_resource(const Ref<Resource> &p_resource) {
|
||||||
|
|
|
@ -410,6 +410,10 @@ void EditorPlugin::notify_scene_closed(const String &scene_filepath) {
|
||||||
emit_signal("scene_closed", scene_filepath);
|
emit_signal("scene_closed", scene_filepath);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void EditorPlugin::notify_resource_saved(const Ref<Resource> &p_resource) {
|
||||||
|
emit_signal("resource_saved", p_resource);
|
||||||
|
}
|
||||||
|
|
||||||
Ref<SpatialEditorGizmo> EditorPlugin::create_spatial_gizmo(Spatial *p_spatial) {
|
Ref<SpatialEditorGizmo> EditorPlugin::create_spatial_gizmo(Spatial *p_spatial) {
|
||||||
//??
|
//??
|
||||||
if (get_script_instance() && get_script_instance()->has_method("create_spatial_gizmo")) {
|
if (get_script_instance() && get_script_instance()->has_method("create_spatial_gizmo")) {
|
||||||
|
@ -690,6 +694,7 @@ void EditorPlugin::_bind_methods() {
|
||||||
ADD_SIGNAL(MethodInfo("scene_changed", PropertyInfo(Variant::OBJECT, "scene_root", PROPERTY_HINT_RESOURCE_TYPE, "Node")));
|
ADD_SIGNAL(MethodInfo("scene_changed", PropertyInfo(Variant::OBJECT, "scene_root", PROPERTY_HINT_RESOURCE_TYPE, "Node")));
|
||||||
ADD_SIGNAL(MethodInfo("scene_closed", PropertyInfo(Variant::STRING, "filepath")));
|
ADD_SIGNAL(MethodInfo("scene_closed", PropertyInfo(Variant::STRING, "filepath")));
|
||||||
ADD_SIGNAL(MethodInfo("main_screen_changed", PropertyInfo(Variant::STRING, "screen_name")));
|
ADD_SIGNAL(MethodInfo("main_screen_changed", PropertyInfo(Variant::STRING, "screen_name")));
|
||||||
|
ADD_SIGNAL(MethodInfo("resource_saved", PropertyInfo(Variant::OBJECT, "resource", PROPERTY_HINT_RESOURCE_TYPE, "Resource")));
|
||||||
|
|
||||||
BIND_ENUM_CONSTANT(CONTAINER_TOOLBAR);
|
BIND_ENUM_CONSTANT(CONTAINER_TOOLBAR);
|
||||||
BIND_ENUM_CONSTANT(CONTAINER_SPATIAL_EDITOR_MENU);
|
BIND_ENUM_CONSTANT(CONTAINER_SPATIAL_EDITOR_MENU);
|
||||||
|
|
|
@ -163,6 +163,7 @@ public:
|
||||||
void notify_main_screen_changed(const String &screen_name);
|
void notify_main_screen_changed(const String &screen_name);
|
||||||
void notify_scene_changed(const Node *scn_root);
|
void notify_scene_changed(const Node *scn_root);
|
||||||
void notify_scene_closed(const String &scene_filepath);
|
void notify_scene_closed(const String &scene_filepath);
|
||||||
|
void notify_resource_saved(const Ref<Resource> &p_resource);
|
||||||
|
|
||||||
virtual Ref<SpatialEditorGizmo> create_spatial_gizmo(Spatial *p_spatial);
|
virtual Ref<SpatialEditorGizmo> create_spatial_gizmo(Spatial *p_spatial);
|
||||||
virtual bool forward_canvas_gui_input(const Ref<InputEvent> &p_event);
|
virtual bool forward_canvas_gui_input(const Ref<InputEvent> &p_event);
|
||||||
|
|
Loading…
Reference in a new issue