-
-
Notifications
You must be signed in to change notification settings - Fork 21.4k
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 set custom feature tags for testing #63529
Conversation
I think this kind of feature would be nice to have exposed together with the dialog I propose here to configure run options and number of instances: godotengine/godot-proposals#522 (comment) There could be an additional text field for each instance to configure custom feature tags (so you can also test e.g. how |
Would this also work when exporting projects through the command line for CI environments? Something like this? |
It should work, but that reminds me… The environment variable's naming should be changed to match Godot conventions. Specifically, all environment variables should be prefixed with |
eab9bc1
to
f78c32e
Compare
No, it only works when running the project. It does not affect the export. EDIT:
I can change this after #65753 is merged |
f165f5b
to
62b3687
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.
Tested locally (rebased against master
da81ca6), it works as expected.
I suggest moving this to the Debug menu indeed, as this functionality is not persisted to project.godot
.
core/config/project_settings.cpp
Outdated
#ifdef TOOLS_ENABLED | ||
// Available only at runtime in editor builds. Needs to be processed before anything else to work properly. | ||
if (!Engine::get_singleton()->is_editor_hint()) { | ||
String editor_features = OS::get_singleton()->get_environment("__GODOT_EDITOR_CUSTOM_FEATURES__"); |
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.
Is there a reason the environment variable is surrounded by 2 underscores? I think the EDITOR
makes it clear that it'll only work in editor builds. This feature should be able to work when running a project from the command line when using an editor build after all.
For comparison, other environment variables used by Godot aren't surrounded by underscores.
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 is to signify that this variable is internal. Another example:
Line 306 in da81ca6
OS::get_singleton()->set_environment("__GODOT_EDITOR_STOP_SHORTCUT__", shortcut); |
Although maybe using it from command line makes sense.
I would put this dialog inside the editor settings, as a simple entry. I don't feel it needs to have a new menu entry. |
Setting feature tags for testing is specific to a project, rather than something you enable for all projects in your editor instance. Maybe we should merge this dialog together with the one that lets you customize command line arguments for each instance? |
This can be worked on now. Feel free to involve other folks in the UI concept if you're unsure about how to feature everything in that dialog. |
I'm wondering if this wouldn't work better with a table like we have for Autoloads, etc.
The main challenge may be for the "Override ..." columns not to take too much space so there's still enough for the actually args and feature tags. Maybe the column names can be wrapped on two lines. Edit: Seems possible to wrap long column names for columns meant to be small, we do it for Autoloads "Global Variable": Edit 2: And possibly it could use the same kind of widget we have in the inspector to add/remove elements to arrays/dictionaries... but I guess those are completely different types of controls so it might requirement significant rework which is maybe not worth it. |
ae09433
to
0722436
Compare
Ok pushed the design I showed above, I'll try to change it to table. EDIT: |
cb449b2
to
5dd6941
Compare
It looks pretty good 🙂 I'm wondering if this table could have alternating row colors, by the way. This would help improve readability of long rows, but I don't remember if we have support for that in Tree.
Yes – if in doubt, push it as a separate commit and squash it later. |
That looks pretty good to me! |
5dd6941
to
5fc1160
Compare
Pushed the new design. Old code is in 5dd6941 |
7061567
to
a720c28
Compare
Tested briefly, it seems to work well! The original minsize seems to be too small to fit the table initially, it would need some more space: Bunch of ideas for future improvements, but let's maybe wait and see what users request:
|
#ifdef TOOLS_ENABLED | ||
// Available only at runtime in editor builds. Needs to be processed before anything else to work properly. | ||
if (!Engine::get_singleton()->is_editor_hint()) { | ||
String editor_features = OS::get_singleton()->get_environment("GODOT_EDITOR_CUSTOM_FEATURES"); |
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.
For discussion's sake - any particular reason to pass these as an environment variable instead of a new command line argument?
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.
Not really. Environment variable is easier to access and parse, but it could be a command line argument I guess. I used the same approach as #47744 (though in that PR a variable made more sense, because it was passing event data).
Some features are defined using
#34528 would be one idea, but not sure how it would work.
Should I change it now? |
Yeah that would be good if you know what to change. For the record I'm on a 2K screen with 150% system scaling (and the same configured for Godot scaling). |
It's this line: set_min_size(Size2i(1200, 500) * EDSCALE); Though not sure what value I should use. I didn't observe this problem on my side. |
a720c28
to
1b2c7bf
Compare
Increased height to 600. |
Thanks! |
Closes godotengine/godot-proposals#373
Added a dialog under "Project -> Tools -> Custom Feature Tags..." that allows to specify custom feature tags when running the project. The are read during Project Settings initialization (passed via
__GODOT_EDITOR_CUSTOM_FEATURES__
environment variable), so they also affect project setting feature overrides.godot.windows.tools.64_cInpHtDNT0.mp4
EDIT:
New look:
Production edit: closes godotengine/godot-roadmap#18