Disable editing properties in foreign resources

from imported scenes or objects returning
true from a function named '_is_read_only' and
disable resaving imported resources.
This commit is contained in:
SaracenOne
2022-04-29 07:06:48 +01:00
parent 34aa6b06a7
commit dd814a0dca
15 changed files with 220 additions and 99 deletions

View File

@ -93,8 +93,9 @@ class InspectorDock : public VBoxContainer {
MenuButton *object_menu = nullptr;
EditorPath *editor_path = nullptr;
Button *warning = nullptr;
AcceptDialog *warning_dialog = nullptr;
bool info_is_warning = false; // Display in yellow and use warning icon if true.
Button *info = nullptr;
AcceptDialog *info_dialog = nullptr;
int current_option = -1;
ConfirmationDialog *unique_resources_confirmation = nullptr;
@ -118,7 +119,7 @@ class InspectorDock : public VBoxContainer {
void _paste_resource();
void _prepare_resource_extra_popup();
void _warning_pressed();
void _info_pressed();
void _resource_created();
void _resource_selected(const Ref<Resource> &p_res, const String &p_property);
void _edit_forward();
@ -145,7 +146,7 @@ public:
void edit_resource(const Ref<Resource> &p_resource);
void open_resource(const String &p_type);
void clear();
void set_warning(const String &p_message);
void set_info(const String &p_button_text, const String &p_message, bool p_is_warning);
void update(Object *p_object);
Container *get_addon_area();
EditorInspector *get_inspector() { return inspector; }