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

Add ability to override any editor setting for any project #1480

Open
me2beats opened this issue Sep 9, 2020 · 17 comments · May be fixed by godotengine/godot#69012
Open

Add ability to override any editor setting for any project #1480

me2beats opened this issue Sep 9, 2020 · 17 comments · May be fixed by godotengine/godot#69012

Comments

@me2beats
Copy link

me2beats commented Sep 9, 2020

Describe the project you are working on:
gdscript plugins

Describe the problem or limitation you are having in your project:
say there is "constrain editor view" setting.
I'd like to have it enabled by default but disabled for some projects, say for project X.
but now there's no "official" way to do that.
As a result every time I open project X, I need to go to Editor settings, then
disable "constrain editor view" then do some work, and after that set the setting "constrain editor view" back.
and what would be really inconvenient if I need to do this for several/several dosens of Editor settings

Describe the feature / enhancement and how it helps to overcome the problem or limitation:
The idea is adding ability to set editor settings per project.
I think it's possible to have global Editor settings (what Editor settings actually are now) and local ones.
For example the user could specify which settings he wants to be "local", so that these settings won't affect other projects Editor settings.

I believe this would make work with different projects more flexible and customizable, because the user may wish different Editor settings values for different projects (depending on project type, game genre, target platforms and so on)

Describe how your proposal will work, with code, pseudocode, mockups, and/or diagrams:
"local project editor settings" could be stored in project res:// dir for example, maybe in a separate file. I think there's no need to write every single setting value, but only values of settings which user make "local"

If this enhancement will not be used often, can it be worked around with a few lines of script?:
I don't think so

Is there a reason why this should be core and not an add-on in the asset library?:
it could be a plugin but I'm afraid it would be a hacky one, and this won't work correctly in some cases
for example it is obvious that the implementation of this feature as a plugin will require the user to have this plugin active in every project where the user wants to use this feature. And this may be inconvenient

@aaronfranke
Copy link
Member

One option is that you can have two copies of Godot stored on your computer, and put a ._sc_ file next to the Godot executable. If Godot detects this file, it will run in self-contained mode, creating an editor_data folder to store editor settings. This way you can have multiple sets of editor settings on your computer.

@Calinou Calinou changed the title Add ability to set editor settings per project Add ability to set editor settings on a per-project basis Sep 9, 2020
@Calinou
Copy link
Member

Calinou commented Sep 9, 2020

To complement what @aaronfranke said, see Data paths in the documentation.

@me2beats
Copy link
Author

me2beats commented Sep 9, 2020

_sc_ doesn't seem a good solution because I would need to use a separate godot exe file for each project where I want unique editor settings.

Also I would need to sync other Editor settings on my own but the idea of ​​local editor settings is to have general global Editor settings and at the same time override only some settings for some projects.

@Calinou
Copy link
Member

Calinou commented Sep 9, 2020

sc doesn't seem a good solution because I would need to use a separate godot exe file for each project where I want unique editor settings.

I think you could make symbolic links of the Godot executable (using the mklink command) to save disk space.

@me2beats
Copy link
Author

me2beats commented Sep 9, 2020

I think you could make symbolic links of the Godot executable (using the mklink command) to save disk space.

let me clarify what the proposal should do.

say there are Editor settings k, l, m...
with default integer values:
k = 0,
l = 0
m = 0
...
let's say all Editor settings are equal to 0 by default

and I have projects A B C
and I need different editor settings to be overriden for each project:
for project A:
k = 1

for B:
l = 1

for C:
m= 1

Now I go to Global Editor settings and set all of them to value 2.
and now when opening the projects I can see:

A: all settings changed to 2, except k = 1
B: all settings changed, to 2 except l = 1
C: all settings changed to 2, except m = 1


So in this example I would need to create godot.exe for projects k, l, m.
It's a weird solution, but (even if I could change exe files to symbolic links) the thing I that worries me more is I don't see how to easily syncronize k, l, m editor settings with the global ones.
Because the idea is not only to have isolated settings but also respect Global ones

@bfelbo
Copy link

bfelbo commented Sep 11, 2020

It might make sense to take inspiration from VS Code, which has both user and workspace settings with the workspace settings being applied on top of any user settings: https://code.visualstudio.com/docs/getstarted/settings

The workspace settings can then be added to version control, which is incredibly useful for collaboration. At the same time, each user can have e.g. their own color scheme, font sizes, path settings etc.

@me2beats
Copy link
Author

I have some implementation details:

in Editor settings we could have "override for current project" button

So you could select a property, then press the "override" button and then set the property value.

