Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow to disable automatic property linking #75534

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions doc/classes/EditorSettings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -565,6 +565,9 @@
If [code]true[/code], editor main menu is using embedded [MenuBar] instead of system global menu.
Specific to the macOS platform.
</member>
<member name="interface/inspector/enable_vector_property_linking_by_default" type="bool" setter="" getter="">
If [code]true[/code], properties with [constant @GlobalScope.PROPERTY_HINT_LINK] will be linked by default.
</member>
<member name="interface/inspector/max_array_dictionary_items_per_page" type="int" setter="" getter="">
The number of [Array] or [Dictionary] items to display on each "page" in the inspector. Higher values allow viewing more values per page, but take more time to load. This increased load time is noticeable when selecting nodes that have array or dictionary properties in the editor.
</member>
Expand Down
8 changes: 4 additions & 4 deletions editor/editor_properties.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1751,7 +1751,7 @@ void EditorPropertyVector2::setup(double p_min, double p_max, double p_step, boo
if (!p_link) {
linked->hide();
} else {
linked->set_pressed(true);
linked->set_pressed(EDITOR_GET("interface/inspector/enable_vector_property_linking_by_default"));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be cached to avoid fetching editor settings multiple times every time the inspector refreshes?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll look into it, but editor properties are instantiated each time, so it needs to be cached somewhere in the inspector itself.

Copy link
Member Author

@KoBeWi KoBeWi Apr 3, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Although things like "interface/inspector/horizontal_vector2_editing" don't seem to be cached 🤔
This is accessed once per linked vector property, so I think it's fine to use EDITOR_GET.

}
}

Expand Down Expand Up @@ -2033,7 +2033,7 @@ void EditorPropertyVector3::setup(double p_min, double p_max, double p_step, boo
if (!p_link) {
linked->hide();
} else {
linked->set_pressed(true);
linked->set_pressed(EDITOR_GET("interface/inspector/enable_vector_property_linking_by_default"));
}
}

Expand Down Expand Up @@ -2163,7 +2163,7 @@ void EditorPropertyVector2i::setup(int p_min, int p_max, bool p_link, const Stri
if (!p_link) {
linked->hide();
} else {
linked->set_pressed(true);
linked->set_pressed(EDITOR_GET("interface/inspector/enable_vector_property_linking_by_default"));
}
}

Expand Down Expand Up @@ -2416,7 +2416,7 @@ void EditorPropertyVector3i::setup(int p_min, int p_max, bool p_link, const Stri
if (!p_link) {
linked->hide();
} else {
linked->set_pressed(true);
linked->set_pressed(EDITOR_GET("interface/inspector/enable_vector_property_linking_by_default"));
}
}

Expand Down
1 change: 1 addition & 0 deletions editor/editor_settings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -447,6 +447,7 @@ void EditorSettings::_load_defaults(Ref<ConfigFile> p_extra_config) {
// Inspector
EDITOR_SETTING(Variant::INT, PROPERTY_HINT_RANGE, "interface/inspector/max_array_dictionary_items_per_page", 20, "10,100,1")
EDITOR_SETTING(Variant::BOOL, PROPERTY_HINT_NONE, "interface/inspector/show_low_level_opentype_features", false, "")
_initial_set("interface/inspector/enable_vector_property_linking_by_default", true);

// Theme
EDITOR_SETTING(Variant::STRING, PROPERTY_HINT_ENUM, "interface/theme/preset", "Default", "Default,Breeze Dark,Godot 2,Gray,Light,Solarized (Dark),Solarized (Light),Black (OLED),Custom")
Expand Down