-
-
Notifications
You must be signed in to change notification settings - Fork 21.3k
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
Do not override window setting defaults #12022
Conversation
When exporting project settings, Godot only export values not equal to their defaults. Before this fix exporting project from command line omitted display/window/size settings, because their default values were set from existing values in project settings, so Godot considered them unchanged. This commit adds GLOBAL_DEF_MISSING macro which only overrides the setting's default value if the setting did not already exist.
GLOBAL_DEF already does not override settings that actually exist
…On Oct 11, 2017 9:08 AM, "Ruslan Mustakov" ***@***.***> wrote:
When exporting project settings, Godot only export values not equal to
their defaults. Before this fix exporting project from command line
omitted display/window/size settings, because their default values
were set from existing values in project settings, so Godot considered
them unchanged.
This commit adds GLOBAL_DEF_MISSING macro which only overrides the
setting's default value if the setting did not already exist.
------------------------------
You can view, comment on, or merge this pull request online at:
#12022
Commit Summary
- Do not override window setting defaults
File Changes
- *M* core/project_settings.cpp
<https://github.com/godotengine/godot/pull/12022/files#diff-0> (7)
- *M* core/project_settings.h
<https://github.com/godotengine/godot/pull/12022/files#diff-1> (5)
- *M* main/main.cpp
<https://github.com/godotengine/godot/pull/12022/files#diff-2> (22)
Patch Links:
- https://github.com/godotengine/godot/pull/12022.patch
- https://github.com/godotengine/godot/pull/12022.diff
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#12022>, or mute the thread
<https://github.com/notifications/unsubscribe-auth/AF-Z2zfMsBKI9Co7b5TlRu3tMFGNRb-vks5srK_SgaJpZM4P1XYL>
.
|
It does not override the current value, but it calls `set_initial_value`
unconditionally, and that's the problem.
On Wed, Oct 11, 2017 at 8:11 PM Juan Linietsky <notifications@github.com>
wrote:
… GLOBAL_DEF already does not override settings that actually exist
On Oct 11, 2017 9:08 AM, "Ruslan Mustakov" ***@***.***>
wrote:
> When exporting project settings, Godot only export values not equal to
> their defaults. Before this fix exporting project from command line
> omitted display/window/size settings, because their default values
> were set from existing values in project settings, so Godot considered
> them unchanged.
>
> This commit adds GLOBAL_DEF_MISSING macro which only overrides the
> setting's default value if the setting did not already exist.
> ------------------------------
> You can view, comment on, or merge this pull request online at:
>
> #12022
> Commit Summary
>
> - Do not override window setting defaults
>
> File Changes
>
> - *M* core/project_settings.cpp
> <https://github.com/godotengine/godot/pull/12022/files#diff-0> (7)
> - *M* core/project_settings.h
> <https://github.com/godotengine/godot/pull/12022/files#diff-1> (5)
> - *M* main/main.cpp
> <https://github.com/godotengine/godot/pull/12022/files#diff-2> (22)
>
> Patch Links:
>
> - https://github.com/godotengine/godot/pull/12022.patch
> - https://github.com/godotengine/godot/pull/12022.diff
>
> —
> You are receiving this because you are subscribed to this thread.
> Reply to this email directly, view it on GitHub
> <#12022>, or mute the thread
> <
https://github.com/notifications/unsubscribe-auth/AF-Z2zfMsBKI9Co7b5TlRu3tMFGNRb-vks5srK_SgaJpZM4P1XYL
>
> .
>
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#12022 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ACTkudgtX0-mUDanMF7A9KRLYpa-7bcGks5srL5lgaJpZM4P1XYL>
.
|
Ah I see, this is why I split it in GLOBAL_GET and GLOBAL_DEF, so
GLOBAL_DEF is used for setting (and optionally getting) the initial value
and GLOBAL_GET to get it in case it's needed.
I think in this case, this is probably a bug that needs to be fixed
properly, there is a lot of harcoded code in ProjectSettings that should
be moved out or initialized using GLOBAL_DEF properly.. maybe some sort of
function initialize_defaults() or similar
On Wed, Oct 11, 2017 at 12:57 PM, Ruslan Mustakov <notifications@github.com>
wrote:
… It does not override the current value, but it calls `set_initial_value`
unconditionally, and that's the problem.
On Wed, Oct 11, 2017 at 8:11 PM Juan Linietsky ***@***.***>
wrote:
> GLOBAL_DEF already does not override settings that actually exist
>
> On Oct 11, 2017 9:08 AM, "Ruslan Mustakov" ***@***.***>
> wrote:
>
> > When exporting project settings, Godot only export values not equal to
> > their defaults. Before this fix exporting project from command line
> > omitted display/window/size settings, because their default values
> > were set from existing values in project settings, so Godot considered
> > them unchanged.
> >
> > This commit adds GLOBAL_DEF_MISSING macro which only overrides the
> > setting's default value if the setting did not already exist.
> > ------------------------------
> > You can view, comment on, or merge this pull request online at:
> >
> > #12022
> > Commit Summary
> >
> > - Do not override window setting defaults
> >
> > File Changes
> >
> > - *M* core/project_settings.cpp
> > <https://github.com/godotengine/godot/pull/12022/files#diff-0> (7)
> > - *M* core/project_settings.h
> > <https://github.com/godotengine/godot/pull/12022/files#diff-1> (5)
> > - *M* main/main.cpp
> > <https://github.com/godotengine/godot/pull/12022/files#diff-2> (22)
> >
> > Patch Links:
> >
> > - https://github.com/godotengine/godot/pull/12022.patch
> > - https://github.com/godotengine/godot/pull/12022.diff
> >
> > —
> > You are receiving this because you are subscribed to this thread.
> > Reply to this email directly, view it on GitHub
> > <#12022>, or mute the thread
> > <
> https://github.com/notifications/unsubscribe-auth/AF-
Z2zfMsBKI9Co7b5TlRu3tMFGNRb-vks5srK_SgaJpZM4P1XYL
> >
> > .
> >
>
> —
> You are receiving this because you authored the thread.
> Reply to this email directly, view it on GitHub
> <#12022 (comment)
>,
> or mute the thread
> <https://github.com/notifications/unsubscribe-auth/ACTkudgtX0-
mUDanMF7A9KRLYpa-7bcGks5srL5lgaJpZM4P1XYL>
> .
>
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#12022 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AF-Z23mxosbjb61cdV5GMzDLGuJMCTmdks5srOWCgaJpZM4P1XYL>
.
|
Sorry, but I didn't get what the proper fix for this would be. Could you elaborate? Instead of adding a version of GLOBAL_DEF that does NOT override the default value if it exists, we could simply add |
I changed the code to be more intuitive. It should now respect the resolution in the project settings no matter what. Please let me know if this works for you. |
When exporting project settings, Godot only export values not equal to
their defaults. Before this fix exporting project from command line
omitted display/window/size settings, because their default values
were set from existing values in project settings, so Godot considered
them unchanged.
This commit adds GLOBAL_DEF_MISSING macro which only overrides the
setting's default value if the setting did not already exist.