There should be an easy way:

  • to override a property
  • to reset/remove overriding a property
  • to see if a property is overriding.

The information for overridden properties could be stored as a project setting say "editor_override"

@lokimckay
Copy link

lokimckay commented May 23, 2021

+1
Specifically, I would like the ability to override the "Interface -> Theme -> Preset" editor setting at a project level.

image

My game uses the client / server pattern and I like to set the server project to a different Theme preset so that it is easier to visually distinguish between the 2 projects.

Currently this is possible to achieve while both projects are opened, but as soon as both projects are closed and reopened, the last selected theme will be applied to both projects. Fiddling around with my godot editor binary to ensure that each project retains the theme seems unreasonable to me

My preferred solution would be for me to create an .editorSettings file at the root of my project which will behave in the same way that @me2beats and @bfelbo are describing - i.e. any items configured in the file will take precedence over the editor settings stored at my %APPDATA% directory

image

@Calinou
Copy link
Member

Calinou commented May 23, 2021

@sneyed You can likely write an editor plugin to do that in the project where you wish the theme to be overwritten.

You can also copy the Godot editor binary to another location (or symlink it) and use self-contained mode to use different settings for each binary.

@lokimckay
Copy link

@Calinou thank you for the suggestion but I feel that both of those workarounds require a disproportionate amount of effort to just set a different theme per project

@Calinou
Copy link
Member

Calinou commented May 23, 2021

@Calinou thank you for the suggestion but I feel that both of those workarounds require a disproportionate amount of effort to just set a different theme per project

Also, I think godotengine/godot#34528 would be a better way to address this problem.

@lokimckay
Copy link

lokimckay commented May 23, 2021

@Calinou godotengine/godot#34528 would indeed address the issue I described. But consider that I also like to configure the window placement of my server project to the top-left of the screen in Editor Settings so that the 2 windows do not overlap when I run both projects. This is just 1 other example where I would like to set editor setting per project.

I feel that there is more value in being able to override any Editor Setting per project, rather than adding additional Project Settings to cover these kind of desires - otherwise I think many Editor Settings may migrate to Project Settings.

@me2beats me2beats changed the title Add ability to set editor settings on a per-project basis Add ability to override any editor setting for any project Jan 3, 2022
@me2beats
Copy link
Author

me2beats commented Jan 3, 2022

The plugin I'm making now should only work if some EditorSetting is disabled.
An ability to override that editor setting would be useful here.
That is the plugin could set-override the setting only for this project, without touching other projects.

@DrParanoia
Copy link

DrParanoia commented Dec 11, 2023

+1 to this issue. I have a Server and a Client project for my game and I work on them at the same time. Without this feature setting up debug ports each time is a bit of a hassle. Also changing the Language Server port each time for an external editor is a pain 😢

@Calinou
Copy link
Member

Calinou commented Dec 11, 2023

+1 to this issue. I have a Server and a Client project for my game and I work on them at the same time. Without this feature setting up debug ports each time is a bit of a hassle. Also changing the Language Server port each time for an external editor is a pain 😢

I feel this particular problem (changing debug port on a per-project basis) is something the editor should handle automatically, rather than requiring you to configure it manually. This should already happen automatically for the editor debugger since 4.0.

As for the LSP port, there may be a better way to handle this (e.g. using a random port for the LSP, and storing this port number in a file in .godot/ that the LSP plugin can read).

@DrParanoia
Copy link

DrParanoia commented Dec 14, 2023

+1 to this issue. I have a Server and a Client project for my game and I work on them at the same time. Without this feature setting up debug ports each time is a bit of a hassle. Also changing the Language Server port each time for an external editor is a pain 😢

I feel this particular problem (changing debug port on a per-project basis) is something the editor should handle automatically, rather than requiring you to configure it manually. This should already happen automatically for the editor debugger since 4.0.

As for the LSP port, there may be a better way to handle this (e.g. using a random port for the LSP, and storing this port number in a file in .godot/ that the LSP plugin can read).

Well, unless I reset the Debugging port to default, my Remote debugger on Android does not work 😬 Also, I am not sure that "random" ports is a good idea. Sure you can have a range of ports, but that does not mean that there couldn't be collisions

@Jowan-Spooner
Copy link

I'd like something like this, specifically because I contribute to open source projects some of which use "trim trailing whitespace on save" and some of which don't. Not being able to change it per-project is quite annoying.
Whenever I switch between the projects I have to toggle that setting on and off which is quite annoying and I usually forget it at first and then I already have a bunch of unnecessary changes in the version control.
Seems unlikely this will happen soon, but it'd be nice!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants