-
-
Notifications
You must be signed in to change notification settings - Fork 22k
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 built-in GUI to display license notices (reverted) #79599
Conversation
dfff79d
to
7ec3b9e
Compare
7ec3b9e
to
f8a5afd
Compare
Instead of basing the new node-type on |
Any reason the new class is exposed? It doesn't need to, the relevant documentation can be inside |
How about using |
Ah for some reason I though the method is used for the shortcut. Yeah, it can be replaced with a plain AcceptDialog. If you need to do something extra in |
SVG for the dialog that's 1 kB smaller:
|
I thought I was required to expose it, but it looks like it works fine if it's not exposed. I've unexposed the class as a result.
It requires advanced GUI functionality, which is disabled when building Godot with These are the nodes that are unavailable when building with godot/scene/register_scene_types.cpp Lines 414 to 452 in 57919be
Window and Popup base classes are available though.
Thanks 🙂 I've incorporated it and added you as a co-author. |
085fed9
to
3e201fe
Compare
Then it could be a Window. Although it doesn't really matter if the class is not exposed. |
b85fa26
to
201064e
Compare
Pretty sure they are both as fast, but RTL is shaped in thread. If you could divide the whole text into smaller labels, you could add them one by one inside |
There is a precedent of built-in license dialogs in frameworks, so that legal compliance happens automatically. Try Ctrl + Alt + Middle click in any wxWidgets application (such as FileZilla) and see 🙂 In my experience, it's very common for smaller projects (such as gamejam games) to forget mentioning third-party notices, so anything that can make basic compliance happen out of the box is welcome.
Using Project > Tools > Engine Compilation Configuration Editor, it should be possible to disable the LicensesDialog node (although I haven't tested it and it might not compile with the class disabled right now).
I picked a shortcut that's difficult to press by mistake; it's not anywhere near the WASD keys. We could make it also require Alt if we want to be extra sure (so it would be Ctrl + Alt + Shift + L.
This file wouldn't be accessible on mobile and web platforms, so it wouldn't be compliant there as there is no way for regular users to access it.
This licenses dialog is supposed to inherit from the default project theme configured in the Project Settings. If it isn't, please open an issue with a minimal reproduction project attached. Edit: This seems to be the case already: #103820 |
A game engine is different from a regular tool app. The end-user of a game engine will be impacted by a built-in license dialog, but the end-user of tools like FileZilla will not. Since game developers typically want to have full control with what they want to present to the player. |
Then I guess a follow-up PR that implements the |
IMO It may not be easily pressed by mistake but for some application-like usages(for example, my undergoing modeling tool project), there's still possibility to conflict with user's preconfigured keymaps, as |
This feature should NOT be default enable In short, it is not common enough to add as a built-in feature By the way, I can trigger two explorer windows with Ctrl + Alt + Shift + L |
If you handle the license display yourself, you can simply unbind the default shortcut in the project settings. What's the purpose of having a build option? |
For reducing unwanted code size, similar to all other optional scons options Godot provides. |
The amount of code added is negligible, it does not make any sense to have a dedicated option for it. It's only a dialog code, the licenses text itself was always included. |
I doubt that compiling this out would give any meaningful size reductions. My PR to compile out the |
I'd ask that users be more mindful of how you provide feedback on PRs. 5 users jumping out or the blue on a PR to criticize it within 30 min feels quite toxic, coordinated, and out of proportion for what this PR does and how much it would actually impact you. And the PR hasn't even been in a dev snapshot to get actually testing. It's fine to provide feedback and even to question whether a PR is a good implementation or even a good idea, but please read the room and don't double down when others already expressed your points word for word. |
You do have the point; I give up on that part.
Then what should we do for platforms where the shortcuts are not an option? The whole idea of embedding the License window is to make sure there is a way to toggle up the GUI right? |
There's an API you can call to show/hide that dialog:
So the main way I would envision users using this is by adding a button in their game credits to show the dialog. The rationale for having this dialog built-in and not just leave it to all users to do manually is that it's quite a lot of work to make a dialog like this, and not something that we think users reasonably want to spend days of development on. Since all Godot users are required to document license details, we figured that having a tool like this can help them do it without too much effort. Of course users are free to choose not to use it, or make their own detailed credits covering all third-party licenses in Godot. |
Random users see the merge message of this PR from the Git branch history and send it across their circle of influence. During the discussion, users with opinions choose to comment on this PR. This process propagates and ends up in what you see as a burst. I do agree people should be mindful about their wording. |
Putting it as an official add-on accomplishes the same thing. This dialog is not eligible to be in core even for godot-proposals. It's too much manual work to set it up properly. Inexperienced developers and regular players won't notice it. Experienced developers don't need it to be in core when they can do it by themselves or download the dialog via the asset marketplace. |
As a minor convenience, it might be useful to separate the part of the code that generates the license text to its own method so that people can make their own UI for the license text styled as they want (or placed where they want it, e.g. at a credits screen) but without having to copy/paste or generate the text themselves. |
It already exists: |
I think this PR could be published as an official addon that developers can easily install and enable it. By the way, my |
Since not all platforms support shortcut keys, and we can already control their visibility through code, I think it's reasonable to remove the default shortcut key assignments. |
My point is not about shortcuts or something minor, but the purpose of this PR and how well it works.
Provide this dialog as an add-on would be a much more appropriate way. Developers would know that was a thing and integrate it into their project. All the team need to do is to educate developers about the importance of it in the docs. I don't think this PR accomplished any of its possible intentions well enough to stay in core. |
It's not about whether they know it or not. If the dialog exists and it's accessible, it makes you automatically comply with the license. |
The dialog won't be accessible on mobile and web without a keyboard if developers don't implement a button to open it up. On PC, an auto-generated LICENSE file is already enough to make the developers automatically comply with the license. |
I guess the key disagreement is here: The developer for the web and mobile platform needs to manually implement a button to make the window accessible. However, they need to acknowledge that the window exists in the first place. Once they know, they will likely create a license window themselves, making the original intention of the PR awkward. |
Providing zero (or minimal) effort way for license compliance. 99% of users do not care about third-party licenses and will never view it, so developers can avoid spending any time on customizing / making own UI for it.
Yes, but adding a single button is much less work that making dialog yourself.
It's documented here https://docs.godotengine.org/en/stable/about/complying_with_licenses.html, not sure what else can be done. |
Perhaps adding notifications to the export window? |
The PR was merged. Arguing here just leads to bikeshedding. If you disagree with the current state of the engine, either create a proposal if you want to suggest a new way to deal with this or create an issue. |
Just noting: We locked the discussion because it was quite bikeshedding and a hot topic (30+ messages in a couple hours). But we hear the feedback and will see how to shape this further to take it into account. I agree there are some aspects we need to reconsider in the current implementation. |
A related issue was created. #103830 |
We're reverting this for now (#103906) to go back to the drawing board and see what a more consensual implementation could be. |
Press Ctrl/Cmd + Shift + L (
ui_toggle_licenses_dialog
built-in action) to show/hide the notices dialog.The dialog can be shown via script using
SceneTree.licenses_dialog_visible = true|false
. Since the default shortcut is not usable on mobile platforms, it is recommended to create a button that setsSceneTree.licenses_dialog_visible
totrue
when pressed in your project's menus.PS: I believe this is the first built-in high-level GUI component we make available in projects. It'll be interesting to see what can be done in the future with this approach.
Fun fact: This is the first time I add a new node to Godot in C++ 🙂
Testing project: test_licenses_dialog.zip
Preview
TODO
disable_advanced_gui=yes
. I've purposefully avoided advanced GUI nodes for this dialog, but had to switch to RichTextLabel because Label was extremely slow to shape the text.