mirror of
https://github.com/godotengine/godot.git
synced 2024-11-27 09:16:35 +08:00
Merge pull request #15640 from willnationsdev/resource-saved-signal
Added EditorPlugin 'resource_saved' signal
This commit is contained in:
commit
d4cdee5f9e
@ -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() {
|
||||
|
||||
for (int i = 0; i < editor_plugins.size(); i++) {
|
||||
|
@ -204,6 +204,7 @@ public:
|
||||
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);
|
||||
void notify_edited_scene_changed();
|
||||
void notify_resource_saved(const Ref<Resource> &p_resource);
|
||||
|
||||
EditorData();
|
||||
};
|
||||
|
@ -631,6 +631,7 @@ void EditorNode::save_resource_in_path(const Ref<Resource> &p_resource, const St
|
||||
|
||||
((Resource *)p_resource.ptr())->set_path(path);
|
||||
emit_signal("resource_saved", p_resource);
|
||||
editor_data.notify_resource_saved(p_resource);
|
||||
}
|
||||
|
||||
void EditorNode::save_resource(const Ref<Resource> &p_resource) {
|
||||
|
@ -473,6 +473,10 @@ void EditorPlugin::notify_scene_closed(const String &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) {
|
||||
//??
|
||||
if (get_script_instance() && get_script_instance()->has_method("create_spatial_gizmo")) {
|
||||
@ -757,6 +761,7 @@ void EditorPlugin::_bind_methods() {
|
||||
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("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_SPATIAL_EDITOR_MENU);
|
||||
|
@ -167,6 +167,7 @@ public:
|
||||
void notify_main_screen_changed(const String &screen_name);
|
||||
void notify_scene_changed(const Node *scn_root);
|
||||
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 bool forward_canvas_gui_input(const Ref<InputEvent> &p_event);
|
||||
|
Loading…
Reference in New Issue
Block a user