-
-
Notifications
You must be signed in to change notification settings - Fork 21.7k
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 override editor settings per project #69012
base: master
Are you sure you want to change the base?
Conversation
This comment was marked as resolved.
This comment was marked as resolved.
a58fc36
to
e552960
Compare
To me it would make sense the text was either warning yellow or accent color. However, warning yellow would be akin to inherited properties in the Inspector, which is not quite the same concept. So, maybe the accent color, plus a symbol to the side of the Label, plus an additional paragraph to the tooltip explaining what is going on may be nice |
The dialog uses standard inspector, so not sure how to display custom stuff without making too many specific changes. |
Well, what is it that you could do? To begin from something concrete. |
Some things I noticed:
|
I think this is a good feature, but there are two remarks:
Mockup: |
One thing at the time. The look of the mock-up is... kind of interesting, although I'm not sure it's ideal for this. It's not like you'll see different names for "Override for _" in one project, so it just ends up being redundant. |
Another option is to use two columns for global settings and overrides for the current project, like in git gui: It's probably better for UX (it's not obvious to everyone that setting names have a context menu), but more cluttered.
It could just be "Override for current project". |
e552960
to
62831b4
Compare
The more warning settings are added, the more necessary this feature feels. |
62831b4
to
8ce35e8
Compare
EditorSettings::get_singleton()->set_manually("interface/theme/preset", config.preset); | ||
EditorSettings::get_singleton()->set_manually("interface/theme/accent_color", config.accent_color); | ||
EditorSettings::get_singleton()->set_manually("interface/theme/base_color", config.base_color); | ||
EditorSettings::get_singleton()->set_manually("interface/theme/contrast", config.contrast); | ||
EditorSettings::get_singleton()->set_manually("interface/theme/draw_extra_borders", config.draw_extra_borders); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This made the overrides apply permanently. Not sure if it's safe to remove, but these settings are fetched a few lines above, so it's super unlikely they will get modified here. Unless I'm missing something.
8ce35e8
to
3376148
Compare
Ok this is what I came up with: godot.windows.editor.dev.x86_64_Zsd29jRBgO.mp4( Just pushed the changes. The overrides are functional, but the goto button is not working yet. Also code needs cleanup. |
55096fb
to
7f5ba1f
Compare
Finished. Feel free to test and review. |
7f5ba1f
to
ba247bc
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will compile and test this tomorrow but the code looks good
override_button = memnew(Button); | ||
override_button->set_tooltip_text(TTR("Override this setting for the current project.")); | ||
container->add_child(override_button); | ||
override_button->connect(SNAME("pressed"), callable_mp(this, &EditorSettingsPropertyWrapper::_create_override)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
override_button->connect(SNAME("pressed"), callable_mp(this, &EditorSettingsPropertyWrapper::_create_override)); | |
override_button->connect(SceneStringName(pressed), callable_mp(this, &EditorSettingsPropertyWrapper::_create_override)); |
goto_button = memnew(Button); | ||
goto_button->set_tooltip_text(TTR("Go to override in Project Settings.")); | ||
override_info->add_child(goto_button); | ||
goto_button->connect(SNAME("pressed"), callable_mp(EditorNode::get_singleton(), &EditorNode::open_setting_override).bind(property), CONNECT_DEFERRED); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
goto_button->connect(SNAME("pressed"), callable_mp(EditorNode::get_singleton(), &EditorNode::open_setting_override).bind(property), CONNECT_DEFERRED); | |
goto_button->connect(SceneStringName(pressed), callable_mp(EditorNode::get_singleton(), &EditorNode::open_setting_override).bind(property), CONNECT_DEFERRED); |
remove_button = memnew(Button); | ||
remove_button->set_tooltip_text(TTR("Remove this override.")); | ||
override_info->add_child(remove_button); | ||
remove_button->connect(SNAME("pressed"), callable_mp(this, &EditorSettingsPropertyWrapper::_remove_override)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove_button->connect(SNAME("pressed"), callable_mp(this, &EditorSettingsPropertyWrapper::_remove_override)); | |
remove_button->connect(SceneStringName(pressed), callable_mp(this, &EditorSettingsPropertyWrapper::_remove_override)); |
void ProjectSettingsEditor::popup_for_override(const String &p_override) { | ||
popup_project_settings(); | ||
tab_container->set_current_tab(0); | ||
general_settings_inspector->set_current_section("editor_overrides/" + p_override.get_slice("/", 0)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
general_settings_inspector->set_current_section("editor_overrides/" + p_override.get_slice("/", 0)); | |
general_settings_inspector->set_current_section(ProjectSettings::EDITOR_SETTING_OVERRIDE_PREFIX + p_override.get_slice("/", 0)); |
I would gently ask about risky or very subjective personal preferences not related to a project, like background color, text color, gizmo colors, etc. If they are saved in the project.godot file and replace my preferences, is there any way I can overwrite them again? Please think about collaborative work. I understand and like the ability to override many editor settings, but I'm not sure if I'll be able to keep my work environment settings that are not related to the project (which is usually shared with others). If not, I would like to have possibility to lock settings important for me (but not related to the project), or another layer of override - a kind of Finally I think that overriding everything is a very dangerous change (exploits in shared/public repositories, security vulnerabilities). You can set paths to exe files in Editor Settings. I'm pretty sure that I will able to commit malware and run it on someone's host through Godot Editor. EDIT: my proposal is to prepare a curated list of safe and relevant to a project settings (see #98235 as a starting point, which is, for now, unsafe too) EDIT2: Excluding risky settings should not be a solution. Any new setting will be potentially risky. We should implement "deny all, allow some" pattern here. EDIT3: adding safe overrides in |
I wonder how the |
Why would someone do that though? In collaborative work this stuff should be discussed in the team, so I expect people won't just randomly override other's settings. I mean, even right now you can e.g. disable or enable some GDScript warnings because you don't like them and this affects all team members.
Not sure what do you mean by that. It's already possible when you run a project from untrusted source. It can be a malicious tool script that runs in the main scene, or even a prepared Theme set as project's default. Running random projects is always a risk and this PR doesn't really make it any worse. Note that to run a malware executable, you'd need to distribute it together with the project. |
8257de2
to
0b7c6e6
Compare
I'd like too. But there are mistakes, jokes, attacks. On the other side I'm using .vimrc which could be dangerous (but I haven't noticed issues, because nobody uses vim).
Oh, you're right. Tool script with
|
The overrides only apply for the specific project and can't permanently "damage" your editor settings. If you are worried about jokes/attacks within your own project, the same applies to any other content. E.g. someone can replace the main character with a clown, as a joke. I don't see how it is different from trolling by overriding editor settings.
|
Thanks. Subscribed.
For me there is a difference between destroying my desk (overriding >my< preferences) and showing picture of a destroyed desk (a clown character). |
Tested and works as expected, one thing I noticed though was that the button to remove the override was hard to click, it appears to only be working when clicking exactly on the cross, which makes it hard to use, otherwise it seems to work well! |
That's the default button for deletable properties (same as e.g. in metadata), so it's unrelated to this PR. |
Since the purpose of proposal is more about one user customizing the editor per project than using the same editor settings in a project with others, maybe the overridden editor settings should be saved separately from the project settings. |
For me, there are two cases:
The latter is not necessary at all - private settings are saved in editor settings already, and they are mostly global (cross project). Because our preferences (subjective settings) are generally same for all projects. The whole thing is about settings important for collaborative work, which sometimes are related to the editor. IMHO some editor settings should be overridden by project settings. In the other words - in such cases the code editor should use project settings at highest priority. If this is not set in the project settings, the code editor should use the editor settings. For your case (override your private preferences in project, just for you) the proposed 'override.cfg' will work if you add this file to .gitignore. But you will not be able to store code-related settings. That's why I'm still not sure if these settings should be combined in one file. But yes, when used carefully it will fit our needs in most cases. |
That would require adding another hard-coded file in the project's main directory. |
There is already override.cfg. The code-related settings could be saved in project.godot. Having both we can achieve flexibility. Use cases:
P1 and p2 will be solved by this PR. But having just only override.cfg will prevent from achieving p3. Thanks, have a good day. |
Export path is not a setting. |
0b7c6e6
to
79caf22
Compare
Most likely with this PR it will be possible to implement godotengine/godot-proposals#827 without overengineered hacks, just by 1) exposing feature profile as ordinary editor settings and 2) adding an option to replace pathes in settings with |
This PR allows to override any editor setting for any project, so you can customize your editor per-project.
Closes godotengine/godot-proposals#1480
godot.windows.editor.dev.x86_64_49rzlQvaqS.mp4